Hello there!
So if you haven't already seen this plugin, it is a MUST for gearing your bots AS they bot. It's a plugin made by rrrix, and all praise should be given to him for making such a straight forward plugin.
Q: What does it do?
A: This plugin will automatically equip a looted item based on the % stats given by the in-game menu when inspecting an item. In other words, if it is an "upgrade" based on loot rules you set then it will replace any item you're currently wearing with this one.
Q: Can I trust this to NOT get rid of items I actually want to keep?
A: This depends 100% on your understanding of C#, of which I'm making this thread to help you out with!
Q: Where can I get said Plugin?
A: Go back out one (Forum->Demonbuddy Forum -> Plugins) and you should see a thread near the top? Otherwise, if you're lazy: Boop
To the meat:
What we're interested in here is a small section of code that tells the bot what YOU consider to be an "upgrade". This section of code is found inside ItemEvaluator.cs inside your Armorery plugin folder. I recommend using NotePad++ (google it) for editing purposes. Make sure that NotePad++ is set to "C#" under language options at the top on your toolbar.
The code block we're looking for starts on line 161, or simply search for "0.05" and you'll find the CalculateUpgrade() boolean method. (This means anything calling this method is expecting a true/false return statement).
So what does all this jibberish mean? Let me lay it out for ya!
Default: Concentrates more on toughness over damage, and has a lower limit threshold of -15% damage for an upperlimit of 15% toughness.
Ok, so what does any of that mean? It means that if you look an item with -9.3% damage the bot will ONLY consider it an upgrade IF the Toughness you get out of the item is greater than +9.3%.
Math:
if (damage > -0.15 && damage + toughness > 0 && healing > 0)
This is saying that so long as the damage is GREATER than -15%, then as long as the toughness + damage is GREATER than 0 do we consider this an upgrade. The healing > 0 is only for the second fall-through if statement to ensure you aren't completing gimping yourself in surviveability as a whole just for some damage.
This is where the FIRST "If" statement comes in:
This is the statement that checks to see if the damage is GREATER than -5% so long as the Toughness you gain is GREATER than 5 so when you add them together you get > 0.
Ok, that all sounds....interesting....can you give me some examples?
Sure
!
Let's say a sword drops that is -4.3% damage, but has +5.6% toughness and -1.6% healing. We see that the damage is GREATER than -5%, so the FIRST "if" statement will be checked first. We then ADD damage + toughness together and we get +1.3% difference. This means this sword is an UPGRADE and it will be swapped out with your current weapon. "Healing" is not taken into consideration here because it fit the first conditional statement.
Another example, is that a helmet drops with -4.9% damage, but only gives +1.9% toughness. Since the difference here is -3% it is NOT greater than 0 (dmg + tough) so we do NOT consider this an upgrade. Additionally, since the FIRST conditional failed the SECOND statement is then used. Albeit since they're not in an "else if" configuration both statements are always checked, but most likely if the first is true, then we really don't care about the second one.
Ok, so what happens to this helmet with the second statement? Well, again it doesn't matter because in the second statement we're still checking to see that dmg+tough > 0, so this will also fail. Thus, said helmet is NOT an upgrade and normal trinity salvage/sell rules are applied when your bot does a townrun.
OK COOL, I GOT IT, CAN YOU JUST HELP ME WITH SOME EXAMPLE TEMPLATES?
Coo, coo, calm down little buddy! I got you, we can't all be programmers
!
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
Default: Concentrates on toughness over damage for survivability. Good for early game gearing of a new bot, but bad for mid/late game farming and/or leveling.
--------------------------------------------------------------------------------------------
Damage: Concentrates on damage over toughness. Essentially here we're just swapping damage for toughness in priority.
--------------------------------------------------------------------------------------------
The previous two above have one issue however. What if, for the damage oriented one, that the damage is NOT > 0.01? Well, say a sword drops that has +4.9% toughness but -4.9% damage? Or vise versa, with the toughness concentrated DEFAULT if, what happens if a -4.9% toughness sword drops with +6% damage? It will succeed as an upgrade as 6+(-4.9) == +1.1%. So if you want to force the bot to ONLY consider it an upgrade for damage OR toughness OR healing then you have to do the following:
--------------------------------------------------------------------------------------------
Forced: Damage Upgrade Focus, only consider something an upgrade for damage IF damage is GREATER than +1% to begin with.
--------------------------------------------------------------------------------------------
Forced: Toughness Upgrade Focus, only consider something an upgrade for Toughness IF Toughness is GREATER than +1% to begin with.
--------------------------------------------------------------------------------------------
Finally, perhaps you want only everything to be in the green to be considered an upgrade?
--------------------------------------------------------------------------------------------
Don't forget that you can also "tighten" these ranges to better fit a more specific upgrade pattern. At higher tiers of gear all I care about are lower limits on the negatives for positives. Meaning, if a weapon is +2.5% damage i'm only willing to part with a 1% difference versus toughness, etc etc. So this would look like:
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
Do NOT forget to restart DB completely after changing an item ruleset in Armory. I've tried refreshing the plugin when the bot is paused, but it doesn't take the new rules into consideration. ALWAYS RESTART OR HAVE DEMONBUDDY OFF WHEN MAKING CHANGES TO UPGRADE RULES!
Hope this helps D:!
-Mojo
So if you haven't already seen this plugin, it is a MUST for gearing your bots AS they bot. It's a plugin made by rrrix, and all praise should be given to him for making such a straight forward plugin.
Q: What does it do?
A: This plugin will automatically equip a looted item based on the % stats given by the in-game menu when inspecting an item. In other words, if it is an "upgrade" based on loot rules you set then it will replace any item you're currently wearing with this one.
Q: Can I trust this to NOT get rid of items I actually want to keep?
A: This depends 100% on your understanding of C#, of which I'm making this thread to help you out with!
Q: Where can I get said Plugin?
A: Go back out one (Forum->Demonbuddy Forum -> Plugins) and you should see a thread near the top? Otherwise, if you're lazy: Boop
To the meat:
What we're interested in here is a small section of code that tells the bot what YOU consider to be an "upgrade". This section of code is found inside ItemEvaluator.cs inside your Armorery plugin folder. I recommend using NotePad++ (google it) for editing purposes. Make sure that NotePad++ is set to "C#" under language options at the top on your toolbar.
The code block we're looking for starts on line 161, or simply search for "0.05" and you'll find the CalculateUpgrade() boolean method. (This means anything calling this method is expecting a true/false return statement).
So what does all this jibberish mean? Let me lay it out for ya!
Default: Concentrates more on toughness over damage, and has a lower limit threshold of -15% damage for an upperlimit of 15% toughness.
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (damage > -0.05 && damage + toughness > 0)
isUpgrade = true;
if (damage > -0.15 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
return isUpgrade;
}
Ok, so what does any of that mean? It means that if you look an item with -9.3% damage the bot will ONLY consider it an upgrade IF the Toughness you get out of the item is greater than +9.3%.
Math:
if (damage > -0.15 && damage + toughness > 0 && healing > 0)
This is saying that so long as the damage is GREATER than -15%, then as long as the toughness + damage is GREATER than 0 do we consider this an upgrade. The healing > 0 is only for the second fall-through if statement to ensure you aren't completing gimping yourself in surviveability as a whole just for some damage.
This is where the FIRST "If" statement comes in:
Code:
if (damage > -0.05 && damage + toughness > 0)
This is the statement that checks to see if the damage is GREATER than -5% so long as the Toughness you gain is GREATER than 5 so when you add them together you get > 0.
Ok, that all sounds....interesting....can you give me some examples?
Sure
Let's say a sword drops that is -4.3% damage, but has +5.6% toughness and -1.6% healing. We see that the damage is GREATER than -5%, so the FIRST "if" statement will be checked first. We then ADD damage + toughness together and we get +1.3% difference. This means this sword is an UPGRADE and it will be swapped out with your current weapon. "Healing" is not taken into consideration here because it fit the first conditional statement.
Another example, is that a helmet drops with -4.9% damage, but only gives +1.9% toughness. Since the difference here is -3% it is NOT greater than 0 (dmg + tough) so we do NOT consider this an upgrade. Additionally, since the FIRST conditional failed the SECOND statement is then used. Albeit since they're not in an "else if" configuration both statements are always checked, but most likely if the first is true, then we really don't care about the second one.
Ok, so what happens to this helmet with the second statement? Well, again it doesn't matter because in the second statement we're still checking to see that dmg+tough > 0, so this will also fail. Thus, said helmet is NOT an upgrade and normal trinity salvage/sell rules are applied when your bot does a townrun.
OK COOL, I GOT IT, CAN YOU JUST HELP ME WITH SOME EXAMPLE TEMPLATES?
Coo, coo, calm down little buddy! I got you, we can't all be programmers
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
Default: Concentrates on toughness over damage for survivability. Good for early game gearing of a new bot, but bad for mid/late game farming and/or leveling.
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (damage > -0.05 && damage + toughness > 0)
isUpgrade = true;
if (damage > -0.15 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
return isUpgrade;
}
--------------------------------------------------------------------------------------------
Damage: Concentrates on damage over toughness. Essentially here we're just swapping damage for toughness in priority.
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (toughness > -0.05 && damage + toughness > 0)
isUpgrade = true;
if (toughness > -0.15 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
return isUpgrade;
}
--------------------------------------------------------------------------------------------
The previous two above have one issue however. What if, for the damage oriented one, that the damage is NOT > 0.01? Well, say a sword drops that has +4.9% toughness but -4.9% damage? Or vise versa, with the toughness concentrated DEFAULT if, what happens if a -4.9% toughness sword drops with +6% damage? It will succeed as an upgrade as 6+(-4.9) == +1.1%. So if you want to force the bot to ONLY consider it an upgrade for damage OR toughness OR healing then you have to do the following:
--------------------------------------------------------------------------------------------
Forced: Damage Upgrade Focus, only consider something an upgrade for damage IF damage is GREATER than +1% to begin with.
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (damage > 0.01)
{
if (toughness > -0.05 && damage + toughness > 0)
isUpgrade = true;
if (toughness > -0.15 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
}
return isUpgrade;
}
--------------------------------------------------------------------------------------------
Forced: Toughness Upgrade Focus, only consider something an upgrade for Toughness IF Toughness is GREATER than +1% to begin with.
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (toughness > 0.01)
{
if (damage > -0.05 && damage + toughness > 0)
isUpgrade = true;
if (damage > -0.15 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
}
return isUpgrade;
}
--------------------------------------------------------------------------------------------
Finally, perhaps you want only everything to be in the green to be considered an upgrade?
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (toughness > 0 && damage > 0 && healing > 0)
isUpgrade = true;
return isUpgrade;
}
--------------------------------------------------------------------------------------------
Don't forget that you can also "tighten" these ranges to better fit a more specific upgrade pattern. At higher tiers of gear all I care about are lower limits on the negatives for positives. Meaning, if a weapon is +2.5% damage i'm only willing to part with a 1% difference versus toughness, etc etc. So this would look like:
Code:
private static bool CalculateUpgrade(float damage, float toughness, float healing)
{
bool isUpgrade = false;
if (damage > 0.01)
{
if (toughness > -0.01 && damage + toughness > 0)
isUpgrade = true;
if (toughness > -0.05 && damage + toughness > 0 && healing > 0)
isUpgrade = true;
}
return isUpgrade;
}
--------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
Do NOT forget to restart DB completely after changing an item ruleset in Armory. I've tried refreshing the plugin when the bot is paused, but it doesn't take the new rules into consideration. ALWAYS RESTART OR HAVE DEMONBUDDY OFF WHEN MAKING CHANGES TO UPGRADE RULES!
Hope this helps D:!
-Mojo
Last edited:






