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.