loathers / autoscend

An ascension script for KoLMafia
Other
45 stars 67 forks source link

new restoration logic isn't buying MP restorers from NPC stores #140

Closed Malibu-Stacey closed 4 years ago

Malibu-Stacey commented 4 years ago

Context

Expected/Desired Behavior

acquireMP(40, 1000); restores some MP.

Current Behavior

> ash import <autoscend.ash> acquireMP(40, 1000);

Target mp => 40 - Considering restore options at 32/32 HP with 7/146 MP
Active Negative Effects => aggregate boolean [effect]
Loading restoration data.
Target mp => 40 - Uh, couldnt determine an effective restoration mechanism. Sorry.
Returned: false

That's with almost 2k meat. autoSatisfyWithNPCs = true so it's not mafia's fault. I can manually buy & use Doc Galaktik's Invigorating Tonic so store access isn't a problem either. I suspect something is failing in __calculate_objective_values but I don't have time to debug it right now.

Malibu-Stacey commented 4 years ago
> set auto_debug=true

auto_debug => true
Preference auto_debug changed from to true

> ash import <autoscend.ash> acquireMP(40, 1000);

Target mp => 40 - Considering restore options at 32/32 HP with 7/146 MP
Active Negative Effects => aggregate boolean [effect]
Calculating restore objective values.
Loading restoration data.
Applying constraints to 93 objective values.
Removed 93 restore options from consideration.
Sorting 0 options by primary objectives.
Beginning optimization of 0 restoration options.
Target mp => 40 - Uh, couldnt determine an effective restoration mechanism. Sorry.
Returned: false

> ash my_meat();

Returned: 1808
Malibu-Stacey commented 4 years ago

problem is at line 674 in auto_restore.ash boolean can_buy = meat_reserve > my_meat() && (npc_buyable || mall_buyable);

it should be checking meat_reserve < my_meat(). I'll fire up a PR.