• Visit Rebornbuddy
  • [Plugin] Chest Looter

    Discussion in 'Archives' started by echelon17, Feb 11, 2012.

    1. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      This plugin will move to and loot all chests it finds within the game. I notice that the current 'Loot Chests' option in HB does not work, so I wrote this plugin to resolve the problem.

      Only tested on a ground mount with other objects, but it works fine for me.

      EDIT: Changelog: Merged all copies of the plugin into the main post.

      1.0:
      • Initial Release
      1.3:
      • Added blacklisting of objects. Since this plugin searches for the game object type "Chest" (applies to other objects too) containing the word "Chest", it may inadvertently pick out some Chest objects that are unavailable at the time. If it can't loot the chest after 3 attempts, it will blacklist it for an hour.
      • Also added some more sanity checks, such as when on transport, etc.
      2.0:
      • Rewrote a ton of code, hence labeling as 2.0.
      • Fixed incredibly stupid mistake of chaining && conditionals instead of || (or) conditionals - causing the entire plugin to not actually work.
      • Added CanLoot object check to try and reduce the possibility of locating chests that cannot be looted yet and wasting time blacklisting.
      • Added big combat fix. Not sure whether or not this plugin or Singular is causing strange behaviour, but sometimes my character would target mobs above/below me or mobs through walls. I've added some combat target checking now to ensure it will only target closest hostile mobs that are within line of sight. Again, not sure how my plugin would affect mob tracking but what the hell, it's fixed in this.
      3.0:


      • Still learning, so cleaned up things significantly.
      • Tested and confirmed to work fine.


      3.1:


      • Final update.
      • Removed CanLoot() check as this doesn't appear to function properly. HB issue.
      • Changed chest name detection from "Chest" to "Treasure Chest" to eliminate possible false positives. This will ONLY loot treasure chests now and not all chests.

      3.2:


      • Added fix/safeguard for objects out of distance and with no location.

      3.3:


      • Fixed deadlock where HB cannot navigate to chest, so toon remains stuck in position.
       

      Attached Files:

      Last edited: Mar 30, 2012
    2. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      Updated with some fixes/enhancements.
       
    3. xergz

      xergz Member

      Joined:
      Apr 16, 2010
      Messages:
      309
      Likes Received:
      1
      Trophy Points:
      18
      doesnt work with the latest update
      Code:
      [18:48:33:554] Plugin Chest Looter threw an exception in 'Pulse'! Exception:[18:48:33:557] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:33:698] Spell_C::CastSpell(3044, 0, 0xF33007EF000615F5, 0) [2]
      [18:48:33:714] -Arcane Shot
      [18:48:33:891] Plugin Chest Looter threw an exception in 'Pulse'! Exception:
      [18:48:33:891] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:34:037] Plugin Chest Looter threw an exception in 'Pulse'! Exception:
      [18:48:34:037] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:34:189] Plugin Chest Looter threw an exception in 'Pulse'! Exception:
      [18:48:34:190] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:34:347] Plugin Chest Looter threw an exception in 'Pulse'! Exception:
      [18:48:34:347] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:34:494] Plugin Chest Looter threw an exception in 'Pulse'! Exception:
      [18:48:34:494] System.NullReferenceException: Object reference not set to an instance of an object.
         at ChestLooter.ChestLooter.Pulse() in c:\Users\aman\Desktop\hb test\Plugins\ChestLooter.cs:line 59
         at Styx.Plugins.PluginWrapper.Pulse()
      [18:48:35:838] Stopping the bot!
      [18:48:35:839] Stop called!
       

      Attached Files:

    4. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      Should work fine with the latest update. I made a new version some weeks ago but didn't bother posting it because I had no feedback on this one. Try this:
       
      Last edited: Mar 5, 2012
    5. xergz

      xergz Member

      Joined:
      Apr 16, 2010
      Messages:
      309
      Likes Received:
      1
      Trophy Points:
      18
      thanks for the fix.not throwing an error,which is good.Will watch it and as soon as it spots a chest,will update
       
    6. hbaioni

      hbaioni New Member

      Joined:
      Oct 17, 2011
      Messages:
      299
      Likes Received:
      1
      Trophy Points:
      0
      Is it possible to make it work like GB? I mean, the bot flying by certain zones and just loot the treasures as if they were ores or herbs? What would it take to do that?
       
    7. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      It's not really designed as a chest farmer, it's intended more to fix the 'Loot Chests' option in GB. When you're levelling a toon this will loot the chests in the area, but not specifically go hunting for chests.
       
    8. cotrik2001

      cotrik2001 New Member

      Joined:
      Jun 25, 2011
      Messages:
      28
      Likes Received:
      0
      Trophy Points:
      0
      Seems nice, haven't had the chance to see it in action however. I may try to "test" it if i happen on a chest sometime! Thanks for your effort.
       
    9. LiquidAtoR

      LiquidAtoR Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      1,430
      Likes Received:
      52
      Trophy Points:
      48
      Just skimmed quickly over your plugin (I had done this for myself for some time already)...
      Do you take into account any flying before you dismount ^^
      Otherwise when ur flying around and it finds a chest you might fall to your death (one of my own mistakes, haha).
       
    10. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      I thought you looked at the code? :p

      Yes it takes this into account.;

      Code:
      if (nearestChest != null && nearestChest.Distance <= 3 && count <= maxAttempts) { // If we're close enough to loot, and we haven't exceeded maxAttempts:
                              WoWMovement.MoveStop();
                              if (Me.Mounted) { Mount.Dismount(); Thread.Sleep(250); } // If mounted, dismount (for safety)
      ......
      }
      
       
    11. cotrik2001

      cotrik2001 New Member

      Joined:
      Jun 25, 2011
      Messages:
      28
      Likes Received:
      0
      Trophy Points:
      0
      Hi, I noticed an error or issue of sorts. This attempted to loot some sortof chests that exist in the stormwind mage tower. I forget the name, but my bot was going there to train at the time. And it kept trying to loot 4 or 5 chests there. The chests weren't actually lootable though... They were like fake nonloot chests you see here and there in the world. Would like some way to blacklist chests.
       
    12. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      It automatically blacklists after 4-5 loot attempts. If you give me the name of the chests I'll come up with a global blacklist solution.
       
    13. tozededao

      tozededao Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      1,225
      Likes Received:
      5
      Trophy Points:
      38
    14. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      This already works perfectly....
       
    15. tozededao

      tozededao Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      1,225
      Likes Received:
      5
      Trophy Points:
      38
      Not saying it doesn't, I didn't even tried, I gave you the link because you asked for the names/ids of it and you will find them on that thread.
       
    16. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      I asked for the names of chests to blacklist. I don't need names of chests to loot.
       
    17. tozededao

      tozededao Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      1,225
      Likes Received:
      5
      Trophy Points:
      38
      I think there are more chest to blacklist than the ones to pickup so it might be better to choose the ones to pick ;)
       
    18. echelon17

      echelon17 New Member

      Joined:
      Jan 6, 2011
      Messages:
      176
      Likes Received:
      8
      Trophy Points:
      0
      You think wrong.
       
    19. OdinsV

      OdinsV New Member

      Joined:
      Apr 1, 2010
      Messages:
      14
      Likes Received:
      0
      Trophy Points:
      1
      I keep getting the following:

      [ChestLooter] Found Dark Iron Treasure Chest with GUID 17371274968482089225 at <0, 0, 0> moving to it.

      This ends up causing me to start running away from my current zone and into other zones endlessly.

      Other than that, it works as intended.

      EDIT: Using version 3.1.0
       
      Last edited: Mar 23, 2012
    20. wearloga

      wearloga New Member

      Joined:
      Mar 16, 2012
      Messages:
      59
      Likes Received:
      0
      Trophy Points:
      0
      I got something like that too, standing in Northern STV:

      [ChestLooter] Found Sturdy Treasure Chest with GUID 17371274908352549428 at <0, 0, 0> moving to it.

      at the same time:

      [9:08:31:672] Activity: Loading Tile/s
      [9:08:32:532] Flight time: 00:25:33
      [9:08:32:532] Run Time: 01:15:13
      [9:08:32:532] Difference: 2980
      [9:08:32:533] Changed POI to:Type: Fly, R: Use, Aerie Peak, The Hinterlands

      Instead of taking the flightpath it started running. and being a level 31 character I died in Burning Steppes.
      Maybe there is an error in the code that makes me take a flight path? I was standing next to a Flight Master when I started the bot.

      I'm also on 3.1.0
       

    Share This Page