I'm writing a script to take care of my basement-diving multi for most days (except Myst, when he goes diving). The intention is to use 15 wads, of whatever type is most appropriate, and to take them from the stash if available (elsewhere in the script there's lots of pulverizing and dumping results in the stash).
However verifying the ash script gives an error "Illegal parameter #1 for function take_stash, got int, need item at line.." in the first take_stash command below. Any ideas why it's not finding an item from the map at the top?
However verifying the ash script gives an error "Illegal parameter #1 for function take_stash, got int, need item at line.." in the first take_stash command below. Any ideas why it's not finding an item from the map at the top?
Code:
void use_wads()
{
item [stat, int] wads;
wads [$stat[muscle], 0] = $item[cold wad];
wads [$stat[muscle], 1] = $item[hot wad];
wads [$stat[mysticality], 0] = $item[spooky wad];
wads [$stat[mysticality], 1] = $item[stench wad];
wads [$stat[moxie], 0] = $item[sleaze wad];
wads [$stat[none], 0] = $item[twinkly wad];
int to_use=15;
foreach key2 in wads[stat_bonus_today()]
{
if(stash_amount(wads[stat_bonus_today(), key2])>0)
{
if(stash_amount(wads[stat_bonus_today(), key2])>to_use)
{
take_stash(to_use, wads[stat_bonus_today(), key2]);
use(to_use, wads[stat_bonus_today(), key2]);
to_use=0;
}
else{
int taken=(stash_amount(wads[stat_bonus_today(), key2]), wads[stat_bonus_today(), key2]);
take_stash(taken, wads[stat_bonus_today(), key2]);
use(taken, wads[stat_bonus_today(), key2]);
to_use=to_use-taken;
}
}
}
retrieve_item(to_use, wads[stat_bonus_today(), key2]);
use(to_use, wads[stat_bonus_today(), key2]);
}