Graphical CLI window contains end of session data for previous character

Ethelred

Member
Hellion has stopped supporting Mr. Script and recent KoL changes are introducing bit rot into the current version. I used Mr. Script mainly for the ability to customize the top menu. Along with Mr. Script, I also used a Greasemonkey script, KoL Top Menu Resizer, to increase the font size and top menu frame size, so I could actually read it. Now I'm trying to migrate to an alternative to provide some of that functionality. Searching the kolmafia forums, Bale's topmenu relay override script seemed like the most promising starting place. But in the process of switching over, I've encounted something strange. Typically I play several characters per day, one after the other, and I quit and restart mafia after each char is finished. I disabled Mr. Script yesterday and played with just the native KoL top menu via the mafia relay browser. I had to do a lot of extra clicking without my customized top menu and it was hard to read the small links, but I muddled through. Today, I installed Bale's topmenu relay override script and started on my daily rounds. When I logged in the second char, there was already a bunch of text in the Graphical CLI window, which I just kind of ignored. After happening a couple of more times I decided to investigate a bit and found that it was end of the session for the previous character. So now I'm confused. Is this due to Bale's topmenu, the lack of Mr. Script, or somehow related to updating to KoLmafia r15517 from r15509, or something else entirely?

One thing I did notice running without Mr. Script is that the log out process works slightly differently. With Mr. Scrpt, clicking "log out" in the top menu resulted in that link being replaced by 2 new links, "sure?" and "(nope)". Clicking "sure?" resulted in the relay browser window being cleared (but no new login screen appeared) and KoLmafia was left running and I had to quit the application. I don't think Mr. Script actually logged the character out, because opening a new relay browser window seemed to find the character in the same state without any indiction of a relogin by KoLmafia. Running without Mr. Script, clicking on "log out" clears the relay browser window, brings up a logged out message window, and terminates the KoLmafia process.

Ok, this has grown rather long winded and I've thought of some things to try as I was writing it. I'll go do some further testing. If anybody has observed anything similar recently, I'd appreciate any tips on what to look at.

System details:

KoLmafia version: r15517
OS: Mac OS X version 10.9.5
Java version: java version "1.7.0_55"
Browser: Firefox 26.0
Other: Mr. Script 1.81 (when used)

Edit: I've discovered that (at least part of) the problem is due to PEBKAC. Turns out I wasn't quitting mafia and restarting it between characters as I thought I was. Logging out without Mr. Script causes the mafia main interface window to close and a new login window to open. That login window was not readily visible to me, being covered by other browser windows. So when I next double clicked the jar file icon to launch a new session, it took me back to the previously hidden login window and logged the next char into that instance?/session?/(whatever the proper term is)? So probably nothing to see here. Move along. Sorry to have wasted your time.
 
Last edited:

Bale

Minion
I'm glad my topmenu script was helpful. A former user of Mr. Script actually advised me of things I needed to add to it to help him quit using Greasemonkey.

That said, when I click my logout link, it logs out my KoLmafia window AND it logs out the relay browser resulting in a message in the relay browser that I've logged out and giving me a new link to log in. It looks like this:

h0wwzCJ.png

If you are not seeing that KoL log out message in your relay browser, then something is wrong and we should start trying to figure out what.
 

Theraze

Active member
When I logged in the second char, there was already a bunch of text in the Graphical CLI window, which I just kind of ignored. After happening a couple of more times I decided to investigate a bit and found that it was end of the session for the previous character. So now I'm confused. Is this due to Bale's topmenu, the lack of Mr. Script, or somehow related to updating to KoLmafia r15517 from r15509, or something else entirely?

Regarding this, if you log out of a character and into a new one, you still see the gCLI from the prior character. This is how mafia has worked for the ~5 years I've used it, if memory serves. Well, 5 years if you don't count when mafia was brand spanking new.

Anyways, this allows you to see if your logout script threw an error, for example. To avoid this, you could make the last line of your logout script send cls/clear or cli_execute("cls/clear"). Don't put both versions, pick your fav and just send that one.

But if you like actually seeing what happened when you logged out, and the ability to do some troubleshooting when stuff goes wrong, consider the display to be a bonus, not a drawback.
 

Ethelred

Member
Regarding this, if you log out of a character and into a new one, you still see the gCLI from the prior character. This is how mafia has worked for the ~5 years I've used it, if memory serves. Well, 5 years if you don't count when mafia was brand spanking new.

Anyways, this allows you to see if your logout script threw an error, for example. To avoid this, you could make the last line of your logout script send cls/clear or cli_execute("cls/clear"). Don't put both versions, pick your fav and just send that one.

But if you like actually seeing what happened when you logged out, and the ability to do some troubleshooting when stuff goes wrong, consider the display to be a bonus, not a drawback.

It was more that it was different behaviour than what I was used to. At first I didn't understand what was going on. Now that I realize that Mr. Script was interfering with KoLmafia's logout behaviour, I can get on with things and continue as I had been by quitting from the new login window, or just logging in again to gain the advantages you point out. Thanks for the help.
 

Ethelred

Member
I'm glad my topmenu script was helpful. A former user of Mr. Script actually advised me of things I needed to add to it to help him quit using Greasemonkey.

That said, when I click my logout link, it logs out my KoLmafia window AND it logs out the relay browser resulting in a message in the relay browser that I've logged out and giving me a new link to log in. It looks like this:
h0wwzCJ.png

If you are not seeing that KoL log out message in your relay browser, then something is wrong and we should start trying to figure out what.

While using Mr. Script, I did not see that Logged Out message at all, just a blank window. Now that I realize what's going on, I'm making some progress. I can quit KoLmafia from the login window and have pretty much the same behaviour I was used to, as I mentioned above. I'm making some progress on getting the top menu to work the way I want it too, but still need some help. I'll continue this in the thread for your relay override scripts, since it may be of interest to others with feeble eyesight like me. Thanks for the help.
 

Veracity

Developer
Staff member
Turns out I wasn't quitting mafia and restarting it between characters as I thought I was.
Heh. I was just about to point out that it was impossible for the previous session's actions to be in the gCLI Window unless you actually logged in again from the Login Frame without quitting KoLmafia entirely, but you have figured out that that is what you were doing.
 
Top