Hi everyone. I'm new to scripting and even after reading the wiki I can't figure out maps.
I'm trying to make a script that will get me to a specific combat rate modifier at a specific price per adventure. I would like to know if there is a way to use a maps so I don't have to copy paste each item and duration. I plan to add CombatRate > 0 once I figure out how mapping works. I was planing of making one list of all the plus combat and shrugging those off and a second map that would have the minus combat effect name, item name, duration, rate of combat modifier. Also is the a way to sort, so the cheapest is use first? Right now I was thinking of using if(mall price(item1)> mall price(item2) but that gets long after a couple of item.
Thank you in advance.
I'm trying to make a script that will get me to a specific combat rate modifier at a specific price per adventure. I would like to know if there is a way to use a maps so I don't have to copy paste each item and duration. I plan to add CombatRate > 0 once I figure out how mapping works. I was planing of making one list of all the plus combat and shrugging those off and a second map that would have the minus combat effect name, item name, duration, rate of combat modifier. Also is the a way to sort, so the cheapest is use first? Right now I was thinking of using if(mall price(item1)> mall price(item2) but that gets long after a couple of item.
Thank you in advance.
Code:
void Main(int PricePerAdv, int CombatRate){
print("Checking item's prices and buying those who are worth it.", "green");
if (CombatRate < 0){
print("Gonna shrug combat modifier if we have to.", "green");
if ((have_effect($effect[Musk of The Moose]) > 1)){
cli_execute("uneffect Musk of The Moose");
}
if ((have_effect($effect[Carlweather's Cantata of Confrontation]) > 1)){
cli_execute("uneffect Carlweather's Cantata of Confrontation");
}
if(combat_rate_modifier() > CombatRate){
## Check for Simply Invisible
if ((have_effect($effect[Simply Invisible]) < 1) && mall_price($item[Invisibility potion]) < ( PricePerAdv * 20 * 1)){
use(1, $item[Invisibility potion]);
}
## Check for Predjudicetidigitation
if ((have_effect($effect[Predjudicetidigitation]) < 1) && mall_price($item[worst candy]) < ( PricePerAdv * 10 * 2)){
use(1, $item[worst candy]);
}
}
print( "You are now at "+combat_rate_modifier()+"%. It's the best we can do for that price." ,"blue");
}
}