[SOURCE] Prospecting Bot/Addon For LuaNinja menu

User Tag List

Results 1 to 6 of 6
  1. #1
    GliderPro's Avatar Member
    Reputation
    -1
    Join Date
    Mar 2009
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [SOURCE] Prospecting Bot/Addon For LuaNinja

    I've started to mess around with LuaNinja and my first creation is a bot to prospect all my Saronite Ore. I works pretty well but it does have one known issue. Sometimes after it finishes a stack I think the bag data gets out of sync and it tries to target something invalid. You get an error message and it stops the bot. I'm going to work on fixing that next. Now on to the code...

    DISCLAIMER: I don't write much Lua code so this might not be the best way to do this. Constructive comments are welcome...

    Step #1 - Create a directory in your Interface/AddOns folder.

    Step #2 - Create a file called bot1.toc and paste in the following code.

    Code:
    ## Interface: 30200
    ## Title: Bot1
    ## Notes: Prospects your ore.
    ## Dependencies: 
    bot1.lua
    bot1.xml
    Step #3 - Create a file called bot1.xml and paste in the following code.

    Code:
    <Ui xmlns="http://www.blizzard.com/wow/ui/" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://www.blizzard.com/wow/ui/ 
     ..\..\FrameXML\UI.xsd">
    
      <Script File="bot1.lua"/>
      <Frame name="Bot1Frame">
        <Scripts>
          <OnLoad function="Bot1_OnLoad"/>
          <OnEvent function="Bot1_OnEvent"/>
        </Scripts>
      </Frame>
    </Ui>
    Step #4 - Create a file called bot1.lua and paste in the following code.

    Code:
    Bot1_CurrentlyProspecting = false;
    
    function Bot1_OnLoad()
      print("Bot1_OnLoad");
    	this:RegisterEvent("VARIABLES_LOADED");
    	this:RegisterEvent("LOOT_CLOSED");
    end
    
    function Bot1_OnEvent(self, event, ...)
      local eventPrefix, eventSuffix = event:match("^(.-)_?([^_]*)$");
    
      if event == "LOOT_CLOSED" then
        if Bot1_CurrentlyProspecting == true then
          for bag = 0,4,1 do 
            for slot = 1, GetContainerNumSlots(bag), 1 do 
              local name = GetContainerItemLink(bag,slot); 
              if name and string.find(name,"Saronite Ore") then 
                local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bag,slot);
                if not locked then
                  if itemCount >= 5 then
                    CastSpellByName("Prospecting")
                    if( SpellIsTargeting() ) then
                      UseContainerItem(bag,slot);
                    end
                    return
                  end
                end
              end
            end
          end  
          -- didn't find anything to prospect
          Bot1_CurrentlyProspecting = false;
          DEFAULT_CHAT_FRAME:AddMessage("Finished prospecting."); 
        end
      end
    
    end
    
    SLASH_BOT11 = '/bot1';
    local function bot1_handler(msg, editbox)
      DEFAULT_CHAT_FRAME:AddMessage("Prospecting...");
      
      for bag = 0,4,1 do 
        for slot = 1, GetContainerNumSlots(bag), 1 do 
          local name = GetContainerItemLink(bag,slot); 
          if name and string.find(name,"Saronite Ore") then 
            local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bag,slot);
            if not locked then
              if itemCount >= 5 then
                Bot1_CurrentlyProspecting = true;
                CastSpellByName("Prospecting")
                if( SpellIsTargeting() ) then
                  UseContainerItem(bag,slot);
                end
                return
              end
            end
          end
        end
      end  
    end
    
    SlashCmdList["BOT1"] = bot1_handler;
    Just type "/bot1" to kick off the bot.
    Last edited by GliderPro; 11-18-2009 at 07:43 PM.

    [SOURCE] Prospecting Bot/Addon For LuaNinja
  2. #2
    toxicsnipe's Avatar Member
    Reputation
    11
    Join Date
    Mar 2009
    Posts
    51
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just make this macro:

    /cast Prospecting
    /use [Insert stuff]
    /in 2.5 /run RunMacro(1)
    Much easier than an addon.

  3. #3
    GliderPro's Avatar Member
    Reputation
    -1
    Join Date
    Mar 2009
    Posts
    93
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True for that one simple task. On the other hand a macro isn't going to path to the auction house, buy mats, path to the mailbox, craft stuff, disenchant stuff, path back to the auction house and sell stuff...

  4. #4
    MasterGold's Avatar Member
    Reputation
    8
    Join Date
    Mar 2009
    Posts
    256
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, this is cool
    Cheating on World of Warcraft since 2006

  5. #5
    Cageee's Avatar Member
    Reputation
    18
    Join Date
    Feb 2009
    Posts
    128
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by toxicsnipe View Post
    Just make this macro:



    Much easier than an addon.
    A macro script has been blocked from an action only availble to the Blizzard UI

    nice macro! GG :wave:

  6. #6
    ~OddBall~'s Avatar Contributor
    Reputation
    207
    Join Date
    Jan 2008
    Posts
    1,156
    Thanks G/R
    4/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cageee View Post
    A macro script has been blocked from an action only availble to the Blizzard UI

    nice macro! GG :wave:
    If this addon works, so should the macro. Are you even using LUANinja? /facepalm
    https://www.mmowned.com/forums/world-of-warcraft/guides/278302-selecting-bot-you.html - SELECTING THE BOT FOR YOU

    PHWOOOOAAAAAR - Parog was here. <3 <----Wtf's a Parog?

Similar Threads

  1. [Bot] Searching for open source PoGo bot still in active developement
    By randominternethero in forum Pokemon GO Hacks|Cheats
    Replies: 1
    Last Post: 10-06-2016, 05:00 AM
  2. Addon For LuaNinja Macros
    By Tracerv0 in forum WoW UI, Macros and Talent Specs
    Replies: 7
    Last Post: 01-06-2010, 02:21 PM
  3. PVP addon for use with bot
    By wezzer in forum WoW UI, Macros and Talent Specs
    Replies: 8
    Last Post: 06-21-2009, 04:39 AM
  4. PVP addon for use with bot
    By wezzer in forum World of Warcraft Bots and Programs
    Replies: 0
    Last Post: 05-14-2009, 06:54 PM
  5. 2 great PvP addons (for botting too)
    By ayadew in forum World of Warcraft General
    Replies: 8
    Last Post: 04-22-2007, 05:08 PM
All times are GMT -5. The time now is 06:57 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search