taltamir / ttpack

A collection of KoL scripts by taltamir
MIT License
4 stars 0 forks source link

Endless loop during attempted #36

Closed magus-prime closed 3 years ago

magus-prime commented 3 years ago

This morning, with r20331, I got an endless loop of the following when running Guzzlr.ash: It started here:

`[1667] Barrrney's Barrr Encounter: You and the Cap'm Make it Hap'm You acquire an item: Cap'm Caronch's Map

[INFO] - Nasty Booty time! [INFO] - Starting preadventure script... Maximizer: 5item,meat,0.5initiative,0.1da 1000max,dr,0.5all res,1.5mainstat,mox,-fumble,0.4hp,0.2mp 1000max,3mp regen,0.25spell damage,1.75spell damage percent,2familiar weight,5familiar exp,-equip sword behind inappropriate prepositions,-equip staph of homophones,-equip Snow Suit,-equip little bitty bathysphere,-equip deceased crimbo tree,-equip broken champagne bottle,-equip makeshift garbage shirt,-10ml,-equip Kramco Sausage-o-Matic™

equip hat Thunkula's drinking cap

equip shirt sea salt scrubs

equip pants Jeans of Loathing

equip acc3 pine cone necklace

[INFO] - Target hp => 1535 - Considering restore options at 655/1535 HP with 1478/4323 MP [INFO] - Active Negative Effects => []

cast 4 Blood Bond You acquire an effect: Blood Bond (40)

cast 17 Blood Bubble You acquire an effect: Blood Bubble (51)

[INFO] - Using item pixel orb as restore. [INFO] - Using item pixel orb as restore. [INFO] - Using item pixel orb as restore.`

and just kept going until I hit the ESC key a few times.

[INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) KoLmafia declares world peace. Stack trace:   at ranked_optimization (auto_restore.ash:1178)   at ranked_optimization (auto_restore.ash:1201)   at __maximize_restore_options (auto_restore.ash:1337)   at __restore (auto_restore.ash:1537)   at acquireHP (auto_restore.ash:1802)   at acquireHP (auto_restore.ash:1728)   at acquireHP (auto_restore.ash:1719)   at acquireHP (auto_restore.ash:1709)   at auto_pre_adventure (auto_pre_adv.ash:485) [ERROR] - Error running auto_pre_adv.ash, setting auto_interrupt=true Stack trace:   at autoAdvBypass (auto_adventure.ash:148)   at autoAdvBypass (auto_adventure.ash:141)   at LX_joinPirateCrew (optional.ash:725)   at tt_accessPirates (guzzlr.ash:459)   at guzzlr_deliverLoop (guzzlr.ash:749)   at guzzlr_deliver (guzzlr.ash:796)   at guzzlr_aftercore (guzzlr.ash:813)   at main (guzzlr.ash:864) printStackOnAbort => false afterAdventureScript => scripts\BestBetweenBattle.ash

Everything worked fine yesterday but there have been two major refactorings of code in autoscend's beta branch in the last two days.

When I tried again I noticed that the Guzzlr pre-adventure script had decided to do the following, for no reason that I can fathom: `[INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,004 hit points Equipment changed. Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Requests complete.

Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast. [INFO] - Using item pixel orb as restore. (usable quantity of pixel orb is limited to 0 by daily limit) [INFO] - Using item scented massage oil as restore. Using 1 scented massage oil... You gain 1,020 hit points Finished using 1 scented massage oil. You acquire an effect: Blood Bond (70) Blood Bond was successfully cast. You acquire an effect: Blood Bubble (81) Blood Bubble was successfully cast.`

taltamir commented 3 years ago

thank you for reporting this issue

the refactoring did not actually modify the restore code yet so I think it is coincidence. most changes were in header file, for restore I just redid the whitespace to make it human readable. the changes to restore code are still being worked on in this https://github.com/Loathing-Associates-Scripting-Society/autoscend/pull/551

Which include a fix to aftercore usage of restore items. (it considers them to be free and thus preferable to skills, thus spamming scrolls of drastic healing). pixel orb is too expensive to mallbuy so i will just remove it from allowed item list. (added to that very same PR)

the loop of restore then spend it on blood skill is weird. i will look into it. I think it might have had to do with it failing to use the pixel orb

taltamir commented 3 years ago

Question. Should I temporarily disable guzzlr using autoscend pirate code (and thus autoscend's restore code) until that PR is merged and the issue is solved?

magus-prime commented 3 years ago

Disabling it would be the safest course of action.

taltamir commented 3 years ago

I just talked to soolar and we just went ahead and merged that PR on autoscend now (with additional planned changes going in followup PRs). So this is effectively fixed.

it will never try to use pixel orbs again, and it will prefer restore skills to items in aftercore, and it will use mallprice correctly in aftercore now.

that just leaves the loop of restore blood then heal with scented massage oil. I say effectively since this loop should not happen again due to items no longer being the preferred method of healing in aftercore now that it checks mallprice. I will still be looking into it to harden against something like that happening again. But I think it is safe to say it is fixed now that that PR has been merged.

do svn update in CLI to get the fix.

magus-prime commented 3 years ago

Heh. For obvious reasons I haven't had a chance to test this but I decided to grep my session logs for uses of the pixel orb. The script used four of them in the past. Oh well. I can afford to replace them but it still stings.

Please give some thought to adding protection against using other expensive consumables if you haven't already.

Would you and the rest of the autoscend team consider an option to allow a user-specified restore script?

Thanks.

taltamir commented 3 years ago

Fixed in https://github.com/Loathing-Associates-Scripting-Society/autoscend/pull/551 https://github.com/Loathing-Associates-Scripting-Society/autoscend/pull/619