Bug - Fixed Runaway causes mafia to report "cannot find monster"

fxer

Member
Running the same macro I have been for several years, but in the last week or so I get a "cannot find monster" error and no output of the macro actually being run:

Code:
Visit to Dinseylandfill: Barf Mountain in progress...

[1105739]     Barf Mountain
Encounter: garbage tourist
Round 0: fxer wins     initiative!
Round 1: You lose 1 hit point
Round 1: fxer executes a     macro!
Round 1: fxer tries to steal an item!
Round 2: garbage     tourist takes 26 damage.
Round 2: fxer executes a macro!
Cannot find     monster.

Runaway! Snokebomb #0

Visit     to Dinseylandfill: Barf Mountain in progress...

[1105739] Barf     Mountain
Encounter: angry tourist
Round 0: fxer wins initiative!
Round     1: You lose 1 hit point
Round 1: fxer executes a macro!
Round 1:     fxer tries to steal an item!
Round 2: angry tourist takes 26 damage.
Round     2: fxer executes a macro!
Cannot find monster.

Runaway!     Snokebomb #0

Visit to Dinseylandfill: Barf Mountain in     progress...

[1105739] Barf Mountain
Encounter: garbage tourist
Round     0: fxer wins initiative!
Round 1: You lose 1 hit point
Round 1: fxer     executes a macro!
Round 1: fxer tries to steal an item!
Round 2:     garbage tourist takes 26 damage.
Round 2: fxer executes a macro!
Cannot     find monster.

Runaway! Snokebomb #0

Visit     to Dinseylandfill: Barf Mountain in progress...

[1105739] Barf     Mountain
Encounter: garbage tourist
Round 0: fxer wins initiative!
Round     1: You lose 1 hit point
Round 1: fxer executes a macro!
Round 1:     fxer tries to steal an item!
Round 2: garbage tourist takes 26 damage.
Round     2: fxer executes a macro!
Cannot find monster.

Runaway!     Snokebomb #0

Visit to Dinseylandfill: Barf Mountain in     progress...

[1105739] Barf Mountain
Encounter: garbage tourist
Round     0: fxer wins initiative!
Round 1: You lose 1 hit point
Round 1: fxer     executes a macro!
Round 1: fxer tries to steal an item!
Round 2:     garbage tourist takes 26 damage.
Round 2: fxer executes a macro!
Cannot     find monster.

Uh oh, we used an adventure trying to farm runaways!     What happened??

The Snokebomb message is my own output, printing the value of _snokebombUsed, you can see the counter never incremented but must have been working, since mafia spent some free turns, then when I was out of snokes, stinkeyes and creepy grins an adventure was actually used because mafia thought I still had more available runaways. Maybe there's been some more silent changes to how KoL handles runaways?

The macro:

Code:
[ default ]
try to steal an item
special action
if hasskill extract
    skill extract
endif
if hasskill pocket crumbs
    skill pocket crumbs
endif
if hascombatitem porquoise-handled sixgun
    item porquoise-handled sixgun
endif
if hascombatitem rain-doh indigo cup
    item Rain-Doh indigo cup
endif
while !pastround 10
    item Miniborg strangler
endwhile
if hasskill snokebomb
    skill snokebomb
endif
if hasskill creepy grin
    skill creepy grin
endif
if hasskill give your opponent the stinkeye
    skill give your opponent the stinkeye
endif
try to run away

[ knob goblin embezzler ]
abort
 

fxer

Member
Nope, no text changing effects or gear, ran a battle manually to be sure. If I enter battle and hit ESC just after mafia says "executing a macro" I can see the fight complete, text is normal, so not sure how mafia is losing track.


Hitting ESC and watching the fight complete seems to end normally:
Code:
Round 12!

You run away, like a little coward.


In your hurry to get away, you drop all the Meat you gained during the fight!
Meat	You lose 84 Meat.

	You catch a line from the song playing on your SongBoom™ BoomBox:
"Your meat's gonna start a fight"
 
I believe this is what Aenimus is referring to in this post -> http://forums.kingdomofloathing.com/vb/showpost.php?p=5049182&postcount=9

I've been seeing this with scripted use (consult script in my case which constructs a macro to submit with fight.php) of Stomping Boots free runaways, Snokebomb and Reflex Hammer from the Lil' Doctor™ bag. Asdon Martin: Spring-Loaded Front Bumper works fine however as do all the free kills. Those 3 will fail every day so it's very reproducible.

I'll try getting a debug log after rollover.
 

Ezandora

Member
I personally see this often during the seventh ed the undying fight:
Code:
[346] The Lower Chambers
Encounter: Ed the Undying
Round 0: Ezandora wins initiative!
run_combat()
Weapon damage: 27.5 (109.1), Elemental bonus weapon damage: 65.0, Hit rate: 0.16, Using stat for attack: 151, Chance of critical hit: 0.16, rounds_can_survive(): 4, using_defence = 172, expected_damage: 7
attack 1 - 27.541247999999996
Most efficient attack skill: Saucestorm (307/307-307), most efficient repeatable attack skill: none (27), quick kill skill: none (28)
Submitting macro "scrollwhendone;abort pastround 26;if hasskill 7245;skill Summon Love Mosquito;endif;if hasskill 7247;skill Summon Love Gnats;endif;if hasskill 7289;skill Micrometeorite;endif;if hasskill 4034;skill Curse of Weaksauce;endif;skill Saucestorm;attack;repeat;mark end"
Round 1: Ezandora executes a macro!
Round 1: Ezandora casts MICROMETEORITE!
Round 2: Ed the Undying (7) takes 308 damage.
Weapon damage: 27.5 (109.1), Elemental bonus weapon damage: 65.0, Hit rate: 0.16, Using stat for attack: 151, Chance of critical hit: 0.16, rounds_can_survive(): 3, using_defence = 172, expected_damage: 7
attack 1 - 27.541247999999996
Most efficient attack skill: Saucestorm (307/307-307), most efficient repeatable attack skill: none (27), quick kill skill: none (28)
Submitting macro "scrollwhendone;abort pastround 26;if hasskill 7245;skill Summon Love Mosquito;endif;if hasskill 7247;skill Summon Love Gnats;endif;if hasskill 7289;skill Micrometeorite;endif;if hasskill 4034;skill Curse of Weaksauce;endif;skill Saucestorm;attack;repeat;mark end"
Round 2: Ezandora executes a macro!
Cannot find monster.
Notably, it appears as though my combat consult script submits the macro, then mafia tries to run my consult script again, which submits a second macro - but then there's no monster, the fight's over due to the first submitted macro. Perhaps mafia isn't parsing all of the results?

I suspect this commit, r19515. I have seen this error at least as far back as 20190829.

I'll try collecting the fight HTML when this happens next.
 
Debug log of Reflex Hammer.

Code:
Visit to Conspiracy Island: The Deep Dark Jungle in progress...

[165766] The Deep Dark Jungle
Preference lastEncounter changed from smoke monster to bigface
Encounter: bigface
Preference _lastCombatStarted changed from 20190903062823 to 20190903062826
Preference _stinkyCheeseCount changed from 74 to 75
Round 0: Malibu Stacey wins initiative!
===== CONSULT TEST =====
monster = bigface
Round 1: Malibu Stacey executes a macro!
Round 1: Malibu Stacey tries to steal an item!
Round 2: bigface takes 1 damage.
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
You're on your own, partner.
Click here to continue in the relay browser.

View attachment DEBUG_20190903_banish.txt

Debug log of Asdon Martin Spring Loaded Front Bumper (which also failed today):

Code:
Visit to Conspiracy Island: The Deep Dark Jungle in progress...

[165766] The Deep Dark Jungle
Preference lastEncounter changed from bigface to Mercenary of Fortune
Encounter: Mercenary of Fortune
Preference _lastCombatStarted changed from 20190903062826 to 20190903063701
Preference _stinkyCheeseCount changed from 75 to 76
Round 0: Malibu Stacey wins initiative!
===== CONSULT TEST =====
monster = Mercenary of Fortune
Round 1: Malibu Stacey executes a macro!
Round 1: Malibu Stacey tries to steal an item!
Round 2: Mercenary of Fortune takes 2 damage.
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
You're on your own, partner.
Click here to continue in the relay browser.

View attachment DEBUG_20190903_banish2.txt

Debug log of Stomping Boots free runaway

Code:
Visit to Conspiracy Island: The Deep Dark Jungle in progress...

[165766] The Deep Dark Jungle
Encounter: smoke monster
Preference _lastCombatStarted changed from 20190903064250 to 20190903065428
Round 0: Malibu Stacey wins initiative!
Round 1: Booty McBootface rubs its soles together, then stomps in place restlessly. Clearly, the violence it's done so far is only making it ache for some quality stomping. (Use the "Release the Boots" skill to let it go nuts.)
===== CONSULT TEST =====
monster = smoke monster
Round 1: Malibu Stacey tries to steal an item!
Round 2: Malibu Stacey tries to steal an item!
Round 3: Malibu Stacey executes a macro!
Round 3: Malibu Stacey casts RUN LIKE THE WIND!
Round 4: smoke monster takes 7 damage.
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
WHAM: Running SmartStasis
WHAM: SS has finished the fight. Aborting script execution. 
You're on your own, partner.
Click here to continue in the relay browser.

View attachment DEBUG_20190903.txt
 
Last edited:

Veracity

Developer
Staff member
How odd. I looked at your banish2 file (the Asdon Martin one) and found this:

Code:
Starting consult script: consult_test.ash
<font color="maroon">===== CONSULT TEST =====</font>
<font color="maroon">monster = Mercenary of Fortune</font>
Finished consult script: consult_test.ash
Starting consult script: oracle.ash
class net.sourceforge.kolmafia.request.GenericRequest
Round 1: Malibu Stacey executes a macro!
Connecting to fight.php...

Requesting: https://www.kingdomofloathing.com/fight.php?action=macro&macrotext=pickpocket%3B+skill+Asdon+Martin%3A+Spring-Loaded+Front+Bumper%3B+
Retrieved: https://www.kingdomofloathing.com/fight.php?action=macro&macrotext=pickpocket%3B+skill+Asdon+Martin%3A+Spring-Loaded+Front+Bumper%3B+

.... Here is the response to that fight request, which I copied into ms-as-fight.txt ...

Round 1: Malibu Stacey tries to steal an item!
Round 2: Mercenary of Fortune takes 2 damage.
class net.sourceforge.kolmafia.request.ApiRequest
Connecting to api.php...

Requesting: https://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia
Retrieved: https://www.kingdomofloathing.com/api.php?what=status&for=KoLmafia

... Here is the response to the api.php request ...

Finished consult script: oracle.ash
Starting consult script: WHAM.ash
<font color="purple">WHAM: Running SmartStasis</font>
<font color="purple">WHAM: SS has finished the fight. Aborting script execution. </font>
Finished consult script: WHAM.ash
Starting consult script: WHAM.ash
<font color="purple">WHAM: Running SmartStasis</font>
<font color="purple">WHAM: SS has finished the fight. Aborting script execution. </font>
Finished consult script: WHAM.ash
You're on your own, partner.
<a href=main.php target=mainpane class=error>Click here to continue in the relay browser.</a><br>
That all agrees with what you posted.
Basically, this is all that it processed from the fight.php response:

Round 1: Malibu Stacey tries to steal an item!
Round 2: Mercenary of Fortune takes 2 damage.

So, I loaded that response (ms-as-fight.txt) and ran it through KoLmafia's fight processing and it looks like it all worked.

Code:
[color=green]> test load ms-as-fight.txt[/color]

Read 59,591 bytes into a 59,591 character string

[color=green]> test fight 1[/color]

Round 1: Veracity tries to steal an item!
You acquire an item: specialty ammo bandolier
Round 2: Mercenary of Fortune takes 2 damage.
Round 2: Mercenary of Fortune takes 1 damage.
Round 2: You lose 240 hit points
Round 2: Veracity casts ASDON MARTIN: SPRING-LOADED FRONT BUMPER!
Mercenary of Fortune banished by Spring-Loaded Front Bumper.
Obviously, it assumed it was I, not you, fighting, but it shows more stuff than you showed.
- stealing an item
- giving more damage
- taking damage
- casting the effect
- banishment.

Pondering.
 

Veracity

Developer
Staff member
Yeah, my fix for "special clips" broke all sorts of other things, it seems. Revision 19528 reverts it - which should fix all of your problems - and adds a check in the appropriate place for "ammo.gif", which will fire (so to speak) only when special clips are used.
 
Top