Feature - Implemented removing attack-on-login

Not really sure whether to call this a feature or a bug. However, it is a bug in my mind, since it's doing something that the player probably doesn't intend. Though it's likely a built-in piece of mafia.

If you're in the middle of a fight with a monster upon logging in, mafia seems to think it should just regularly attack.

This is highly undesirable behavior. Could this be turned off somehow? Or give an option (defaulted to "do nothing on login") that lets you tell it if you want it to auto-attack on logging in?

I do almost no combats scripted with CCS at all, and for mafia to think it knows better than me what I want to do in that situation is kind of absurd. The answer to this is not "build a CCS for every monster that you can encounter upon logging in!" The answer is for mafia to not assume that I want to regularly attack it. What happens when it defaults to that, and I get beaten up, because of something mafia decided it wanted to do? That's what just happened, and is completely uncool.

Maybe you want to do it that way to initialize state upon starting up. Why not just initialize state after that first fight has ended?
 

Veracity

Developer
Staff member
(You're still here? I thought you'd abandoned us to go write Lua scripts. ;))

Yeah. You can do certain things in the middle of a fight or choice, but other things just redirect you back to that page. If you are already logged in, we fail the request with a "redirected to a fight" message, but we can't handle it while refreshing your session. I'm not even sure it looks at your CCS or choice options; it may simply fight or take option 1. And, as has been reported here before, the "Despite All Your Rage" choice adventure doesn't really have a "good" choice that KoLmafia can make during login.

I've thought about this, and I'd like it to work like this. If a request gets redirected to fight.php or choice.php and we are in the middle of refreshing the session, pop up a little mini-browser in a modal dialog that shows the request and has a KoLmafia sidepane to show you your health and such. It will have links and buttons and what have you. You finish the fight, make the choice, whatever, and hit the "Done" button. That dismisses the modal dialog, we return back to where we detected the redirect, and we resubmit the original request. If you did not finish the fight or take a choice, we'll just get redirected again and you'll get the dialog again. Otherwise, we continue refreshing the session. I suppose we should also have an "Exit" button, in case you decide you just want to punt on logging in at this time.
 
(You're still here? I thought you'd abandoned us to go write Lua scripts. ;))

Haha, yeah, i'm still around. I am doing quite a bit of writing scripts for kolproxy. I like its design philosophy more than mafia's. That said, there are some things that mafia currently just reams kolproxy at, that I couldn't write a script for without taking an obscene amount of time to do. This isn't really the thread to discuss it all in, but I like the approach of focusing entirely on the "browser upgrade" stuff, whereas in mafia, it seems more like the relay browser is the afterthought, rather than the design focus. Which is fine, just not what i'm looking for when I want to ascend.
 

Veracity

Developer
Staff member
The Relay Browser WAS an afterthought. So was ASH. So was session logging. It doesn't surprise me at all that something designed from the start with those features in mind would have them more seamlessly integrated.

It does amuse me, though, when I am told that one of kolproxy's virtues is that it doesn't keep a model of the state of the game - like tracking inventory and monster health and such - but lets the user just see what KoL itself presents, but when I look at the kolproxy Wiki and look at the list of desirable future features, I see a bunch of stuff that KoLmafia has seamlessly integrated that "Require maintaining a model of the game state: (v3.0+?)" for kolproxy.

Sort of the inverse "afterthought" situation as KoLmafia's.

But you are right - this is not the thread to make comparisons.
 
Last edited:
Logging in while trapped in a cage causes issues...

Since you can't do anything while trapped in a cage, Mafia fails to retrieve most of the information it usually gets at this time.

It also appears to be an unsupported choice adventure. =/
 
Last edited:
Manual control requested for choice #211 or Unsupported choice adventure #212.

I guess 212 is if you click "wait for help" before logging off.

Also, details: Mafia thinks I'm naked, level 1, and have 0 base stats (though, oddly, it gets my buffed stats just fine).
 

Theraze

Active member
Yeah... looks like 211 is currently done as either automating gnawing through the bars, or show in browser. Which makes sense, since if you're waiting, you aren't automating it. 212 should probably follow the same rules.

Question for the people who make decisions like this (and you, since you were stuck in it): Should the default choice be gnawing through the bars, or showing the mini-browser?
 

Theraze

Active member
Sounds good. I'll attach a patch that makes 212 supported, and defaults 211 and 212 to action 0, show in browser.
 

Fluxxdog

Active member
Manual, definitely manual. This is a critical item in stunt runs and should never be automated by default as the result can not only screw the user but an entire clan.
edit: slightly ninja'd...
 

Theraze

Active member
Double-ninja-ed, actually. Anyways, here's the patch. Sets defaults on 211 and 212 as show in browser, adds 212 with the same message/option as 211, and fixes 3 spots in ChoiceManager where people spaced instead of tabbed.
 

Attachments

  • CageDefaults.patch
    2.6 KB · Views: 38

Theraze

Active member
Actually, that patch should still work. But for paranoia's sake, here's two more patches. CageDefaults is the same patch as above. CageDefaultsAndBallroom adds in the (tested and should be fully working) additional Ballroom unlock choices for the Bedroom.
 

Attachments

  • CageDefaults.patch
    2.6 KB · Views: 31
  • CageDefaultsAndBallroom.patch
    5.8 KB · Views: 36

fronobulax

Developer
Staff member
r8803. I asked for a new patch because my five second scan of the changes to ChoiceAdventure suggested that line numbers had changed and that I would actually have to use my brain to apply your patch. Since this is not something I am especially passionate about I am quite happy to let you do the work so that I don't have to worry about merges, branches or any of the other headaches that occur when there are simultaneous edits. I'm not saying that was actually the case for this patch but since I am being lazy asking for a new patch was much easier than actually figuring out whether it was required. And yes, I realize that typing this response took more effort that using your original patch would have taken. I get silly like that.

And in spite of all that, I do appreciate the work you do and am glad to support it by checking it in. Thank you.
 

mredge73

Member
Is it too late to request additional help here?
When auto logging on while stuck in the cage, my log-on bot script will not get executed.

The reason is: breakfast.
Because mafia cannot execute the regular breakfast routines pre-script, Mafia auto-aborts and my botting script is never executed.

Good suggestions for fixing it here but I don't know how hard any of them are to implement:
http://kolmafia.us/showthread.php?4...ily-deeds-and-edge-cases.&highlight=breakfast

PS
Thanks for fixing the choice adventure, It has caused me problems for about 2 years now.
 

Theraze

Active member
I think this bug is actually closed, and what you're requesting is...

No clue? Maybe requesting to have logon scripts run before breakfast? Everything else there appears to be user suggestions for how to modify things, completely irrelevant to code changes. Which would break all existing logon scripts that expect breakfast to already have run...

FReq it, don't attach it to a closed bug report? :)
 

slyz

Developer
If a login script has too much output to the gCLI, the reason the breakfast didn't go well might scroll away. Maybe execuing the login commands before running the breakfast wouldn't hurt that much? I can't really think of a breakfast action that is absolutely needed. On the contrary, I would be glad to have Mafia do the libram summons after my login script has used up the MP I gained during rollover.

This way, a logon script could also change the breakfast preferences in cases like mredge73's.
 

Theraze

Active member
If you really want it to work that way, couldn't you just disable the main breakfast and run it through calling the breakfast command in your login script? You could even have your login script turn the options back on, capture the state of the breakfast command running so it couldn't abort your execution, and disable it again when done...
 
Top