What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin] Giles Auto Equipper (Community Version)

StrangerThanFiction

New Member
Joined
Nov 24, 2012
Messages
241
Reaction score
3
Auto Equipper by GilesSmith
Contributors: GilesSmith, Stranger, rrrix, Ratosh
(v1.8.0.4 (Beta) released: 25th February, 2013)


Copied from the original thread, updated to reflect current changes.
Original Thread: http://www.thebuddyforum.com/demonbuddy-forum/plugins/59415-plugin-giles-auto-equipper.html


1: Overview:
Giles Auto Equipper is a plugin to help leveling up of new characters in DemonBuddy, particularly lower-level characters, by automatically equipping any items DemonBuddy loots that would be an upgrade.

Be sure to edit your loot rules to let DemonBuddy pick all items of level 1+ up - it's no good having loot rules that only pick up level 60+ yellow items and then using this plugin on a brand new character! :D

This plugin will look at new items it detects in your backpack and decide whether to equip them or not, buy potions while vending items if needed. It does nothing else - it does not interfere with looting, stashing, selling, salvaging, handling full backpacks, or anything else.


2: Features:
- Safety feature prevents plugin doing anything if it detects your character level is already 60 (to help prevent any "accidents" on a fully geared character), unless you set the config option to work on 60's (off by default).
- Config window to make plugin ignore armor, jewelry, weapons, or helmets, incase you have your own equipment you want to force-use.
- Checks all your items and backpack when DB first starts and equips whatever it thinks is "best in slot".
- Continues to monitor all items DB picks up to look for any possible upgrades.
- Tries to identify unidentified items on pickup, if you aren't in combat, to upgrade as soon as possible.
- Handles all character classes automatically and focuses on appropriate item types and primary stats.
- Handles rings in both slots without issue.
- Easy to alter item weightings by editing the .cs file if you don't like how Auto Equipper judges items.
- Focuses only on 1-handed weapons with an off-hander (shield/mojo/source/quiver) - except for DH's which focus on 2-handed ranged weapons with a quiver.
- Buys potions from Vendor if you need them. (NOTE: This will not make any special trips to town. It will only fill up on potions when selling off junk on a TownRun)


3: Config Window:
tTEBS.png

The config window allows you to disable the equipper from trying to upgrade specific item slots (eg if you have a helmet with a huge +exp gem in it you want to keep). You can also enable the equipper for level 60 toons - be careful that you don't have any unprotected uber items in your backpack first if you do this!


4: Installation:
1: Download the attached zip (bottom of post).
2: Extract to your Demonbuddy directory (eg "C:/Demonbuddy/Plugins/")
3: The GilesEquipper files should now be in their own folder in your plugins folder (eg "C:/Demonbuddy/Plugins/GilesEquipper/GilesEquipper.cs")
4: Start Demonbuddy, select the plugins tab, and click the check mark next to Giles Equipper to enable.
5: You can click the "Config" button after selecting the plugin in the plugin list to lock specific item-types/slots from ever being evaluated.
6: Once you start your bot, equipper will do its thing!


5: Loot Rules:
You need loot rules that will pickup pretty much everything, so that my plugin can get a chance to evaluate them and use them. I recommend using GilesTrinity, it will make your life much easier.


6: Notes & Version History:
I have never programmed before I used DemonBuddy. DemonBuddy is my first adventure into anything more complicated than Excel spreadsheet. Criticism is welcomed but please keep it constructive, and remember I am not a DB developer nor am I being paid - I am a fellow DB user just like you!
Code:
---------------------------
  Version 1.8.0.4 (Beta)
---------------------------
  - Added potion configuration to config window
  - Item Identification will no longer causing DCs, Fix by rrrix
  - Spam prevention added for BotMain.PauseWhile calls
  - Now uses static potion cache, DB was returnin the wrong information
  - Will once again check stash for upgrades on TownRuns when enabled.
---------------------------
  Version 1.8.0.3 (Beta)
---------------------------
  - Fixed typo's in BotMain.PauseWhile calls...
  - Fixed InventorySlot Protection
  - More improvements to the CheckPotion method
  - Fixed Config default values and bugs in Config Window
  - Cleaned up the Config Window
  - Once again opens the Inventory Window prior to swapping gear
  - Many other miscellanous things....
---------------------------
  Version 1.8.0.0 (Alpha)
---------------------------
  - The CheckMerchant method has been removed in favor of CheckStash
  - CheckStash is currently in Alpha use at your own risk (Doesn't protect gear yet)
  - Overhauled the CheckPotion method, and dusted it with Raid
  - CheckPotion method will only fire once every 2 minutes when visiting a vendor.
  - Integrated Ratosh's DPS/EHP item valuations
  - Updated ConfigWindow to reflect changes
---------------------------
  Version 1.7.5.3 (Beta)
---------------------------
  - pulse fix by rrrix
---------------------------
  Version 1.7.5.2 (Beta)
---------------------------
  - Improved the BuyPotion Logic, Will now buy potions irregardless of level if they can heal for greater than 25% HP and you do not have anything stronger in your backpack.
  - Improved the BuyPotion exception catching, and error checks
  - Imrpoved the CheckMerchant/CheckBackpack exception catching and error checks.
  - Imrpoved the CheckMerchant w/ VendorChecks Buy/Equip logic. Shouldn't buy then sell equipment anymore.
---------------------------
  Version 1.7.5.1 (Beta)
---------------------------
  - Refactored the BuyPotion logic, (Can now disable CheckMerchant and still have BuyPotions enabled [Only 1 Checkbox needed for Potions only now O_o])
  - Combined the CheckMerchant and CheckBackpack routines, Will make things easier to maintain...
---------------------------
  Version 1.7.5.0 (Beta)
---------------------------
  - Fixed a typo in additional checks which stopped the Equipper from actually makeing a purchase from the merchants
---------------------------
  Version 1.7.4.9 (Beta)
---------------------------
  - Added additional checks to ensure items being equipped are not marked to be ignored. Was able to force this to occur under rare circumstances.
---------------------------
  Version 1.7.4.8 (Beta)
---------------------------
  - Bug fix: The buy potion method would become stuck in an endless loop due to excess Thread.Sleep calls
             Apparently using Thread.Sleep inside a PauseWhile call on a While loop is a bad idea... Who woulda thought O_o
  - Further imrpovements made to BuyPotion logic, now guarantee's to only buy the Strongest Potion available from Merchant
  - Code refactoring into more logical peices
---------------------------
  Version 1.7.4.7 (Beta)
---------------------------
  - Bug Fix: Wasn't saving Weapon and Bracers ignore preferences
---------------------------
  Version 1.7.4.6 (Beta)
---------------------------
  - Script will now fill up on the strongest available potion on a TownRun, if the vendor has the goods
    - Max Item Stacks for Potion Types:
        - Minor : 10
        - Lesser : 15
        - Health : 25
        - Greater : 35
        - Heroic : 50
        - Resplendent : 50
        - Mythic : 99
    - Will not purchase potions if gold is less than 1,000
  - Fixed: CheckMerchant would endlessly pause bot with no light at the end of the tunnel
---------------------------
  Version 1.7.4.5 (Beta)
---------------------------
  - Bug fix: Should no longer close Inventory window while interacting with a vendor.
  - Bug fix: DB freeze when multiple CheckMerchants fired on the same vendor.
  - CheckMerchant now works, default adjusted to enabled.
  - Identifing items now works properly thanks to rrrix, default adjusted to enabled.
---------------------------
  Version 1.7.4.4 (Beta)
---------------------------
  - Implemented rrrix's identification fix.
---------------------------
  Version 1.7.4.3 (Beta)
---------------------------
  - Moved Item Identification to a configurable option. (Still Experimental IMO, Needs more testing)
---------------------------
  Version 1.7.4.2 (Beta)
---------------------------
  - Now opens the Inventory Window prior to equipping/identifying items
  - Fixed item identifcation
  - Fixed CheckMerchant Function, now pauses the bot while Vendoring to check for upgrades (Still Experimental IMO, Needs more testing)
---------------------------
  Version 1.7.4.1 (Stable)
---------------------------
  - Added CheckMerchant back in as a configurable option. (Disabled by Default)
  - Reworked the GilesEquipper.xaml file to be more dynamic
---------------------------
  Version 1.7.4 (Stable)
---------------------------
  - Included changed made by rrrix to stop buying/selling of equipment at vendors.
  - Made a few improvements to the code to streamline some if/return statements.
  - Moved GilesEquipper.cfg from \Settings\GilesEquipper.cfg to \Settings\[BATTLETAG]\GilesEquipper.cfg
---------------------------
  Version 1.7.3 (Stable)
---------------------------
  - Changed Slot Ignore Code from Grouped Slots to Indivdualized Slots and updated the XAML UI.
  - Inlcluded item identification fixes by rrrix


7: Download:
GIT: http://www.assembla.com/code/autoequipper/git/nodes

Latest Stable Release: v 1.7.4.1, You should always run the latest Stable release unless you don't mind a few bugs or hicups. (See changelog for details)

Latest Test Release: v 1.8.0.4 BETA, This is a pre-release version and will have minor bugs and problems. If you encounter any errors or problems please report it here and attach your log file.

Latest Dev Copy: Latest-AutoEquipper.zip
 

Attachments

Last edited:
Known Issues:
- Latest DB not reading merchant items properly i.e. The RequiredLevel property is being read as 0 for all items... This is causing bot to buy potions that are not yet usable...

Current Todo:
- Re-stash gear borrowed from the stash when no longer needed.
- Always stash gear used for equips after level 60 when being upgraded.
 
Last edited:
Doing what I can with what little time I have.... Still got a ways to go before I am happy with it...

Once all is said and done might just go ahead and create a fork on trinity and merge it in... But maybe not that plugin is already such a beast...

Would allow things like when "Set Questing" is enabled under items would override which town vendors are used automatically... Different things like that.. Unless there is a way to drive Trinity from outside of Trinity.. Still very new to DB/C# programming..

Used to Python >_<

Also been looking at Ratosh's equipper and might merge in his item evaluation code... Creating a local test version now.. But from what I seen in the code it should work much better than the built in item evaluation...


Lol also just noticed while searching the forums that you were working on a BuyPotions script a few months ago :D lol had no idea... Would of messaged you with a few questions had I known that... But all is working smoothly now :D

Learned the hardway not to place a Thread.Sleep command inside a While loop even with a randomized 200-800MS sleep time....... Just causes all kinds of weird problems....
 
Last edited:
Tried to use Ratosh's but failed to initialize in DB and held YAR hostage and would constantly reload DB. Does this also take into consideration values of Gems in slots when calculating an items worth? Not sure how hard it would be to code gem swapping. Not sure if DB even had the ability to do it to be honest. Would also love to see the ability to stash items used to lvl so that you can prep your next bot for lvling. This would speed up the process a ton and yes I know I am asking also, but would be a nice feature. Say keep all the items in the second tab.
 
Well his plugin has quite a few bugs in its current state... Looks like he started then abandoned it... However his item valuation functionality from my testing is working better...

As far as I know gems do and always have affected the item scoring.. However there is no way in DB currently to socket Gems in armor/jewelry.. At least not that I have found so assuming DB currently doesn't support it.

Currently working on a method for using stashed items... Have to build in several safety nets to ensure that stashed equipment is re-stashed when no longer needed and have it grab the next upgrades from the stash... Then its simple rinse and repeat...
 
Doing what I can with what little time I have.... Still got a ways to go before I am happy with it...

Once all is said and done might just go ahead and create a fork on trinity and merge it in... But maybe not that plugin is already such a beast...

Would allow things like when "Set Questing" is enabled under items would override which town vendors are used automatically... Different things like that.. Unless there is a way to drive Trinity from outside of Trinity.. Still very new to DB/C# programming..

Used to Python >_<

Also been looking at Ratosh's equipper and might merge in his item evaluation code... Creating a local test version now.. But from what I seen in the code it should work much better than the built in item evaluation...


Lol also just noticed while searching the forums that you were working on a BuyPotions script a few months ago :D lol had no idea... Would of messaged you with a few questions had I known that... But all is working smoothly now :D

Learned the hardway not to place a Thread.Sleep command inside a While loop even with a randomized 200-800MS sleep time....... Just causes all kinds of weird problems....


You can use reflection or read the values from trinity settings file
basic examples for reflection: Reflection Examples [C#]

code snippet from Yar plugin using reflection to get "LIVE" info from trinity plugin:
Code:
namespace YARPLUGIN
{
    public static class TrinitySupport
    {
        private static bool _failed;
        private static Type _gilesTrinityType;
        public static bool Initialized { get; private set; }

        public static void Initialize()
        {
            Initialized = true;
            YARPLUGIN.Log("Initialize Trinity Support");
            var asm = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.GetName().Name.ToLower().StartsWith("gilestrinity"));
            if (asm != null)
            {
                try
                {
                    _gilesTrinityType = asm.GetType("GilesTrinity.GilesTrinity");
                    _failed = false;
                    return;
                }
                catch (Exception ex)
                {
                    YARPLUGIN.Log("Failed to initialize Trinity Support:");
                    YARPLUGIN.LogException(ex);
                }
            }
            else
            {
                YARPLUGIN.Log("Trinity is not installed");
            }
            _failed = true;
        }

        public static bool IsEnabled
        {
            get
            {
                var plugin = PluginManager.Plugins.FirstOrDefault(p => p.Plugin.Name.Equals("GilesTrinity"));
                return (plugin != null && plugin.Enabled);
            }
        }

        private static bool bDontMoveMeIAmDoingShit
        {
            get
            {
                try
                {
                    return (bool)_gilesTrinityType.GetField("bDontMoveMeIAmDoingShit", BindingFlags.Static).GetValue(null);
                }
                catch (Exception ex)
                {
                    YARPLUGIN.Log("Failed to get Trinity info:");
                    YARPLUGIN.LogException(ex);
                    return false;
                }
            }
        }
        private static bool bMainBotPaused
        {
            get
            {
                try
                {
                    return (bool)_gilesTrinityType.GetField("bMainBotPaused", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
                }
                catch (Exception ex)
                {
                    YARPLUGIN.Log("Failed to get Trinity info:");
                    YARPLUGIN.LogException(ex);
                    return false;
                }
            }
        }
        public static bool IsPaused
        {
            get
            {
                if (!Initialized) Initialize();
                return !_failed && bMainBotPaused;
            }
        }
        public static bool IsBusy
        {
            get
            {
                if (!Initialized) Initialize();
                return !_failed && bDontMoveMeIAmDoingShit;
            }
        }
    }
}


Pm me if you need more info :)
 
Nice plugin! I noticed my bot doesn't seem to want to purchase potions (I'm using latest .9 beta)...I'm only up to "Health Potion" if that helps.

Also, possible bug with purchasing items from vendor for upgrade. I wasn't wearing boots, so it purchased new boots but never equipped them and ending up reselling them.

Overall though it is working well for the new toon!
 
Nice plugin! I noticed my bot doesn't seem to want to purchase potions (I'm using latest .9 beta)...I'm only up to "Health Potion" if that helps.

Also, possible bug with purchasing items from vendor for upgrade. I wasn't wearing boots, so it purchased new boots but never equipped them and ending up reselling them.

Overall though it is working well for the new toon!

Ya it didn't fire everytime, this has been fixed in the 1.7.5.1... Still have some other issues though
 
Last edited:
Ya it didn't fire everytime, this has been fixed in the 1.7.5.1... Still have some other issues though

:D Version 1.7.5.2 has resolved the other problems I was having... I listed it as beta as needs more extensive testing but all preliminary tests went extremely well. No more DB freezes and lockups..

All vendor runs purchased potions accordingly when enabled without error over 2 hours.

All vendor runs purchased items accordingly and equipped them when enabled without error over 2 hours.

Level 60 potions only testing went off without a hitch, purchased appropriate potions when needed on every vendor run resulting in less time at the vendor vs it only occurring every 3-4 runs....


Let me know if you find anything.. Otherwise will update the notes to reflect this as a Stable release in a few days....
 
Last edited:
:D Version 1.7.5.2 has resolved the other problems I was having... I listed it as beta as needs more extensive testing but all preliminary tests went extremely well. No more DB freezes and lockups..

All vendor runs purchased potions accordingly when enabled without error over 2 hours.

All vendor runs purchased items accordingly and equipped them when enabled without error over 2 hours.

Level 60 potions only testing went off without a hitch, purchased appropriate potions when needed on every vendor run resulting in less time at the vendor vs it only occurring every 3-4 runs....


Let me know if you find anything.. Otherwise will update the notes to reflect this as a Stable release in a few days....

Excellent! Can't wait to try it this evening. Thanks for the updates!
 
Couple things I noticed , when I used this last week .
When iding items and not in combat , the toon doesn't always open bag first.
Also I noticed on my monk it would prefer to wear strength items and. It dex items . Even if I had higher dex items in bag .
Aside from that works really well .
I used it all the way to 60 with only minor bugs and 1 or 2 ah shops .
 
Hm, seems to be having major conflicts with BuddyStats enabled; random errors and constant freezing on town runs (either sells 1/3 of items and after that freezes, you try to stop it DB melts and you have to kill it manually from task manager as well end session from Buddy Auth Portal).

After disabling BuddyStats it works flawlessly again.
 
Hm, seems to be having major conflicts with BuddyStats enabled; random errors and constant freezing on town runs (either sells 1/3 of items and after that freezes, you try to stop it DB melts and you have to kill it manually from task manager as well end session from Buddy Auth Portal).

After disabling BuddyStats it works flawlessly again.

Thats weird... All my bots have buddystats enabled and I have been using them in together just fine... The DB melting was occurring do to exceptions when either a special condition existed or a memory read error occurred.....

What version are you running?

Also I noticed you said "again" meaning it was working, then you installed BuddyStats and it went bonkers or you updated and it seemed to have issues with an already installed BuddyStats?



Couple things I noticed , when I used this last week .
When iding items and not in combat , the toon doesn't always open bag first.
Also I noticed on my monk it would prefer to wear strength items and. It dex items . Even if I had higher dex items in bag .
Aside from that works really well .
I used it all the way to 60 with only minor bugs and 1 or 2 ah shops .

What version were you running? Ya, I am trying to get everything else working 100% or as near to it as possible before changing out the item valuation formula.... Shouldn't be too much longer...
 
Last edited:
Thats weird... All my bots have buddystats enabled and I have been using them in together just fine... The DB melting was occurring do to exceptions when either a special condition existed or a memory read error occurred.....

What version are you running?

Also I noticed you said "again" meaning it was working, then you installed BuddyStats and it went bonkers or you updated and it seemed to have issues with an already installed BuddyStats?
I'm running GilesEquipper_v1.7.5.2 and latest beta build of DB.

And yeah, I ran GE before installing BuddyStats. GE functioned normally until that, so when I disabled BuddyStats it returned to function as intended.

Still fairly fresh with all this.
My D3 just froze for first time today and I'm still trying to figure out best way to level up a toon and whatnot.

Had to mess around with several leveling profiles and most of them were outdated or too glitchy to play with.
I'm now running Full Questing - All Acts - Complete - Tested with included and recommended plugins and Identified as well Unstucker.

I hope inferno profiles are kept well shaped and in working condition, as it very much seems like by poking around these forums.

EDIT: Not too sure at what's wrong or what I'm doing wrong.
Been babysitting bot for most of the day and each time I use portal to get in town and sell stuff, occasionally bot stops working.
Just says "Bot paused" and won't sell one final blue item from inventory.

I then tried to stop it. All good.
Then start it again. DB froze.

Any clues what am I doing wrong here?
Slightly irritating.
 
Last edited:
I'll double check when I get home tonight for you , but I think it was 5.1
This isn't a new thing I noticed it with giles version as well .
Not an issue for me at the moment but thought I would point it out for people using it now .
It's a great plugin and does save us lots of time lvling .
 
Thanks for the feedback..

@Lita, Very odd can you upload a log file when this occurs? Have tried several variations and can not re-produce this....

@chimeraxp, I have never had trouble with it opening prior to identification... If you are watching the bot when this occurs can you check your latency, this could possibly be occurring due to lag as the code will not allow it to continue if an open inventory window is not detected

@Magi, thanks for the log I think I found the problem... Will release a smaller update for this soon...
 
Back
Top