Feature Add way(s) to [prevent mess up of / reinitiate] important 1/ascension processes

fredg1

Member
Split of the 2nd point of https://kolmafia.us/showthread.php?25524-API-php-visit-in-valhalla

Currently, there are some (possibly lengthy) 1/ascension processes that mafia will do. While doing them, it is still possible to use the relay browser. This is, in all, fine, unless the user happens to go in a "limit mode" (improper term?) (like choice adventures. Basically, anything that forces "choosing an option" as your next move, with no way to simply exit the choice by visiting another URL).

If ever doing this, all processes happening in the background will abort (because they are expecting to get a response to their request, but are all getting the choice adventure back as a response, as you are locked there).


I think we have... 2-4 possibilities here?

1- prevent the use of the relay browser while those processes are being handled.
Could lead to a general slow-down of things? Most of the time, being able to use the relay browser during those processes is a good thing....​

1.1- Only prevent the visit of "limit modes" (again, term may be wrong) during these processes? (for example, prevent the use of the Beach Comb) Problem is, it's not like it's simple to tell what relay request would lead to one of those.....


2- Allow a way to manually redo these processes. May not be a good idea; was more or less discarded by Veracity, but putting this here for the record.

2.1- Have mafia "log" where an error first occurred during these processes, and allowing the user to restart them from where that error first happened..?
For example: taking a process with 5 steps
- the first step goes fine
- during the second step, mafia gets an unexpected response. Mafia then stops doing the 2nd step, and logs that it got a bad response on step 2.
- during step 3-5, mafia gets passed that it got an error on step 2, so it doesn't do step 3-5.​
result: mafia signals that the process could not be fully done, and offers to do it again.
If doing it again: re-initiates the process, remembering that it previously got an error on step 2.
- on the first step, mafia sees that the error previously happened on step 2, which means step 1 went fine, so it skips step 1.
- on step 2, mafia sees that the error previously happened on step 2. Since this is step 2, mafia clears the error, and does the step.
- step 3-5 goes fine (possibly with this whole error handling thing happening again)​
 

fredg1

Member
Logging what was previously said about this topic:

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...

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.

If I know that I messed up the on-ascension process, any way to re-initiate it?

No. Seriously, don't do that.

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.
 

fronobulax

Developer
Staff member
I don't see this being solved in general. If I was told I had to craft and implement a solution I would start with a list of the specific things that are "critical" or once per Ascension and that are being done by native KolMafia by itself and not by a script. Since everything on that list would be mafia code it could presumably be isolated and protected from interruptions while it was running.

So what are the "(possibly lengthy) 1/ascension processes that mafia will do"?
 

Veracity

Developer
Staff member
So when you break the prism or exit valhalla, you don't wait until you see the expected output page and go and navigate somewhere else, which apparently interrupts those other processes?

Why do you do that?
 
Top