bumcheekcity's Ultimate Manipulating Relay Appropriating Technical Substance

Veracity

Developer
Staff member
On my logout link in the relay browser, I see: http://127.0.0.1:60080/KoLmafia/logout?pwd=xxx
That executes the "logout" command and redirects to loggedout.php. I could swear that without that, we were not intercepting the logout and calling your logout script first.

If you just close the window by clicking on the cross button (or otherwise kill the process), you are not getting logged out (and your logout script is not being called).
What OS is this? Windows?

We set up hooks to call the "quit" method - which logs out and then exits - for the following cases:

- The OS X "Quit" menu item that all programs have
- The "Exit KoLmafia" menu item we add to General if you are NOT on OS X
- The "Exit KoLmafia" item we add to the System Tray popup on Windows
- The "exit" command

Apparently, the "x" on a Windows (is it?) frame exits the program, too, and we should probably hook up a handler to that to call the quit method.

Obviously, if you force quit a program or ^C it, we can't intercept that. Actually, we MIGHT be able to intercept a ^C, but I'm not sure we want to.

Edit: OK, I just looked a bit at this. The Windows "X" box just closes the current frame, right? That should use the standard "dispose on close" stuff we do for Java frames, including calling logout when you shut down the last frame. Or am I still confused? When you close the main GUI while logged out and it is your last frame, it takes you back to the Login frame and says it is logging out, right? Or is there some OTHER "x" you press that exits the program without taking you to the Login window?
 
Last edited:

Bale

Minion
Edit: OK, I just looked a bit at this. The Windows "X" box just closes the current frame, right? That should use the standard "dispose on close" stuff we do for Java frames, including calling logout when you shut down the last frame. Or am I still confused? When you close the main GUI while logged out and it is your last frame, it takes you back to the Login frame and says it is logging out, right? Or is there some OTHER "x" you press that exits the program without taking you to the Login window?

I use windows. You are entirely correct. When I do that, it logs out of mafia and returns to the login frame.
 

bumcheekcity

Active member
Update coming soon. That's bumcheeksoon. Plans to include:

town_alter.php - One-Click Solver. - DONE
fight.php - Add a "Stasis" button to the right of "Use Item(s)" which will use a single stasis item (spices, turtle totem, facsimile dictionary, etc.) for one round. Also add single-click He-Boulder rays. - DONE
fight.php - Stop adventuring if you have any inigo's turns left. Or greater than five. I don't know if this is possible. - It's Not
guild.php - In the Myst guild, indicate when you have the items for the chefstaff. - DONE
inventory.php - Fix the bug with the descriptions of some items repeating. - DONE
noob.php - Quest Spoiler.
topmenu.php - Change "M" and "W" to "Mall" and "Wiki" and split the "inventory" link. - DONE

Also, is anyone having a problem whereby if they equip an item, their "currently equipped" section gets blanked? I think it's probably my fault with topmenu.ash.

And obviously willing to hear feature requests.
 
Last edited:

xKiv

Active member
I use Tard's framework, and FF v3.6.8. The "logout" link in the top menu just points to http://127.0.0.1:60081/logout.php

(click at your own risk :D )


FWIW, I used to use both framework and mr. script



What OS is this? Windows?

Linux. Which can be set up in myriads of ways, but I *think* most window managers just send a particular X message to the windows process. Or the kill signal.
I generally avoid that button untill I need to kill a hung process belonging to that window ...
 

Veracity

Developer
Staff member
If you just close the window by clicking on the cross button (or otherwise kill the process), you are not getting logged out (and your logout script is not being called).
Linux. Which can be set up in myriads of ways, but I *think* most window managers just send a particular X message to the windows process. Or the kill signal.
I generally avoid that button untill I need to kill a hung process belonging to that window ...
OK. I have an Ubuntu partition on my computer; I needed it for a consulting contract I had last year and will be needing it for work again, by and by...

I booted up Ubuntu
I applied all the patches that had come out in the months since I last did that.
I rebooted.
I downloaded KoLmafia-14.1.jar from Sourceforge.
I started it: java -jar KoLmafia.jar
I saw my Login Frame. In the upper right corner were three icons. The tooltips said "Minimize Window", "Maximize Window", and on the X, "Close Window".
I logged in.
I opened the Item Manager.
I clicked on the X on the Item Manager. It went away.
I clicked on the X on the Adventure Frame. The Login Frame appeared and on its status bar, I saw "Preparing for Logout..." followed by "Logout Request Submitted".

In other words, it behaved EXACTLY as it does on OS X or Windows.

Therefore, I have no clue why pressing the X button on YOUR computer does not run a logout script or submit a Logout Request - but it is something specific to your setup, rather than some general fault within KoLmafia.
 

xKiv

Active member
Therefore, I have no clue why pressing the X button on YOUR computer does not run a logout script or submit a Logout Request - but it is something specific to your setup, rather than some general fault within KoLmafia.

Almost certainly. It doesn't help that my recent job has me confusing left and right mouse buttons (I have Afterstep set to send "delete" on button 1 and "destroy" on button 2).
Also, I only ever use it for the "destroy" functionality, when I want to get rid of a program that is completely frozen .. in which situation even windows will let you *really* kill the program (this process is not responding ... do you want to close it ... you will lose all data ... etc ...)
 

catchops

New member
Thanks for sharing this. Haven't read the whole thread, apologies for any dupes:

woods.ash v0.2: a couple of errs escaping quotes on lines 24-25
questlog.ash v0.1: suddenly my notes are url-encoded (already mentioned)

Option conflicts:
- "Hide Inventory Images" (KoL option) also hides your inventory spoilers (inventory.ash v0.1).
- "Cache KOL images" (mafia option) changes image urls to relative instead of absolute, so cyrpt, pyramid, and woods don't work as expected

The other inventory issue: when you equip an item and your Current Equipment is blanked is something to do with the fact that they're ajax calls.
I modified inventory.ash to do nothing if ajax=1 is in the form fields, and it works for me. I don't know if that's the right way to do it or if this is the best way to code it in ash:

Code:
--- inventory.ash.orig  2010-08-21 19:04:15.649891700 -0700
+++ inventory.ash       2010-08-21 19:33:19.436554500 -0700
@@ -49,13 +49,20 @@
        int drunk, full, level, spleen;
        load_current_map("bumrats_items", itemmap);
        
+       string[string] ff = form_fields();
+       if (ff contains "ajax" && ff["ajax"] == 1)
+       {
+               // when we handle the ajax calls, stuff goes wrong.
+               return;
+       }
+       
        buffer results;
        results.append(visit_url());
        
        //<b class="ircm">blackberry</b> <span>(2)</span><font size=1><br>
        //<b class="ircm">royal jelly</b> <span></span><font size=1><br>
        //m = create_matcher("<b class=\"ircm\">([0-9A-Za-z-' ]+)</b>\ <span>[\(0-9\)]*</span><font size=1><br>", results);
-       m = create_matcher("<b class=\"ircm\">([0-9A-Za-z-' ]+)</b>\ <span>[\(0-9\)]*</span><font size=1>", results);
+       m = create_matcher("<b class=\"ircm\">(?:<a [^>]+>)?([0-9A-Za-z-' ]+)(?:</a>)?</b>\ <span>[\(0-9\)]*</span><font size=1>", results);
        while (m.find())
        {
                descid = itemmap[m.group(1)].descid;
 
Last edited:

roippi

Developer
Is the fix for the above inventory.ash bug in the current build? I'm not sure which bug was squashed with inventory 0.2, but I'm still getting it.
 

icon315

Member
one little thing, Topmenu.ash could you flip The Right and Wrong side. i'm pretty visual, and seeing it like that confuses me
 

bumcheekcity

Active member
Yeah, I can do that. I'm waiting on Veracity/Jason to confirm yay or nay on master-override thing and I'll do a few fixes and tweaks.
 

Rinkadink

New member
Found an interesting little issue with the YOROIDS script:
UnintendedBoulderRay.jpg

Not sure how much you care about that popping up every time someone fights a Mech, but I thought it was funny, at least.
 

peter50216

New member
You acquire an item: glowing red eye USE BOULDER RAY [acc1] [acc2] [acc3]

Seems that this is a bug...

Edit: Oops. didn't see the previous post. Just ignore me...
 

Isvarka

Member
Out of curiosity, how easy is this to use just some of the scripts as opposed to the whole package? Say I just want (for example) the inventory, pyramid, dungeon(s) ones, and one or two others, is that possible or do without a ton of work?

Also, for the inventory script, how easy would it be to add in a rough adv/food or adv/booze number for the various consumption items (discounting stuff like milk or ode)?
 

Theraze

Active member
Yeah... just put whichever files you want into the relay folder, and skip the ones you don't. :)

Regarding adventures per food/booze, I'd suggest looking into the EatDrink.ash script if you aren't trying to go for a specific consumption trophy currently... and if you are, the specifics don't matter as much, since you're just consuming regardless. I wouldn't imagine though that it should be too difficult to add in the average numbers, since EatDrink displays the numbers and will create better food/drink for you if need be.
 

shoptroll

Member
Just found out about this and it looks like a lot of functionality that I've been wanting for a while. Looking forward to checking this out tonight.
 
Top