Feature - Implemented Protect user from drunken auto-adventure in run

illarion

Member
(Thread title is poor, let me tell you a story):

So yesterday I embarked on my first serious 3 day HCNP attempt. All was going well - made all my consumption milestones, and only made one semi-serious mistake (forgot to use the organ grinder for the King).

But I was playing slowly as ever, and it was getting near rollover (and I was really tired, rollover being like 4am here). So I decided to drink up and bank turns, having done pretty much everything that I needed to do.

Logged out, turned off my computer, and headed to bed. As I often do, I booted up the laptop next to my bed to play some music to go to sleep to - not realising that I'd been castlefarming on it earlier, before ascending into my current run, and apparently hadn't finished but just shut the lid.

Imagine my horror when I see Mafia blithely wake up, login, and start trying to burn turns in the castle. I can't reach the castle yet, but as I'm overdrunk it doesn't matter - I spent ~20 turns in drunken stupor before I managed to kill it :(

I think, given FoB and that I went for liver after much back and forth, that I can still make the 3 day - but I'm gutted about the drunken turn inflation :(

First, I'm not suggesting that this is anything other than user error. It's not Mafia's fault that I (unknowingly) hibernated my laptop while a script was running, or that when it resumed, my character was in a very different place (overdrunk in day 1 of a speed attempt, rather than farming in aftercore).

That said, it would have been very (very) much helpful and appreciated by me if Mafia had realised I was overdrunk and stopped adventuring, rather than burning ~20 adventures in a drunken stupor before I managed to kill it.

Basically - would you consider protecting us idiot users from ourselves? :)
 

lostcalpolydude

Developer
Staff member
Looking at KoLmafia, executeAdventureOnce(), I see
Code:
 		if ( KoLCharacter.isFallingDown() && KoLCharacter.getInebriety() <= 25 &&
		     !adventure.getRequest().getPath().startsWith( "trickortreat" ))
It looks like mafia assumes that if you have more than 25 drunk it must be SSPD. I'm going to assume you got liver and drank a bucket of wine, putting you at 29 drunk. It looks like that check needs to be updated.
 

slyz

Developer
I would replace those lines by:
PHP:
String holiday = HolidayDatabase.getHoliday();
if ( KoLCharacter.isFallingDown() &&
	 !holiday.equals( "St. Sneaky Pete's Day" ) &&
	 !holiday.equals( "Drunksgiving" ) &&
	 !adventure.getRequest().getPath().startsWith( "trickortreat" ))
{
	KoLmafia.updateDisplay( KoLConstants.ERROR_STATE, "You are too drunk to continue." );
	return;
}
I can't overdrink, but I'll try to test this tomorrow.
 

slyz

Developer
Oh right.

I'm not so sure about this one:
PHP:
String holiday = HolidayDatabase.getHoliday();
if ( KoLCharacter.isFallingDown() &&
     !adventure.getRequest().getPath().startsWith( "trickortreat" ) &&
     !( KoLCharacter.getInebriety() > 25 &&
       ( holiday.equals( "St. Sneaky Pete's Day" ) || holiday.equals( "Drunksgiving" ) ) ) )
{
	KoLmafia.updateDisplay( KoLConstants.ERROR_STATE, "You are too drunk to continue." );
	return;
}
 
Top