PDA

View Full Version : moving from 8.7 to 8.8 broke my function



lebwen
09-13-2006, 01:28 PM
First if this has been answered elsewhere let me say sorry and ask that you direct me there. That said I have a function that I use between ascensions to prep my soft-core characters for the next run. Now when I run the command in 8.8 it seems to error getting from stash or closet. Running the take_stash command on its own gives a "No available namespace with function" error. I have included a small cut from the main to show how the function is called.



void check_buy(int qty, item item_to_get)
{
int amt_needed;
amt_needed = qty-item_amount(item_to_get);

while (amt_needed>0)
{if(take_storage(1,item_to_get)){amt_needed = amt_needed - 1;}else{break;}}

while (amt_needed>0)
{if(take_stash( 1, item_to_get)){amt_needed = amt_needed - 1;}else{break;}}

if (amt_needed>0)
{buy(amt_needed,item_to_get);}
}

void main()
{
// Campground Accessories
check_buy(1,$item[beanbag chair]);
check_buy(1,$item[cottage]);

return;
}

Veracity
09-13-2006, 10:35 PM
I couldn't reproduce the "no namespace" error with the current source; perhaps I don't understand what you mean by "Running the take_stash command on its own."

I did notice that ASH was not detecting failed moves from hagnks or stash. It's potentially a wider problem; any time KoLmafia wanted to print "Request completed", it would forget that the request had failed.

I made it not forget that the request had failed, and your script then worked perfectly for me.

Presumably the fix will be available in a future daily build...