Feature load fight.ash override after script fight

ckb

Minion
Staff member
If I have a fight.ash relay override script that will modify/decorate the relay browser fight page, and I choose the 'script' button to run my CCS, the fight will run to completion, but the resulting fight page will not show the relay overrides.

Would it be possible to add this override ability to the scripted fight page?
 

Veracity

Developer
Staff member
I'll have to think about this.

The thing is, a relay script is called before submitting the URL to fetch the page; it is up to the script to fetch it and decorate it as it chooses. When you use the "script" button, it runs the fight to completion - which is determined by fetching the last page of the fight.
 

ckb

Minion
Staff member
Yea - I have no idea how the back end of Mafia handles this.
I do know that if I write a KoL macro that is basically the same as the Mafia CCS, I get the fight run to completion with the relay override decoration. But this works differently for a CCS that is not macro-fied.
 

Veracity

Developer
Staff member
How do you run a KoL macro from the fight page? (I've never made a KoL combat macro).

My guess: there is a dropdown with your macros on the fight page and a button, or something.

Given that, when you click it, it invokes fight.php with parameters specifying the macro. Since it is fight.php, your fight script is invoked with the URL. It submits the fight.php request and gets the response. It decorates it and gives it back to KoLmafia to pass down to the browser.

The script button invokes "fight.php?action=custom". Since that starts with fight.php, you would think it would invoke your script. However, RelayAgent grabs it, wakes up the Combat Thread and redirects to "/fight.php?action=script". Again, that starts with fight.php, but this one waits for the Combat Thread to do its thing and than passes back the responseText from round of the fight where it stopped.

You'd think we could slide in the relay override there somewhere.
 

ckb

Minion
Staff member
How do you run a KoL macro from the fight page? (I've never made a KoL combat macro).
My guess: there is a dropdown with your macros on the fight page and a button, or something.

Ha - I had not either until I ran into this issues. But, Yes, this is how it is done.
Goto Options -> Combat -> Manage your Combat Macros
make a new macro and save it
This puts a dropdown and an "Execute Macro" button on the fight page

With a macro named 't1', you get this:

Code:
<form name=macro action=fight.php method=post><input type=hidden name=action value="macro"><input type="hidden" name="macrotext" value=""><tr><td align=center><select name=whichmacro><option value='0'>(select a macro)</option><option value="128077" picurl="" >t1</option></select> <input class=button type=submit onclick="return killforms(this);" value="Execute Macro">
 

ckb

Minion
Staff member
I am bumping this because it makes me sad every time I hit that 'script' button and do not see my override decorations.
 

Veracity

Developer
Staff member
It makes me sad that I did not work on this more before the recent release, even though this specific Feature was on my short list of "things to look at".

Unfortunately, I might be retiring from active bug fixing/feature implementing for things that do not directly affect my own game.

Thanks for the bump!
 
Top