loathers / autoscend

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

Path Way of the Surprising Fist issues #202

Open taltamir opened 4 years ago

taltamir commented 4 years ago

This is a ticket for assorted way of the surprising fist issues.

taltamir commented 4 years ago

Fixed:

200 occured in way of the surprising fist

taltamir commented 4 years ago

autoscend sells items to acquire meat between adventures. This should not be done in surprising fist as the proceeds are all given to charity.

[INFO] - Delay between adventures... beep boop... 
Countdown:     1 second...
Waiting completed.
Autoselling items to NPCs...
You     donate 29 Meat to charity
Items sold.
Autoselling items to NPCs...
You     donate 100 Meat to charity
Items sold.
[INFO] -     Let's unlock the guild.
nextAdventure => The Sleazy Back Alley

So you are just wasting items and not gaining meat

taltamir commented 4 years ago

my hand slipped, i hit the enter button, and git took enter to mean "close and post comment" for some reason

taltamir commented 4 years ago

Doesn't happen every run (need some bad luck in the sewer)

But it might run out of meat trying to acquire an accordion or a totem in the sewer. Took a while to track but the actual issue is not with autoscend acqusition method. Rather the problem is that buffMaintain function does not check if you have one first. If you have the skill it just sends mafia a request to cast it. The problem is that if it is requesting to cast a totem or accordion skill and you do not have a totem or accordion than mafia will automatically try to acquire one. The mafia built in acquisition is not the smartest and can cause autoscend to abort, for example if you couldn't acquire on and ran out of meat to fish in the sewer.

========== Below are multiple posts combined in which I had tracked down the issue above:

On my first run as a turtle tamer this didn't occur (or i just forgot?), but on my second run as a disco bandit autoscend got stuck trying to acquire an accordion via sewer fishing. This is doable as a turn 0 strategy in other paths because you can sell the pork elf gems. But in surprising first selling them just donates the money to charity. So it got stuck not being able to get it.

I suggest that if normal run, it should just pull an antique accordion. If HC run then it should skip trying to acquire one unless you have enough meat to make the attempt at the sewer. Even if it means going without accodion buffs

Desired purchase quantity not reached (wanted 1, got 0)
[WARNING]     - Could not buyUpTo(1) of antique accordion. Maxprice: 20000
[INFO]     - Target hp => 174 - Considering restore options at 168/174 HP with 98/133     MP
[INFO] - Active Negative Effects =>     aggregate boolean [effect]
[INFO] - Loading     restoration data.
You acquire an effect: Blood Bond (10)
Blood     Bond was successfully cast.
You acquire an effect: Blood Bubble (3)
Blood     Bubble was successfully cast.
You acquire an effect: Blood Bubble (3)
Blood     Bubble was successfully cast.
You acquire an effect: Blood Bubble (3)
Blood     Bubble was successfully cast.
You acquire an effect: Blood Bubble (3)
Blood     Bubble was successfully cast.
[INFO] - Using     dwelling distant woods getaway brochure as restore.
restUsingChateau     => false

[1] Rest in your campaway tent
You gain 156 hit     points
You gain 35 Mojo Points

restUsingChateau => true
[INFO]     - Ghost busting time! At: The Haunted Kitchen
[INFO]     - Time to bust some ghosts!!!
nextAdventure => The Haunted     Kitchen

[INFO] - Starting preadventure script...
[INFO]     - We want to get the "chili" ingredient for our latte from The Haunted     Kitchen, so we're bringing it along.
Desired purchase quantity     not reached (wanted 1, got 0)
You need 1 more toy     accordion to continue.
Stack trace:
  at buffMaintain     (auto_util.ash:4961)
  at UrKelCheck (auto_util.ash:5961)
  at     auto_MaxMLToCap (auto_util.ash:5982)
  at handlePreAdventure     (auto_pre_adv.ash:413)
  at handlePreAdventure (auto_pre_adv.ash:6)
  at     main (auto_pre_adv.ash:486)
Desired purchase quantity not reached     (wanted 1, got 0)
You need 1 more toy accordion to     continue.
Stack trace:
  at buffMaintain (auto_util.ash:4961)
  at     UrKelCheck (auto_util.ash:5961)
Desired purchase quantity not reached     (wanted 1, got 0)
You need 1 more toy accordion to     continue.
Stack trace:
  at buffMaintain (auto_util.ash:4961)
  at     UrKelCheck (auto_util.ash:5961)
[INFO] - Maximizing:     5item,meat,0.5initiative,0.1da 1000max,dr,0.5all     res,1.5mainstat,mox,-fumble,0.4hp,0.2mp 1000max,3mp regen,1.5weapon     damage,-0.75weapon damage percent,1.5elemental damage,2familiar     weight,5familiar exp,10exp,5Moxie experience percent,-equip hewn moon-rune     spoon,-equip makeshift garbage shirt,-equip broken champagne     bottle,effective
Maximizing...
96 combinations checked, best     score 2,645.72
Putting on LOV Earrings...
Equipment changed.
Checkpoints     cleared.
[INFO] - Pre Adventure at The Haunted     Kitchen done, beep.

Visit to Manor1: The Haunted Kitchen in     progress...

[1] The Haunted Kitchen
Encounter: The Icewoman
Round     0: taltamir wins initiative!
Round 1: Sluuuush dissolves some of your     opponent's more important bits, leaving her weaker.
Round 1: The     Icewoman drops 13 attack power.
Round 1: The Icewoman drops 13 defense.
[INFO]     - auto_combatHandler: 0
Round 1: taltamir casts SUMMON LOVE     GNATS!
Round 2: Sluuuush runs in circles around your opponent, tangling     her up in the nasty child leash and dealing 22 damage.
Round 2: The     Icewoman takes 22 damage.
Round 2: taltamir casts SHOOT GHOST!
Round     3: Sluuuush runs in circles around your opponent, tangling her up in the     nasty child leash and dealing 24 damage.
Round 3: The Icewoman takes 24     damage.
Round 3: taltamir wins the fight!
After Battle: A love     cockroach scuttles out from beneath a nearby stove and gives you a present     from the floor.
You acquire an item: cold powder
Your familiar gains     a pound: Sluuuush, the 2 lb. Gelatinous Cubeling
After Battle:     Obfuscated Tulip gives you some meat under the table.
You gain 14 Meat.
After     Battle: Sluuuush plops wetly around the scene, helping you pick stuff up.
You     acquire an item: psychokinetic energy blob (4)
After Battle: Sluuuush,     dressed as Saint Patrick, suddenly bends over to pick a clover. You have     to tense up really quickly to avoid tripping over him. (+3 Muscle Stats)
After     Battle: You gain 10 Strongness
After Battle: You gain 7 Magicalness
You     can now equip a bottlecap turtle (and possibly other things).
You gain     a Mysticality point!
After Battle: You gain 32 Cheek
This combat did     not cost a turn

Desired purchase quantity not reached (wanted 1,     got 0)
You need 1 more chewing gum on a string to     continue.
Unable to acquire 1 sewer items.
Stack     trace:
  at buffMaintain (auto_util.ash:4961)
  at     handlePostAdventure (auto_post_adv.ash:609)
  at main     (auto_post_adv.ash:1073)
Stack trace:
  at autoAdv     (auto_adventure.ash:88)
  at LX_ghostBusting (auto_mr2016.ash:1194)
  at     doTasks (autoscend.ash:13919)
  at auto_begin (autoscend.ash:14300)
  at     safe_preference_reset_wrapper (autoscend.ash:14372)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at main     (autoscend.ash:14407)
printStackOnAbort => false
removeMalignantEffects     => true
afterAdventureScript =>
betweenBattleScript =>
CCS     set to aftercore
hpAutoRecovery => 0.3
hpAutoRecoveryTarget =>     0.95
kingLiberatedScript => scripts\prismbreak.ash
manaBurningThreshold     => 0.8
manaBurningTrigger => -0.05
mpAutoRecovery => 0.0
mpAutoRecoveryTarget     => 0.0
autoscend (formerly sl_ascend) is under new management.     Soolar (the maintainer of sl_ascend) and Jeparo (the most active     contributor) have decided to cease development of sl_ascend in response to     Jick's behavior that has recently come     to light. New developers have taken over maintenance and rebranded     sl_ascend to autoscend as per Soolar's request. Please be patient with us     during this transition period. Please see the readme on the github     page for more information.

======= After pulling an antique accordion it was able to cast accordion thief buffs, but it is still trying to sewer for some reason. (and failing and aborting due to lack of meat)

You need 1 more chewing gum on a string to continue.
Unable     to acquire 1 sewer items.
Stack trace:
  at buffMaintain     (auto_util.ash:4961)
  at handlePostAdventure (auto_post_adv.ash:609)
  at     main (auto_post_adv.ash:1073)
Stack trace:
  at autoAdv     (auto_adventure.ash:74)
  at LX_guildUnlock (autoscend.ash:9452)
  at     doTasks (autoscend.ash:14022)
  at auto_begin (autoscend.ash:14300)
  at     safe_preference_reset_wrapper (autoscend.ash:14372)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at     safe_preference_reset_wrapper (autoscend.ash:14379)
  at main     (autoscend.ash:14407)

==========

at handlePostAdventure (auto_post_adv.ash:609) is actually trying to cast empathy, so while before it failed due to lacking an accordion, afterwards it is failing due to not having a turtle totem.

=========

ok, i believe I tracked it down to the file auto_util.ash to the function

boolean acquireGumItem(item it)
{
    if(!isGeneralStoreAvailable())
    {
        return false;
    }

    if(!($items[Disco Ball, Disco Mask, Helmet Turtle, Hollandaise Helmet, Mariachi Hat, Old Sweatpants, Pasta Spoon, Ravioli Hat, Saucepan, Seal-Clubbing Club, Seal-Skull Helmet, Stolen Accordion, Turtle Totem, Worthless Gewgaw, Worthless Knick-Knack, Worthless Trinket] contains it))
    {
        return false;
    }

    int have = item_amount(it);
    auto_log_info("Gum acquistion of: " + it, "green");
    while((have == item_amount(it)) && (my_meat() >= npc_price($item[Chewing Gum on a String])))
    {
        buyUpTo(1, $item[Chewing Gum on a String]);
        use(1, $item[Chewing Gum on a String]);
    }

    return (have + 1) == item_amount(it);
}

I don't understand why this is not working. The loop is supposed to exit when it runs out of meat, additionally, afterwards it does return (have + 1) == item_amount(it); which if I understand correctly, will return false if the loop failed to acquire the item, and return true if the loop succeeded.

hmmm... maybe replace it with

if ((have + 1) == item_amount(it))
 return true;
if ((have + 1) != item_amount(it))
 return false;

==============

ok, so...

if ((have + 1) == item_amount(it))
 return true;
if ((have + 1) != item_amount(it))
 return false;

didn't work because it insists there must be a return value. switched it to

if ((have + 1) == item_amount(it))
 return true;
return false;

and I got the same issue. which means this function is working correctly. I have been looking around and I can't figure out what the problem is a test function of print (my_meat() >= npc_price($item[Chewing Gum on a String])) returns false and npc_price is correctly showing the price of 47 but it still somehow seems to be trying to use a chewing gum that I don't have and can't afford as per the error message being You need 1 more chewing gum on a string to continue.

========

Ok, I finally managed to track down the issue. The issue is NOT in the function boolean acquireGumItem(item it) that function is working correctly.

The stack trace is incomplete. the last line there is at buffMaintain (auto_util.ash:4961) which is is calling on a function starting at line 4249 which is will then at line 4289 do the following use_skill(casts, source); which, based on what the variable casts and source are, results in use_skill(1, $skill[Empathy of the Newt]); which is a mafia command https://wiki.kolmafia.us/index.php?title=Use_skill

I just tested an ash file called test.ash that has nothing except for use_skill(1, $skill[Empathy of the Newt]); and the result was

> call scripts\test.ash

Desired     purchase quantity not reached (wanted 1, got 0)
You     need 1 more chewing gum on a string to continue.
Unable     to acquire 1 sewer items.

So the problem here is in offloading this to mafia instead of handling it internally. Resulting in mafia trying to automatically acquire a turtle totem, failing due to lack of meat, and then erroring out

==============

this error

Visiting the Super-Secret Canadian Mind Control Device
Mind control device reset.
Desired purchase quantity not reached (wanted 1, got 0)
You need 1 more toy accordion to continue.
Stack trace:
  at buffMaintain (auto_util.ash:5065)
  at UrKelCheck (auto_util.ash:6065)
  at auto_MaxMLToCap (auto_util.ash:6086)
  at handlePreAdventure (auto_pre_adv.ash:413)
  at handlePreAdventure (auto_pre_adv.ash:6)
  at main (auto_pre_adv.ash:486)
Desired purchase quantity not reached (wanted 1, got 0)
You need 1 more toy accordion to continue.
Stack trace:
  at buffMaintain (auto_util.ash:5065)
  at UrKelCheck (auto_util.ash:6065)
Desired purchase quantity not reached (wanted 1, got 0)
You need 1 more toy accordion to continue.
Stack trace:
  at buffMaintain (auto_util.ash:5065)
  at UrKelCheck (auto_util.ash:6065)
Resetting mind control device...
taltamir commented 4 years ago

infinite loop when trying to vacation in beach, repeatedly saying

Visit to Beach: The Shore, Inc. Travel Agency in progress...
Ran out of adventures.

until I hit esc (I know, its bad to break with esc, but I made a snap decision when I noticed the infinite loop) resulting in

Visit to Beach: The Shore, Inc. Travel Agency in progress...
KoLmafia declares world peace.

Stack trace:
  at autoAdv (auto_adventure.ash:74)
  at doVacation (autoscend.ash:1461)
  at LX_islandAccess (autoscend.ash:10344)
  at doTasks (autoscend.ash:14051)
  at auto_begin (autoscend.ash:14300)
  at safe_preference_reset_wrapper (autoscend.ash:14372)
  at safe_preference_reset_wrapper (autoscend.ash:14379)
  at safe_preference_reset_wrapper (autoscend.ash:14379)
  at safe_preference_reset_wrapper (autoscend.ash:14379)

I had 4 adventures left and 3423 meat. I believe this is because normally a vacation costs 3 adventures, but in way of the surprising fist it costs 5 adventures instead. autoscend is probably looking, seeing I have more than 3 adv, and so it tries to go there.

taltamir commented 4 years ago

Tries to equip main and offhand items to insult mourn, which fail. Not a big deal because this one doesn't seem to break anything

[INFO] - Compressed 8 loaf of soda bread into sheep, I mean fuel: 89 --> 140
Updating inventory...
[INFO] - I am hungry for some steel.
Wielding hilarious comedy prop...
Have you forgotten your training? Only an empty hand can make a fist, Grasshopper.

Talking to Mourn at Belilafs Comedy Club
Holding Victor, the Insult Comic Hellhound Puppet...
Have you forgotten your training? Only an empty hand can make a fist, Grasshopper.
taltamir commented 4 years ago

https://kol.coldfront.net/thekolwiki/index.php/Wu_Tang_the_Betrayer is a puzzle boss, needs custom combat

Wu Tang the Betrayer cannot be stunned by multi-round stunners, but single-round staggers work normally. All damage from combat items and spells is reduced to 1; damage from all other sources is not affected. Way of the Surprising Fist skills are not spells. Defense 99999

Passive dmg I looked into: warbear drone (or some other damage dealing familiar) = 7-10 damage per attack. 1-6 attacks per round (1 at round 1, 6 at round 6-30) Curse of Vichyssoise - 12 dmg per round DoT filthy child leash on familiar = 13 dmg rage gland = 18 dmg per round Summon Love Stinkbug = 4 dmg per round? possibly would have been other if hadn't been overused by autoscend frigidalmatian = 1 dmg per round, avoid Scarysauce = doesn't seem to work, maybe i was overleveled so he couldn't hit me? Jalapeño Saucesphere = doesn't seem to work, maybe i was overleveled so he couldn't hit me? unleash the greash = actually deals good damage. if you have it prepared

way of the surprising fist attack skills get past this. but are a waste of 12 adventures to get. Maybe don't auto initiate combat with him if you don't have a reasonable access to above abilities.

taltamir commented 4 years ago

209