Bug - Not A Bug Mafia automatically resuming adventuring after a stop for SR and computer wakes up

sleepy g

Member
I've noticed this odd behavior over the past several months but I have not been able to reproduce it consistently.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
KoLmafia v16.4 r14696, Windows 8.1, Java 1.7.0_67
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Timestamp: Wed Sep 24 18:37:48 EDT 2014
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This happens in aftercore..

Scenerio: I have 200 advs left, farming tatters in haunted library, SR coming up in 167 turns.

I tell mafia to adventure the 200 advs and walk away from computer. Some time later, long after computer has fallen asleep I return to computer and either touch the screen or computer to wake it up. Computer wakes up and mafia (which has stopped and is waiting for me to do something about the SR) starts up and continues to adventure, causing me to miss the semi rare.

I *think* it's related to possibly having the goal box checked. And not really sure it's even a bug if I have (inadvertently left) left the box checked.. because yes, I do get the black eye drops.

***

I've noticed this happening in various other areas (like hobopolis) and I have not noticed this ever happening when I will have mafia stop several adventures before the semi rare.


I hope this is clear.. if not, feel free to chat me up in game or reply to this and I will try to help (if it;s even a problem worth looking into)
 
Last edited:

Theraze

Active member
Isn't it the case where 'soft' aborts with a goal set do not abort? Auto-stops continue, etc.

Basically I believe the short answer is if you want mafia to hard-abort on your counter, use a Counter script. Even if it just checks if the counter type is semi-rare with 0 turns left and if so, aborts. Or you could use a more complicated Counter script like Bale's, which will automatically get the most profitable semirare for you.
 

sleepy g

Member
This morning I logged in, went to sloppy seconds diner... checked the box to confirm stopping after 4 choice adventures.. then walked away to do some stuff (drink coffee)

came back around a half hour later (computer was asleep, but no password required to logon to O/S -- just the monitor shut down.

touched the screen or mousepad or a key to wake up the computer.. Mafia took one adventure then told me "Conditions Satisfied after One Adventure" <-- this was one adventure run as the computer woke up, the 4 choice adventures were already satisfied and completed.

Mafia was the topmost window (browser window was also up, in relay browser mode).

Anyway.. O/S bug? Interface bug? (windows, not mafia) Or something more subtle??
 
Last edited:

Veracity

Developer
Staff member
I cannot imagine what would make KoLmafia run an adventure unless you told it to do so. Did "touching the screen" sent a button click or "enter" or something to the program?
 

sleepy g

Member
That was (is) my suspicion, but I've tried to be careful when waking up the computer.

My suspicion is some weird hardware / OS glitch probably dependent on my Lenovo / Windows / Java setup. My hope was that others have been experiencing the same problem or had experience the same problem and one of y'all would just tell me to monkey with the registry or something.

My best guess is that whatever I touch to restart the computer is interpreted as a mouse click by (the O/S or Hardware or Java or something else) causing mafia to think.. "OK, time to get back to work"

Anyway, I'll keep posting occurrences of this behavior until you tell me to shut up or someone figures out what is going on.

Thanks for listening!
 

Theraze

Active member
If it doesn't hurt your planning too much, might I suggest waking Windows machines with a combined pressing of Shift+Ctrl? Just pressing one or the other might enable an Accessibility function and leave you with a computer where the keyboard doesn't work right, especially if you tend to quick-click out of unexpected dialog boxes. Pressing the two buttons, once, together means that you aren't repeatedly pressing the same key and it should wake your computer with a result of nothing.

You might just be REALLY unlucky with your targeting on your wake-up screen tap. The one adventure and abort is the standard mafia behavior for telling it to start adventuring with conditions while offline, and if the location on the Adventuring tab has default conditions...
 

Veracity

Developer
Staff member
I am quite sure that there is no code in KoLmafia that says "execute me when the computer wakes up from sleep".
 

sleepy g

Member
Workaround -- dont leave mafia the top window when all conditions mentioned above are active.

But for the interested I did recreate today...

This morning I was meat farming the bowling alley with the scorched sphere box checked as a goal. Mafia Adventure tab was the top window. I started automation and told mafia to stop with some number of adventures left until the SR came up and left the computer to do other stuff.

Mafia stopped adventuring when I asked it to, but I was afk.... (note that it did not stop for a SR adventure, but just a normal adventure)

~~~~~~~ GRAPHICAL CLI BEGINS HERE ~~~~~~~

You are now in away mode, chat will update more slowly until you say something.

/* ~~ Several Hours Later ~~
/*
/* Computer is sleeping and I give password to unlock computer and wake it up.
/*
/* The following happens immediately in Mafia... nothing typed but password (to unlock computer) and enter


Validating adventure sequence...
Condition added: scorched stone sphere

Request 1 of 48 (HiddenCity: The Hidden Bowling Alley) in progress...
Installing default certificate validation...
Validating login server (www.kingdomofloathing.com)...

/* Mafia Logs in and adventures in Bowling Alley (?)

[28813] The Hidden Bowling Alley
625 players online.
Sending login request...
Synchronizing moon data...
Encounter: pygmy orderlies
Strategy: C:\Users\robg\Desktop\kolmafia\ccs\S AC.ccs [default]
Round 0: sleepy g wins initiative

/* combat stuff happens in here

Round 4: sleepy g wins the fight!
You gain 50 Mana Points
After Battle: Jan Brady surveys the scene from your back and sighs.
After Battle: Tom Waits sits on your fallen opponent's body, blows a smoke ring, and winks at you.
You gain 1362 Meat
You acquire an item: compression stocking
You acquire an item: pill cup
You gain 11 Strongness
You gain 26 Mysteriousness
You gain 8 Cheek

Conditions satisfied after 1 adventures.

~~~~~~~ END OF CLI ~~~~~~
 
Last edited:

Theraze

Active member
That just looks like your computer registered you pressing 'Enter' in the Adventuring tab, while offline, in a location with a goal. To confirm, you were in the Adventuring tab rather than the gCLI tab, correct? Or did it start adventuring automatically even without being on that tab?
 

lostcalpolydude

Developer
Staff member
Does anything happen if it's another program with focus, like a text editor (where a new line being added would be noticeable)?
 

sleepy g

Member
That just looks like your computer registered you pressing 'Enter' in the Adventuring tab, while offline, in a location with a goal. To confirm, you were in the Adventuring tab rather than the gCLI tab, correct? Or did it start adventuring automatically even without being on that tab?

It was on the adventure tab.
 

Winterbay

Active member
I have noticed that as well at work when logging back in from lunch with Mafia active in the background when I locked the computer. It seems the enter gets propagated form the Windows login-box to Mafia, activating Mafia to do whatever the currently selected action is. I worked around this easily by minimizing Mafia every time I'm not using it so it doesn't have focus.
 

Veracity

Developer
Staff member
So, other than trying to make sure that none of the buttons on the KoLmafia GUI are active to the enter key - which seems like introducing a bug of our own, even assuming it is possible - what do you think we can do to work around this - assuming is it even appropriate for us to try to code around Windows bugs?
 

Theraze

Active member
Besides breaking Windows and... wait, can you break something that's already broken?

I think this is likely to be a "Won't fix" or "Not a bug [in KoLmafia]" because it's just doing exactly what the operating system is telling it to do...
 

Fluxxdog

Active member
<picks up mic> "So apparently I broke Windows. Yeah, which means it doesn't crash anymore!" <rimshot>

... I know you're out there, I can hear you leaving.
 
Top