soolar / sl_ascend

An ascension script for kolmafia
11 stars 5 forks source link

sl_ascend wants to buy expensive IOTM #308

Closed taltamir closed 5 years ago

taltamir commented 5 years ago

I tried to run sl_ascend in bees hate you path and CLI said:

Searching for "Pantsgiving"... Search complete. Do not have enough meat in Hagnk's to buy Pantsgiving. Need 240000000 have 230508002. You must be a poor meatbag. Searching for "filthy child leash"... Search complete. Using cached search results for filthy child leash... Purchasing filthy child leash (1 @ 150)... Purchases complete.

when it was buying and pulling things. that really shouldn't be doing this. Luckily i was short 10 million meat and so it couldn't afford to buy pantsgiving for 240 million

jaspercb commented 5 years ago

there's a pullXWhenHaveY($item[Pantsgiving], 1, 0); lying around, which tries to mallbuy the item. Huh, good find. I couldn't find any code changes that would have introduced this behavior, which surprises me.

jaspercb commented 5 years ago

In industry I would rename pullXWhenHaveY() to something like pullXWhenHaveY_UNSAFE_MALLBUY() to avoid future footguns of this sort. Might be worth doing.

jaspercb commented 5 years ago

Oh, it doesn't actually buy the item even if you have enough meat. The log is misleading, will fix.

taltamir commented 5 years ago

Oh, interesting. well its good that it doesn't buy it even if you have the meat.

Probably want two different functions, one that only pulls if you have it, and one that mallbuys and pulls. maybe buyandpull() to buy and then pull something. removing the buying aspect of pullXWhenHaveY() And putting a built in meat limit on buyandpull()

Actually letting the user configure the meatlimit might be a good idea.