I added, circa the try in getitem, the following:
The output, trying to overdrink, is
I have no idea why mall_price would be negative but my guess is because there are not any sangria del diablo for sale at the moment and there is a discrepancy between the wiki and the code. I am definitely logged in at the moment so if the wiki is right it should be zero. Given that mall_price could return 0 it might be worth rethinking this bit of logic.
Code:
print(initialvalue);
print(PRICE_FLEXIBILITY);
print(it);
print(mall_price(it));
print(floor(mall_price(it) * PRICE_FLEXIBILITY));
set_property("autoBuyPriceLimit", max((initialvalue >= 1000 ? 1000 : 0), min(initialvalue * PRICE_FLEXIBILITY, floor(mall_price(it) * PRICE_FLEXIBILITY))));
print(get_property("autoBuyPriceLimit"));
The output, trying to overdrink, is
At drunkenness of 19. Overdrinking with 10000 meat.
Getting 1 sangria del diablo in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
20000
1.25
sangria del diablo
-1
-2
autoBuyPriceLimit => 1000.0
1000.0
Verifying ingredients for sangria del diablo (1)...
Searching for "sangria"...
Search complete.
Stopped purchasing sangria @ 1,050.
You need 1 more sangria to continue.
autoBuyPriceLimit => 20000
Something went wrong with getting sangria del diablo for 2240. Recalculating.
I have no idea why mall_price would be negative but my guess is because there are not any sangria del diablo for sale at the moment and there is a discrepancy between the wiki and the code. I am definitely logged in at the moment so if the wiki is right it should be zero. Given that mall_price could return 0 it might be worth rethinking this bit of logic.