• Visit Rebornbuddy
  • Item Rules QuickStart Guide

    Discussion in 'Demonbuddy Guides' started by Apoc, Jun 11, 2012.

    1. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Demonbuddy supports a very complex (or very simple, depending on your views) item rule system. The item rules determine everything for picking up, stashing, selling, and salvaging items. It fully supports "by name", specific item stats, stack quantities, etc, of items in the game.

      The following is the default rule set shipped with Demonbuddy (you can find it in the Rules folder of your Demonbuddy install):

      HTML:
      <?xml version="1.0" encoding="utf-8" ?>
      
      <ItemRules name="Default Item Rules" useRoundedValues="true">
        <!-- The order in which item rules are evaluated. Typically, this is fine for almost all rule sets. 
        However, you may want to switch things around sometimes if you want to force-sell things that may match keep rules. -->
        <Priority priority1="Keep" priority2="Salvage" priority3="Sell" />
      
        <Categories>
          <Category ruleType="PickUp">
            
            <!-- Pick up all magic+ items -->
            <ItemRule>
              <StatRules>
                <Rule quality="Magic1" />
              </StatRules>
            </ItemRule>
      
            <!-- Pick up gold, at least in stacks of 100 -->
            <ItemRule itemName="Gold">
      		<StatRules>
      		  <Rule stacks="100" />
      		</StatRules>
      	  </ItemRule>
            
            <!-- Pick up all pages and tomes, blacksmithing/jewelcrafting -->
            <ItemRule itemName="Page of*" />
            <ItemRule itemName="Tome of*" />
            
            <!-- Gems -->
            <ItemRule itemName="*Ruby*" />
            <ItemRule itemName="*Emerald*" />
            <ItemRule itemName="*Topaz*" />
            <ItemRule itemName="*Amethyst*" />
      
            <!-- Health potions -->
            <ItemRule itemName="*Health Potion*" />
          </Category>
      
          <Category ruleType="Keep">
            
            <ItemRule itemBaseType="Weapon" twoHanded="true" description="High DPS 2h Weapons">
              <StatRules>
                <!-- Magic Weapons should have at least 1200 DPS -->
                <Rule stat="DPS" minValue="1100" quality="Magic1" />
              </StatRules>
            </ItemRule>
      
            <ItemRule itemBaseType="Weapon" oneHanded="true" description="High DPS 1h Weapons">
              <StatRules>
                <Rule stat="DPS" minValue="900" quality="Magic1" />
              </StatRules>
            </ItemRule>
      
            <ItemRule itemBaseType="Armor" description="Rare armor with Intelligence">
              <StatRules>
                <Rule stat="Intelligence" minValue="100" quality="Rare4" />
              </StatRules>
            </ItemRule>
            
            <ItemRule itemBaseType="Jewelry" description="Rare jewelry with Intelligence">
              <StatRules>
                <Rule stat="Intelligence" minValue="100" quality="Rare4" />
              </StatRules>
            </ItemRule>
      
            <ItemRule itemName="String of Ears" description="High DR% String of Ears">
              <StatRules>
                <!-- String of Ears should have at least 17% damage reduction. Any lower and its not worth a whole lot.-->
                <Rule stat="DamageReductionPhysicalPercent" minValue="17" />
              </StatRules>
            </ItemRule>
      
            <ItemRule itemName="Talisman of Aranoch" description="Talisman of Awesome Lowbieness" />
      
            <!-- Keep rares and legendaries, regardless of stats. -->
            <ItemRule ruleType="Keep" description="Rare and better items!">
              <StatRules>
                <Rule quality="Rare4" />
              </StatRules>
            </ItemRule>
            
          </Category>
      
          <Category ruleType="Sell">
            <ItemRule description="Sell Everything">
              <StatRules>
                <Rule quality="Magic1" />
              </StatRules>
            </ItemRule>
          </Category>
          
        </Categories>
      </ItemRules>
      I'll try to explain each tag as simply as possible to convey the meaning, and ability of each tag.

      First and foremost, the root tag (ItemRules) supports 2 attributes, name and useRoundedValues. The first attribute (name) is just a description value for whatever you'd like to call the rules. The second attribute (useRoundedValues) is to instruct Demonbuddy to round any values it encounters while pulling item stats (similar to how D3 displays it's item stats. 17.7% gets rounded to 18%, etc)

      The next tag you'll encounter is the Priority tag. This only takes 3 attributes, priority1, priority2, and priority3. These instruct Demonbuddy to evaluate a certain category of rules in a specific order. This tag is required, and must not be left out.

      The only other tag supported within the root tag (ItemRules) itself, is a Categories tag, which will contain a set of Category tags. These determine the "type" of rules defined within them.

      Category has one attribute ruleType which may have one of four values. PickUp, Sell, Keep, and Salvage. Within the Category tag, you can define item rules for the type you specified in the attribute. This is where Demonbuddy looks for basically all things item related. If a rule matches (or doesn't) a specific action will occur.

      Now on to the actual rules!

      Within a Category tag, you can have any number of ItemRule tags, which will contain all the rules for a certain item (or multiple items). There are a few attributes, and child tags supported in the ItemRule tag which will help you decide what to do with an item.

      I'll give a brief overview of the ItemRule tag, as its mostly self explanatory.

      Attributes
      • itemName - This can either be a partial name (such as "*Ruby" to match all types of Ruby gems, or a complete name to match a specific item by name [note: Names are not localized! You will need to ensure they're in the correct language for your client!] - This attribute is optional.
      • stack - A minimum stack amount for an item. (Useful for Gold, stacks of gems, etc) - This attribute is optional.
      • itemBaseType - If you want to specify a rule for a "type" of item, you'll find that using this is the easiest way. Valid values are Armor, Weapon, Jewelry, Misc (for tomes, potions, etc), and Gem. - This attribute is optional.
      • itemType - if you need fine-grained filtering of items, this is the attribute to use. Valid values are as follows:
        • Axe
        • Sword
        • Mace
        • Dagger
        • Bow
        • Crossbow
        • Staff
        • Spear
        • Shield
        • Gloves
        • Boots
        • Chest
        • Ring
        • Amulet
        • Quiver
        • Shoulder
        • Legs
        • FistWeapon
        • Mojo
        • CeremonialDagger
        • WizardHat
        • Helm
        • Belt
        • Bracer
        • Orb
      • twoHanded - Only useful for Weapons, this will let you distinguish a 1h weapon rule, from a 2h weapon rule. - This attribute is optional
      • description - Use this to have Demonbuddy display this when it selects it as a rule match. If this isn't defined, it will display a default message. - This attribute is optional

      Within each ItemRule tag, there is a child tag named StatRules which is a container for Stat tags. The Stat tag is where you define stat-specific rules (if any). The following is a list of attributes available in this tag. (Note, you can have as many Stat rules in an ItemRule as you want!)

      Attributes
      • quality - This determines the quality (as a greater than or equal) value of an item. There are quite a few values, but the ones you'll likely be using are as follows: Inferior, Normal, Superior, Magic1, Rare4, Legendary. - This is optional
      • minValue - The minimum value of a "stat" defined. This is to ensure items have above (or equal) a value of a stat. - This is optional
      • maxValue - The same as above, but the "max" value. - This is optional.
      • value - Use this if you want a specific value on an item. (Such as a 20% DR String of Ears, or 25% IAS weapon). You may also just use minValue to achieve the same effect. - This is optional
      • stat - This is what determines what to look for (assuming quality is not defined) in a stat. There are many, many values you can use. The following is a list of currently available stats that may be looked at on any item (identified item).
        • Intelligence
        • Strength
        • Vitality
        • Dexterity
        • Armor - this is the "base" armor of an item.
        • ArmorBonus - this is the "bonus" armor on the item. Represented in the tooltip as "+x Armor"
        • ArmorTotal - this is the "total" armor for the item.
        • FireDamagePercent
        • ColdDamagePercent
        • LightningDamagePercent
        • PoisonDamagePercent
        • ArcaneDamagePercent
        • HolyDamagePercent
        • MinDamage - this is the smaller of the 2 when the tooltip states "+5-10 damage" or similar.
        • MaxDamage - the max value of the above
        • DPS - weapon DPS. This is the DPS as shown in the tooltip.
        • GoldFind
        • MagicFind
        • AttackSpeedPercent
        • WeaponAttacksPerSecond
        • WeaponMinDamage
        • WeaponMaxDamage
        • MovementSpeed - run speed %
        • HealthGlobeBonus
        • HealthPerSecond
        • LifePercent
        • Level - item level. DOES NOT MATCH IN-GAME ITEM LEVEL REQUIREMENT!
        • ResistAll
        • ResistArcane
        • ResistCold
        • ResistPhysical
        • ResistLightning
        • ResistFire
        • ResistPoison
        • ResistHoly
        • Thorns
        • DamageReductionPhysicalPercent
        • Sockets - this is how many sockets an item has
        • CritPercent
        • CritDamagePercent

      As you can see, you can make very complex, or very simple sets of rules. If you have any questions, please feel free to ask!
       
      Last edited: Jul 24, 2012
    2. axazol

      axazol New Member

      Joined:
      Jun 27, 2010
      Messages:
      308
      Likes Received:
      8
      Trophy Points:
      0
      What about socket stat ?
       
    3. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Something I forgot! I'll be adding this for the next release. Thanks for reminding me!

      ... how the hell did I forget that?
       
    4. busterbubble

      busterbubble New Member

      Joined:
      Jan 14, 2012
      Messages:
      40
      Likes Received:
      0
      Trophy Points:
      0
      Apoc it means your still human and not a machine :)
       
    5. Lipie

      Lipie Member

      Joined:
      Nov 18, 2010
      Messages:
      402
      Likes Received:
      3
      Trophy Points:
      18
      Thank god for this guide ,was breaking my head on that rule file.
       
    6. Inrego

      Inrego New Member Buddy Store Developer

      Joined:
      Feb 7, 2010
      Messages:
      2,765
      Likes Received:
      71
      Trophy Points:
      0
      Was my reply removed, or did I forget to post?

      Anyway - I wanted to ask if there's a profile creation guide coming aswell soon? There are some things in the provided profiles that I cannot figure out.
       
      Last edited: Jun 11, 2012
    7. seisdeos

      seisdeos New Member

      Joined:
      May 30, 2011
      Messages:
      63
      Likes Received:
      0
      Trophy Points:
      0
      You can set it to NOT pick up rares?
       
    8. Geertwilbert

      Geertwilbert New Member

      Joined:
      Jun 11, 2012
      Messages:
      36
      Likes Received:
      0
      Trophy Points:
      0
      My problem is it picks up all rares and keeps them all unidentified in stash.

      Several questions:
      - How do I change it so it sells rares instead of stashing? I can't by deleting the whole "keep all rares" rule, it still stashes all rares. I would disable picking up rares altogether, but the basic pick up rule is to pick up magic or better and there doesn't seem to be a way to pick up ONLY magic. Which brings me to my second question:
      - By default the rules seem to count for example quality=Magic as Magic or higher. But how can you take only one quality and make a rule for it, like for example only magics, or only rares?
      - How do I let it identify stuff, because I haven't seen the bot identify anything yet, and you can't vendor unidentified items.

      Thanks
       
    9. achikez

      achikez New Member

      Joined:
      May 10, 2012
      Messages:
      17
      Likes Received:
      0
      Trophy Points:
      1
      any insight on changing keep all from rare4 to set/legenday? As I'm running nightmare those are the only two remotely worth keeping.
      Also thanks for the guide, had most of it figured out but the info on priority and rounding is good stuff.
       
    10. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      1) This is one of those cases where you'd want to change the Priority to Sell before Keep. (Have a rule to sell Rare4)
      2) Due to some game mechanics, this isn't viable. (There's 3 versions of "Magic", 3 for rare as well) This is why we included the "Priority" stuff. (Yes, its weird, but it allows a lot more flexibility.)
      3) ID'ing isn't built in just yet. (We'll probably do this via a plugin just to show an example) The API to do so is there though!
       
    11. Geertwilbert

      Geertwilbert New Member

      Joined:
      Jun 11, 2012
      Messages:
      36
      Likes Received:
      0
      Trophy Points:
      0
      I can change priorities but if IDing is not possible, it's also impossible to sell rares, because the game doesn't allow you to sell unidentified rares at a vendor. So this would mean that to disable stashing rares I would have to get the bot to stop picking up rares. But the only way to stop picking up rares is by disabling picking up magic or higher items, if I understand correctly? That would suck because then it doesn't pick up any magics anymore to vendor for gold :/
       
    12. axazol

      axazol New Member

      Joined:
      Jun 27, 2010
      Messages:
      308
      Likes Received:
      8
      Trophy Points:
      0
      Apoc, last few stats:
      -CritDmg
      -CritChance

      ;)
       
    13. IeU

      IeU Member

      Joined:
      Jul 20, 2010
      Messages:
      831
      Likes Received:
      11
      Trophy Points:
      18
      Why is it labelled "Magic 1"? (Same question for "Rare 4")

      Are there any other magic ranks?
       
    14. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Added in the next release. (CritPercent and CritDamagePercent)

      There are 3 levels of magic items, and 3 levels of rare items. (I posted about this on the previous page)
       
    15. shuuk

      shuuk Member

      Joined:
      Apr 25, 2010
      Messages:
      736
      Likes Received:
      0
      Trophy Points:
      16
      Maybe its a better idea to put these in settings not in a profile.
      i know how to do this but a noob got a lot of problems..

      make it easy like..pick up blue, yellow, legendary
      sell blue, yellow, legendary
      ppl. need to make a click in the settings what they want...

      it is more noob friendly..now its more for advanced users
       
    16. nupogodi

      nupogodi New Member

      Joined:
      Jun 11, 2012
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      0
      Regarding IDing: Apoc, I'm a professional software developer and I'd like to write a plugin to identify (among other things, heh). I implemented a stubbed-out version of your IPlugin, compiled and put it the DLL in the Plugins folder. Yet DB says 0 plugins found, doesn't seem to be trying. Even some bare-bones docs would be nice, so I could start exploring the API.

      Another question - will it be possible to implement an IBot or subclass BotMain, i.e. to build up our own BTs in code and use our own combat behaviours without using XML profiles?
       
      Last edited: Jun 11, 2012
    17. RookieDookie

      RookieDookie New Member

      Joined:
      Jun 7, 2012
      Messages:
      22
      Likes Received:
      0
      Trophy Points:
      0
      I can't seem to get the bot to stop picking up blues and yellows. I only want it to pick up legendaries.
       
    18. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      This thread is for discussion on the guide, and item rules in general. Please stop filling it with posts completely unrelated.
       
    19. RookieDookie

      RookieDookie New Member

      Joined:
      Jun 7, 2012
      Messages:
      22
      Likes Received:
      0
      Trophy Points:
      0
      I tried following what the guide said about setting.

      I still can't get it to stop picking up blues or yellows.
       
    20. nawdik

      nawdik New Member

      Joined:
      Feb 27, 2012
      Messages:
      153
      Likes Received:
      0
      Trophy Points:
      0
      Same here
       

    Share This Page