Deathless Assassin
Member
I'm cutting out most of the script, here are what I think are the relevant bits:
I'd like it to use enough potions to have the buffs last through all my adventures, but it seems to be using only enough to last me part of the way through the day. I don't recall how many adventures I started the day with, but my hunch is that my script used enough based on that number, and not my post-consumption number. Would a refresh_status(); before the use of the potions solve this?
Code:
int currentChorale = have_effect($effect[chorale of companionship]);
int currentPunctual = have_effect($effect[Stickler for Promptness]);
int currentPetting = have_effect($effect[heavy petting]);
int choraleShotsNeeded =ceil(to_float(my_adventures()-currentChorale)/20);
int petSprayNeeded = ceil(to_float(my_adventures()+8-currentPetting)/10);
int punctualPotionsNeeded = ceil(to_float(my_adventures()-currentPunctual)/30);
~eating, drinking, other stuff happens~
buy(petSprayNeeded, $item[knob goblin pet-buffing spray]);
use(petSprayNeeded, $item[knob goblin pet-buffing spray]);
use(punctualPotionsNeeded, $item[potion of punctual companionship]);
use(choraleShotsNeeded, $item[recording of Chorale of Companionship]);
I'd like it to use enough potions to have the buffs last through all my adventures, but it seems to be using only enough to last me part of the way through the day. I don't recall how many adventures I started the day with, but my hunch is that my script used enough based on that number, and not my post-consumption number. Would a refresh_status(); before the use of the potions solve this?