Bale's Relay Overrides

Darzil

Developer
Your session log may be handy in pinpointing where the issue occurred. I haven't seen this issue, but then I tend to pretty much play one route these days as I've got all my factoids.
 

ckb

Minion
Staff member
Bale - If you are going to update the Spelunky script at all to make it more automatic / situational / detailed, I started a rewrite. It is mostly to tweak the CSS to make it more compact, but the plan was to have it updated based on what choice options you has based on inventory and previous unlocks.
I post it here in unfinished form.
 

Attachments

  • place.spelunky.ash
    9.6 KB · Views: 33

Bale

Minion
Veracity, thank you. The table I had was copy/pasted from the wiki which was a little different back then. I've updated it thanks to you, including the information that you can only open one zone per level.

ckb, thank you! I've looked that over and included most of what you did with a few changes.

Then I improved it to remove unavailable options from the table. That was pretty easy because of the refactoring that ckb provided. Thanks again to ckb.

This commit was a big improvement over the previous version!
 

Magus_Prime

Well-known member
After completing an "Ed" run and coming back I've noticed that the link to "guild" doesn't work. This is after manually visiting the guild and completing the initial quest. Logging out and then back in fixed the problem.

I don't know whether it's a problem with the relay script or with how KoLmafia handles events immediately post-Ed.

For my education: what KoLmafia property should I look for?

Your scripts greatly improve KoLmafia quality of life. Thank you.
 

ckb

Minion
Staff member
After completing an "Ed" run and coming back I've noticed that the link to "guild" doesn't work.

I assume you are referring to guild link in the top menu override. If you refresh the topmenu pane, it should fix the issue (hit the RE link to the right).

This happens because when you finish Ed (or any other avatar path), and choose a new class, Mafia records this, but KoL does not refresh the topmenu. Because this topmenu override creates a custom guild link based on your class, you need to refresh it to get the link to update.
 

Ethelred

Member
As I mentioned in another thread, I'm trying to use topmenu.ash to replace the topmenu functionality formerly provided by the pair of GreaseMonkey scripts, Mr. Script and koltopmenuresizer. I find the native KoL top menu just too tiny to read. koltopmenuresizer solved that problem for me and Mr. Script allowed me to customize the top menu to work the way I like, with personalized links for things like the VIP room, mushroom plot, hippy stand, etc. The topmenu relay override provides a lot of the extra links provided by Mr. Script, and I think that I'll be able to munge them around the way I want to in the fullness of time. Getting back the koltopmenuresizer funtionality is proving more problematic. By changing the topmenu.ash main code as follows:
Code:
    // Check for topmenu style
    if(results.contains_text("smallleftswordguy.gif"))
    {
        results.linkStyle();
        results.replace_string('tiny { font-size: 9px; }', 'tiny { font-size: 15px; }');
        results.replace_string('\theight: 45px', '\theight: 90px');
    }

I was able to increase the font size to what I wanted. But this doesn't change the frame size at all, so I have to manually resize it every session. I could probably live with that, but it gets tedious, so I'd like some help on how to modify the script to change the frame size. Note the the "\t' in the line dealing with the height is meant to indicate a tab to differentiate two different occurances of "theight: 45px" in the top menu frame html that I saved from the browser. I tried it both with and without the "\t" and neither changed the frame size. The version without the "\t" did seem to offset one of the two image links on the left hand side of the top menu (the florist and the hoboplis icons), so I think it was being interpreted as I intended. Anyone have any suggestion on how to get the frame size increase I'm shooting for? Just enough to show all the text with the embiggened font.

DISCLAIMER: I know very close to zip about html, javascript, web page formatting and layout, and all those sorts of things. koltopmenuresizer seems to deal with the frame size by some kind of manipulation of the style sheet, but I haven't a clue to what going on with that nor how to do that with a relay override script. If someone could point me to an example, I might be able hack on it a bit, but, as of now, I have no idea how to proceed. Thanks for any help.
 

Bale

Minion
I believe that the top frame could stand to use a font-size of 11px without needing to make the frame any larger. I apologize for causing you problems with your merge, but I am going to increase the font size a bit since I think that is advantageous to me and other users. You'll find the relevant change on line 219. Just change 11px to 15px in the /svn directory and you'll be fine.

I don't know exactly what the IFRAME is doing there in the style or if it has any purpose, but I am quite sure it doesn't affect the height of the frame since that is controlled by game.ash. I'd recommend that you copy/paste the following code and save it as game.ash in your /relay directory:

Code:
buffer add_guide(buffer page) {
	return page.replace_string('<frame name=mainpane src="main.php"></frame>', 
		'<frameset id=center cols="*,319"><frame name=mainpane src="main.php"></frame><frame name=guide src="relay_guide.ash"></frame></frameset>');
}

buffer topmenu_height(buffer page) {
	return page.replace_string('<frameset id=mainset rows="50,*">',
		'<frameset id=mainset rows="58,*">');
}

void main() {
	visit_url().topmenu_height().writeln();
	# visit_url().add_guide().topmenu_height().writeln();

}

If you use Ezandora's Guide (everyone should use Ezandora's Guide), then use the second version of the final line instead and you'll have Guide as part of your standard frameset.
 
Last edited:

Ethelred

Member
I believe that the top frame could stand to use a font-size of 11px without needing to make the frame any larger. I apologize for causing you problems with your merge, but I am going to increase the font size a bit since I think that is advantageous to me and other users. You'll find the relevant change on line 219. Just change 11px to 15px in the /svn directory and you'll be fine.
No apology necessary. Your help has more than offset the effort needed to do that.

I don't know exactly what the IFRAME is doing there in the style or if it has any purpose, but I am quite sure it doesn't affect the height of the frame since that is controlled by game.ash. I'd recommend that you copy/paste the following code and save it as game.ash in your /relay directory:

[Original script deleted. See Bale's post above for the source. ]
That didn't quite seem to work, so I set about fiddling with it. This was what I finally came up with:

Code:
buffer add_guide(buffer page) {
    return page.replace_string('<frame name=mainpane src="main.php"></frame>', 
        '<frameset id=center cols="*,319"><frame name=mainpane src="main.php"></frame><frame name=guide src="relay_guide.ash"></frame></frameset>');
}

buffer topmenu_height(buffer page) {
    page.replace_string('<frameset id=menuset rows="50,*">',
        '<frameset id=menuset rows="70,*">');
    return page.replace_string('<frameset id=rootset cols="4*,*">',
        '<frameset id=rootset cols="4*,600">');
}

void main() {
    visit_url().topmenu_height().writeln();
    # visit_url().add_guide().topmenu_height().writeln();

}

Note that I changed the '<frameset id=mainset rows="50,*">' to '<frameset id=menuset rows="50,*">' and '<frameset id=mainset rows="58,*">' to '<frameset id=menuset rows="70,*">' since mainset didn't seem to cause the topmenu frame to changes size at all and 58 wasn't quite big enough, but 70 handles it nicely. I also experimented about a bit and changed the '<frameset id=rootset cols="4*,*">' to '<frameset id=rootset cols="4*,600">' to greatly increase the size of my chat pane. I have a large monitor and like to use a large brower window and allocate more of the space to my chat pane.

If you use Ezandora's Guide (everyone should use Ezandora's Guide), then use the second version of the final line instead and you'll have Guide as part of your standard frameset.

Yeah, that's something that I've been meaning to get around to "real soon now" for quite a while. Now that I'm overcoming my fear of relay override scripts, maybe it will actually happen. Thanks for all your help. Couldn't have begun to do it without that.
 
Last edited:

Bale

Minion
Ah. I bet I know why your game.ash needed to be different! You're using the KoL option where the topmenu extends to the left over the charpane, but I use the option that causes the charpane to go all the way to the top of the screen! I forgot about that option so I didn't account for it.
 

Ethelred

Member
Ah. I bet I know why your game.ash needed to be different! You're using the KoL option where the topmenu extends to the left over the charpane, but I use the option that causes the charpane to go all the way to the top of the screen! I forgot about that option so I didn't account for it.

Yes, that is, in fact, the case.
 

Lxndr

Member
Okay, I have found Topmenu and have downloaded it.
It's quite nifty! How do I get rid of the florist and the clan raidlogs? My screen is not large enough to handle those AND the clan changer. (For some reason, the clan changer simply sits on top of those icons)
 

Bale

Minion
Okay, I have found Topmenu and have downloaded it.
It's quite nifty! How do I get rid of the florist and the clan raidlogs? My screen is not large enough to handle those AND the clan changer. (For some reason, the clan changer simply sits on top of those icons)

It never occurred to me that anyone would want to get rid of them. I figured that if you use the KoL option to extend your topmenu over the top of your character pane, then there would be plenty of space for them.

If you are comfortable with editing a script. (You are, aren't you?) then the simplest method would be to go to the svn directory and delete lines 297-305. (That only works for drop-down style. The link style is lines 239-247.) Then type "svn sync" into the CLI. Future updates will be seamlessly merged with that change.

If you're not comfortable with that, then I can see about adding a simpler method for you.
 

Ethelred

Member
Bale, I find the addition of the second floor to the VIP room adds an extra click for most of my visits to the VIP room. I usually go the second floor to access the fax machine or shower, shoot some pool, or swim a few laps far more often than all that trendy stuff on the first floor. Do you plan any changes to the Top Menu script, such as changing the VIP link to go directly to the second floor, or adding a VIP2 link? If not, I think I can hack my own version, but thought I'd check with you first to avoid re-inventing the wheel or creating an unnecessary divergence. While we're on the topic, the links I miss most from Mr. Scipt's Top Menu are the hippie fruit stand and Doc Galaktik. Any thoughts about adding those? Thanks for this great script. It makes my KoL experience a lot better and was the script that finally helped me overcome my fear of relay scripts.
 
Last edited:

Bale

Minion
I had not yet thought to do so. Most of my non-ascension VIP stuff is done from the mafia interface so it just hadn't occurred to me to do so.

I also don't dislike your other ideas. My main concern is that if I add too many features it gets way too cluttered. I'm a bit dubious about adding links to every shop in the game. I certainly can't imagine why anyone would need a regular link to the hippy fruit stand since mafia will just automatically go there when you want a pie or potion or whatever you make from those ingredients. I can see more merit to Doc Galaktiki although I never have to visit it although my automatic recovery takes care of that for me since not everyone likes recovery being automated.

Please tell me what elements on the second floor of the VIP room you need to visit directly instead of just using the KoLmafia interface which has buttons for that stuff in the Daily Deeds?
 

Ethelred

Member
I had not yet thought to do so. Most of my non-ascension VIP stuff is done from the mafia interface so it just hadn't occurred to me to do so.

This sounds like a difference in personal styles. I do all my VIP stuff from the relay browser rather than the mafia interface. In fact, I'm not even sure how to do them from the mafia interface. Maybe there's some mafia capability that I'm not aware of?

I also don't dislike your other ideas. My main concern is that if I add too many features it gets way too cluttered. I'm a bit dubious about adding links to every shop in the game. I certainly can't imagine why anyone would need a regular link to the hippy fruit stand since mafia will just automatically go there when you want a pie or potion or whatever you make from those ingredients. I can see more merit to Doc Galaktiki although I never have to visit it although my automatic recovery takes care of that for me since not everyone likes recovery being automated.

I tend to be overly paranoid about stuff being done behind the scenes, so I like to like to keep a hands on role with buying stuff from the fruit stand in aftercore (where I seem to be spending lots of time lately). I play several chars, in different clans, some of whom have Travoltan trousers and some who don't, but have access to them via a clan stash. So I wind up visiting the fruit stand manually somewhat frequently. But I can see that may be a quirk of my playstyle, so I'm alright with adding it to my personal version if you don't think it would be useful in general. I don't use your auto recovery script (see paranoia, above), so I probably visit Doc more than you. Again, I can add it myself if you feel it's specialized. I have a 2560 x 1600 display and I use a large browser window, maybe 2100 x 1300, so I actually have a lot of room in my top menu frame. Even using a larger font, about 1/3 of it is still blank horizontally. So I'd like to see more links there, but I realize I'm probably not typical in that regard. Because I could customize the top menu was the reason I hung unto Mr. Script for so long even though I didn't use very many of the other features of Mr. Script. I got very set in my ways with my customized top menu and am still having some withdrawal symptoms without it.

Please tell me what elements on the second floor of the VIP room you need to visit directly instead of just using the KoLmafia interface which has buttons for that stuff in the Daily Deeds?

Again, this seems to boil down to personal styles, I do most everything in the relay browser rather than the mafia interface window. The Crimbo tree, pool table, and occasionally the fax machine are the items I like easy access to. As I indicated, some of my chars overnight in clans that don't have some or all of those items. Sometimes I need to access a fax that isn't available via the fax network. In times gone by, I used the shower, the pool, and the looking glass in run. I'm not a fan of "restricted" ascension and am not sure how much that will be case henceforth, but I'm guessing I'm more likely to do unrestricted runs, if I ever get back to ascending at all. So I guess what I'm looking for is a simple link to the second floor of the VIP room, not links to individual items.

Sorry for the long reply. I realize my usage may not be typical so will understand if you don't care to implement any of these features, but thanks for considering them.
 

Bale

Minion
I'm glad you wanted to discuss it.

I'm definitely not going to add a link to the hippy farm. That definitely seems like a specialized use and sounds little different than adding a link to every NPC store. Doc Galaktik though... I may add a link to him, particularly since his remedies are now reasonably cost efficient for more of the game. I'll think about that.

As for the second level of the VIP room... All the things you mention are covered by the daily deeds panel, but it does seem like something that I need to consider.

I'll come to a decision tomorrow or the next day. For the ones I decide not to add, I am glad that SVN can merge your copy to make it possible for you to run a person modification and still get updates.
 

Bale

Minion
Committed code two days ago, but forgot to comment on it here.

I've added VIP2 and Doc to the topmenu per your request. Do you want any advice on adding the hippy fruit stand to the SVN copy or is it easy stuff for you?
 

Bale

Minion
Thanks to ckb, I have added a new override to this collection. If you are checking Dinseylandfill it will display your progress towards gaining each of the four keycards and killing Wart Dinsey. I expect to add some more information to this override soon since it should also inform you of which options you have unlocked in the maintenance tunnels.


Dinseylandfill: svn checkout https://svn.code.sf.net/p/bale/dinsey/code/
  • Tracks your progress towards gaining each of the four keycards and killing Wart Dinesey.
 
Top