Bug - Waiting for Info user_confirm in logout script on Mac

Hellno

Member
I have a user_confirm in my logout script, which appears to lock KoL Mafia when run on a Mac (as seen in attached image).

Code:
	if (my_inebriety() == inebriety_limit()) {
		if(user_confirm("Overdrink?")) {
		
			kmail("Buffy", "25 The Ode to Booze",0);
			
			int counter = 0;
			while(!(have_effect($effect[Ode to Booze]) > 9)) {
				wait(3);
				counter += 1;
				if (counter > 5) break; 
			}
			SIM_CONSUME = false;
			eatdrink(fullness_limit(),inebriety_limit(),spleen_limit(),true);
		}
	}

When I replaced the user_confrim with a 1==1 it looked like it locked at first (I didn't see the cli output like I do on a PC, just a blank box as in the screenshot-just without the user_confirm box), but the script finished and kol mafia closed properly.

I don't know if this is a java issue, a kolmafia issue or a Hellno issue, but hopefully this was the right place to report it!
 

Attachments

  • Screenshot 2015-10-12 12.04.44.png
    Screenshot 2015-10-12 12.04.44.png
    23.2 KB · Views: 59

Veracity

Developer
Staff member
Considering that we have already disposed of the GUI before we execute the logout script, I am amazed that user_confirm has any chance at all on any platform.

Looking at LogoutManager.doLogout, I suspect we could/should move the things that do KoLmafia.updateDisplay - including the logout script - to before the code that destroys the GUI.
 

Theraze

Active member
Doesn't the logout script trigger after mafia closes the GUI and moves to the login window? Does user_confirm ever work there?

Edit: Veracity ninja-ed. Looks like I was right. :)
 

Veracity

Developer
Staff member
With this in my logout script:

Code:
print( "user_confirm returned " + user_confirm( "OK to log out?" ) );
user_confirm worked just fine for me in revision 16366, which runs logout script before shutting down the GUI.
 

Hellno

Member
With this in my logout script:

Code:
print( "user_confirm returned " + user_confirm( "OK to log out?" ) );
user_confirm worked just fine for me in revision 16366, which runs logout script before shutting down the GUI.

Is this on a mac? I haven't ever had a problem with my code on any of my PCs, but I only have one mac to test it on. Your snippet locked my mafia the same way, which I assume is not too surprising.

PS: If anyone has a suggestion on how I can circumvent this problem, my ears are open.

edit: this was all with 16365 so ignore
 
Last edited:

Veracity

Developer
Staff member
Well, that's not how it behaves on my Mac.

I'm just going to roll it back - since Darzil is now having problems - and let somebody else work on it, if they care.
 
Top