script now looks like this:
but gives off an error:
useing mafia version 14.3
edit: it also does not prompt for number and item name
Code:
boolean red_out(string message) { print(message, "red"); return false; }
void main(int number, int stuff){
discard(number, stuff);
}
{
boolean discard(int number, item stuff)
{
if(is_tradeable(stuff)) return red_out("Don't discard that! It can be malled!");
if(autosell_price(stuff) > 0) return red_out("Don't discard that! It can be autosold!");
int amount = item_amount(stuff);
for counter from 1 upto number
{
visit_url("inventory.php?action=discard&pwd=" + my_hash() + "&whichitem=" + to_int(stuff));
}
if(amount == 0)
{
print("You don't have any " + to_plural(stuff) + ".", "red");
return false;
}
if(amount - number == item_amount(stuff))
{
print("Discarded " + number + " " + to_plural(stuff) + " successfully.", "green");
return true;
}
else
{
print("Could only discard " + (amount - item_amount(stuff)) + " out of " + number + ".", "red");
return false;
}
}
boolean discard(item stuff)
{
return discard(item_amount(stuff), stuff);
}
}
but gives off an error:
Code:
[COLOR="red"]Function 'discard( int, int )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (discard2.ash, line 4)[/COLOR]
useing mafia version 14.3
edit: it also does not prompt for number and item name
Last edited: