I'm a noob to scripting. I've made a few basic scripts, but nothing using in ash. I've looked at Xylpher's very helpful guide and I have tried to write a script based off his healing script. I made my changes here and there (I kinda knew what I was doing) and produced this script.
I tried to use it but it didn't work. I know what ever I mistake(s) I made was/were a noobish one(s).
I want it to take the amount of adventures I have and divide it by 10 and use that many, but first use the one's in my inventory before going out to buy any.
Please give me corrections and tell me why the changes need to be done. I am sure there are a bunch.
Code:
void use_pet-buff( int amount )
{
if ( item_amount( $item[Knob Goblin pet-buffing spray] ) < amount )
{
buy( amount - item_amount( $item[Knob Goblin pet-buffing spray] ), $item[Knob Goblin pet-buffing spray] );
}
use( amount, $item[Knob Goblin pet-buffing spray] );
}
void main()
{
while( my_maxhp() > my_hp() )
{
int tospray = $effect[Heavy Petting] - my_adventures();
int amount = tospray / 10;
if ( amount == 0 )
{
amount = 1;
}
use_pet-buff( amount );
}
}
I tried to use it but it didn't work. I know what ever I mistake(s) I made was/were a noobish one(s).
I want it to take the amount of adventures I have and divide it by 10 and use that many, but first use the one's in my inventory before going out to buy any.
Please give me corrections and tell me why the changes need to be done. I am sure there are a bunch.