This is the first I've heard of anybody using a script for Valhalla. We never considered that anyone would do that.
Originally Posted by fredg1
Which probably makes this a Feature request: "Support scripting in Valhalla".
KoLmafia calls api.php for every request which is not a RelayRequest - i.e., is generated by KoLmafia itself via the GUI, CLI, or ASH script - in which KoL says "refresh the charpane".
The Compact Side Pane's "Refresh Status" button also does that. Lots of places call ApiRequest.updateStatus().
This is the first I heard that api.php doesn't work in Valhalla.
Apparently "being in valhalla" is another reason to do the charpane instead...
public synchronized static String updateStatus( final boolean silent )
// If in limitmode, Noobcore, PokeFam, and Disguises Delimit API status doesn't contain the full information, so use Character Pane instead
if ( KoLCharacter.getLimitmode() != null || KoLCharacter.inNoobcore() || KoLCharacter.inPokefam() || KoLCharacter.inDisguise() )
ApiRequest.INSTANCE.silent = silent;
Also, it's not super consistent, but there are times where I catch a glimpse of "Unhandled redirect to main.php?noobmessage=true" , too. May or may not be linked to this?
Don't do that. This is ValhallaManager.postAscension, which resets a lot of state, pulls 3 free pull items (VIP key, cursed microwave, cursed pony keg), runs YOUR postAscensionScript, visits your clan to update available VIP lounge items, resets daily deeds, and on and on.
ALSO also, is there/could there be a way to manually do the "on ascension" processes?
Sometimes, they fail (because of me doing things in the relay browser while not noticing that they were still running in the background), and I end up with things such as free pulls not being pulled, the spookyraven letter not being read, and so on...
No. Seriously, don't do that.
If I know that I messed up the on-ascension process, any way to re-initiate it?
Perhaps there could be a way to have the relay browser refresh a page saying that it is "automating", while lengthy processes happen. I have a length kingLiberatedScript, for example, and when I click the prism, KoL seems to freeze for a long time while it runs. Doing postAscension processing - which includes your postAscensionScript - also makes KoLmafia seem to freeze for a while.
Those are completely orthogonal to "api.php in Valhalla", so you've pretty much glommed multiple bug/features into one thread, here.