Bug - Fixed Not tracking adventures used/not updating adventure results

slyz

Developer
I hadn't noticed that those advs were missing from the session log, thanks for pointing them out. Request 2 of 5 happens 8 times in all:
Code:
Request 2 of 5 (Hobopolis: The Ancient Hobo Burial Ground) in progress...
class net.sourceforge.kolmafia.request.AdventureRequest
Connecting to adventure.php...

Requesting: http://www4.kingdomofloathing.com/adventure.php?snarfblat=171
3 request properties

Field: Cookie = [PHPSESSID=2uuc446s4seb6r1sh0lceoarg6]
Field: User-Agent = [Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1]
Field: Content-Type = [application/x-www-form-urlencoded]

Retrieving server reply...

Retrieved: http://www4.kingdomofloathing.com/adventure.php?snarfblat=171

11 header fields
Field: null = [HTTP/1.1 302 Found]
Field: Date = [Thu, 14 Jul 2011 20:47:05 GMT]
Field: Content-Length = [0]
Field: Expires = [Thu, 19 Nov 1981 08:52:00 GMT]
Field: Location = [fight.php?ireallymeanit=1310676425]
Field: Connection = [close]
Field: Content-Type = [text/html; charset=UTF-8]
Field: Server = [Apache/2.2.3 (Red Hat)]
Field: X-Powered-By = [PHP/5.1.6]
Field: Cache-Control = [no-store, no-cache, must-revalidate, post-check=0, pre-check=0]
Field: Pragma = [no-cache]

class net.sourceforge.kolmafia.request.FightRequest
Connecting to fight.php...

Requesting: http://www4.kingdomofloathing.com/fight.php?ireallymeanit=1310676425
3 request properties

Field: Cookie = [PHPSESSID=2uuc446s4seb6r1sh0lceoarg6]
Field: User-Agent = [Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1]
Field: Content-Type = [application/x-www-form-urlencoded]

Retrieving server reply...

Retrieved: http://www4.kingdomofloathing.com/fight.php?ireallymeanit=1310676425

11 header fields
Field: null = [HTTP/1.1 302 Found]
Field: Date = [Thu, 14 Jul 2011 20:47:05 GMT]
Field: Transfer-Encoding = [chunked]
Field: Expires = [Thu, 19 Nov 1981 08:52:00 GMT]
Field: Location = [main.php]
Field: Connection = [close]
Field: Content-Type = [text/html; charset=UTF-8]
Field: Server = [Apache/2.2.3 (Red Hat)]
Field: X-Powered-By = [PHP/5.1.6]
Field: Cache-Control = [no-store, no-cache, must-revalidate, post-check=0, pre-check=0]
Field: Pragma = [no-cache]
It looks like KoL itself throws you back to main.php, and Mafia doesn't get the fight page from which it can parse what happened.

Your recovery script is executed, but since there isn't any call to charpane.php after the redirect to main.php, the script doesn't know how much HP/MP you really have, and doesn't know you are beaten up. That's probably why you get killed several times in a row.

EDIT: I just realized you were using a KoL macro as your auto-attack. Maybe you should copy your macro into a mafia Custom Combat Script instead. It is unlikely to avoid your getting thrown back to main.php, but who knows?
 
Last edited:

Veracity

Developer
Staff member
KoL tells us to go to fight.php?ireallymeantit=xxx
We do so and it sends us to main.php, rather than showing us the fight.

That is the exact same issue reported by Dankia Talos in this bug report. Until I saw this bug report, I thought that one was unique. Apparently not. I still have absolutely no clue why KoL is behaving that way for these two players, but we should merge this report into the other one.

Edit: so merged.
 
Last edited:
I sent a bug report to TPTB, after testing in vanilla KoL (no mafia) and determining that in cases where I was getting beaten up while adventuring with an auto-attack macro enabled, I wasn't getting to see the combat page. When I turned off the auto-attack macro, I would periodically have a combat where a hobo would one-shot me in the first round, which was something I never observed while adventuring with the auto-attack macro on. Which explains the adventure-sink that was taking place while attempting to auto-adventure, if mafia never saw the status effect applied (or even any indication that an adventure had been spent in combat).

I'm not sure if this is at all zone-specific, or if it requires getting beaten up in the first round (even though I always observed this to be the situation in my case), and I didn't test with any different macros (or non-macro auto-attacks). But as far as I can tell, it's not at all a mafia issue.
 

slyz

Developer
Mafia should probably hit charpane.php after being redirected to main.php. This way it could at least be aware that you got beaten up, and that your HP is down to 0.

I guess we should add "CharPaneRequest.getInstance().run()" somewhere in GenericRequest.handleServerRedirect(), but I'm not sure where. I thought lines 1732-1737 would take care of that:
PHP:
if ( this instanceof AdventureRequest || this.formURLString.startsWith( "choice.php" ) )
{
    AdventureRequest.handleServerRedirect( this.redirectLocation );
    CharPaneRequest.getInstance().run();
    return true;
}
Tomorrow, I'll try adding this:
PHP:
if ( this.redirectLocation.equals( "main.php" ) )
{
    CharPaneRequest.getInstance().run();
    return true;
}
and see if I can do some testing.

EDIT: I just noticed lines 1617-1620:
PHP:
if ( this.formURLString.startsWith( "fight.php" ) )
{
    return true;
}
This is probably where the CharPaneRequest should go:
PHP:
if ( this.formURLString.startsWith( "fight.php" ) )
{
    if ( this.redirectLocation.equals( "main.php" ) )
    {
        CharPaneRequest.getInstance().run();
    }
    return true;
}
 
Last edited:

Dankia_Talos

New member
Autoattacking seems to be breaking things too much. Jick should just remove it from the game, what's twice as many clicks per adventure where you one-shot enemies? :p

Anyway, I've never encountered this in manually adventuring, Autoattack on or off, so they might be related, they might not.
 

lostcalpolydude

Developer
Staff member
It's a known bug that getting beaten up on the first round when you have an auto-attack macro set will send you back to the main page. I remember seeing somewhere that it's on CDMoyer's long list of things to fix.
 

Veracity

Developer
Staff member
Anyway, I've never encountered this in manually adventuring, Autoattack on or off, so they might be related, they might not.
You do understand that if KoL tells us to go to fight.php and we do exactly what it tells us to do and it redirects us to main.php instead of the fight, that is a KoL bug, not a KoLmafia bug, right?

Can you confirm that you have autoattack with a macro set during autoadventuring?
Can you disable that and then try automating, please?
Thanks.
 

Veracity

Developer
Staff member
Mafia should probably hit charpane.php after being redirected to main.php. This way it could at least be aware that you got beaten up, and that your HP is down to 0.
Actually, I think that if we followed the redirect to main.php, that page would, itself, request a charpane update. I think we should probably just follow the redirect in this case. Thus:

Code:
		if ( this.formURLString.startsWith( "fight.php" ) )
		{
			if ( this.redirectLocation.startsWith( "main.php" ) )
			{
				this.constructURLString( this.redirectLocation, false );
				return false;
			}
			return true;
		}
 

Veracity

Developer
Staff member
It's a known bug that getting beaten up on the first round when you have an auto-attack macro set will send you back to the main page. I remember seeing somewhere that it's on CDMoyer's long list of things to fix.
Was just unable to reproduce this.

- I defined a combat macro to use a seal tooth.
- I set it as my autoattack
- I got a Soul Crushing Headache and Majorly Poisoned on a multi. I boosted his myst enough to:
- Adventure in the bombed-out hippy camp
- which resulted in me scratching the hippy for a point and getting clobbered - and beaten up - for 88 points in return.

KoL showed me the fight.

Too bad. I wanted to reproduce this and test my fix - which is in Revision 9640.
 

Veracity

Developer
Staff member
Nothing that mother's little helper can't solve. OK:

Request 1 of 6 (Island: Hippy Camp (Stone Age)) in progress...

Requesting: http://www4.kingdomofloathing.com/adventure.php?snarfblat=149
Retrieved: http://www4.kingdomofloathing.com/adventure.php?snarfblat=149
Field: Location = [fight.php?ireallymeanit=1310866368]
Requesting: http://www4.kingdomofloathing.com/fight.php?ireallymeanit=1310866368
Retrieved: http://www4.kingdomofloathing.com/fight.php?ireallymeanit=1310866368
Field: Location = [main.php]
Requesting: http://www4.kingdomofloathing.com/main.php
Retrieved: http://www4.kingdomofloathing.com/main.php

[17921] Hippy Camp (Stone Age)
Processing results...

Requesting: http://www4.kingdomofloathing.com/charpane.php
Retrieved: http://www4.kingdomofloathing.com/charpane.php
Processing result: Advs Used: -1
Processing result: Beaten Up (3)

Insufficient health to continue (auto-abort triggered).

I'm declaring this fixed. It'd be nice to see the fight so we could log the encounter properly, but that's a KoL bug.
 
Last edited:

slyz

Developer
It's pretty hard to track this kind of thing down between 64 Mo of Universal Recovery debug :)
I'll remember to ask debug logs with recovery and betweenbattle scripts off next time.
 
Top