BatMan Relay -- more info, less clicking

Sary

New member
Maybe it's just me, but (while awesome!) this script appears to have something against the letter "C"?! Took these from the same fight - first round had fight & fight-preload in the relay folder, then i removed them for the second round, and put them back in for the third round, and... yeah.

Screen Shot 2012-05-08 at 12.04.18 PM.png

Screen Shot 2012-05-08 at 12.05.22 PM.png

Screen Shot 2012-05-08 at 12.06.16 PM.png

Any ideas what kould be kausing this? seems like a really kool skript but all those "k"s are driving me nuts!

ETA: nvm. figured it out.
 
Last edited:

seandamnit

New member
If you had full MP, yet MP restorers were showing as profitable, I could only suggest that you were either facing a monster with an MP draining attack or you had another source of profit (hobo monkey, NPZR, etc).

I was facing monsters from the Castle using a Coffee Pixie. I tried to replicate this for a screen shot today, but it seems to be working properly now. Maybe I wasn't actually at full MP and my charpane just wasn't updating? I don't know, but I'm over it now.

This little doo-dad you made is great, and much appreciated.
 

Theraze

Active member
Getting this every page reload:
The string "Relay Edition 1" is not an integer; returning 1 (zlib.ash, line 191)
The string "Relay Edition 1" is not an integer; returning 1 (zlib.ash, line 192)
Guessing that it has the name in the version as well and that's the problem... Instead of checking for 1.2 as the version number, it's looking for "Relay Edition 1.2" as the number. Which isn't a number. :)
 

zarqon

Well-known member
@Sary: It's your kitty kat! Actually, that's a byproduct from my clan's Kolossal Kittykore Kontest (KKK). One of the rules in the thread was that all hard c's be replaced with k's, and I went one further and changed the entire relay browser experience to match, but only when you have your kitty with you.

@seandamnit: It may also be a factor that those items didn't have accurate prices the first time. Sometimes I have an item that BatBrain seems to misvalue, but doing a mall search for it sets things aright. Are you sharing mall prices with other users (in preferences)?

@Theraze: Yep. I'm transitioning the name from BatMan Relay to BatMan RE. This was the only way to do that without having a completely broken transition.

EDIT: Paragon will be happy to know I've got the tilde key working -- it will essentially click whatever the first-appearing menu item is. So if the top menu is Custom it will submit the full custom actions macro as if you'd clicked the watch. If the top menu is Attack, it will submit the attack action as if you'd clicked the sword. If combat is over and the top menu is Adventure Again, it will adventure again as if you'd clicked the hourglass. Sweet! You can now blast through zones using nothing but one button, and with much smarter results than doing the same thing with the CAB.

Now, I just need to figure out how to disable it if the CAB is active and that feature will be ready to roll out. I'd prefer to make the check in the JS itself, so I can't easily check the mafia property there. I have to check the page itself.

I'll also take suggestions for other hotkeys. I could see a case for a key to spam attack_action(), but which key should it be? Maybe '2', since it has an @ over it? A for Attack... That could make sense for other menus as well... $ for stasis since it looks like a profitable S, ! for custom actions, # for stunning, % for deleveling if a deleveling menu exists someday. But those symbols aren't in the same order as the menus appear. Another option is to use numbers simply in the order of the menu appearance. Depends on whether people want buttons to always do the same thing, or correspond to the menus as displayed. Suggestions please! I've never used hotkeys until now, and I find myself liking them.
 
Last edited:

zarqon

Well-known member
Ha, I realized that my wording didn't clearly indicate that I hadn't posted that update yet. It's only working on my machine at the moment, I was requesting suggestions on how to finish the implementation before releasing the feature.
 

zarqon

Well-known member
1.3 Updates!

I have some wicked cool updates for you today!

Here's a nice one: this script is now fully functional in IE 8, quick menu included. I realized that KoL doesn't add any doctype information to their pages, so IE loads those pages in "quirks" mode, and evidently one of those quirks is that it treats position:fixed as position:static (same as not having position specified). However, adding a doctype to the top of the page will wake IE up and make it enter the modern world of web standards. So I did that, setting it to strict, and in the process found a few places where my own CSS was cutting some corners. After fixing those, I relaxed the doctype a bit since KoL doesn't generally supply pages that look like they were written by a web standards guy. Regardless, not only does this fix the IE problem, but everything should be much more consistent between browsers now that there is a doctype at the top.

Now for some hotkeys! (Unless you have CAB enabled, in which case they will not be enabled.) So far, I have only implemented two hotkeys, but they are the awesomest hotkeys in the world.

As I said in my previous post, the tilde key now submits the first action in the quick menu. This allows you to blast through zones semi-intelligently (certainly more intelligently than doing the same with the CAB).

The second hotkey is '0', which opens the CLI Typer, or in shorthand, CL-- wait no let's just call it the CLI box. (Not much better! *snicker snicker*) This is, quite simply, a modal dialog box for conveniently entering CLI commands from the relay browser. Simple for you, I mean. It was not simple to write -- I'm using jQuery commands attached to HTML elements which were written to the document by ASH and then served by KoLmafia to use AJAX to talk to another ASH script which executes those CLI commands from within ASH and then returns a message which the jQuery then displays to you in the document by teaming up with a bunch of CSS. There are so many disparate languages and systems working together to make this happen, I feel like simply using the CLI box will bring about world peace. If HTML and ASH and jQuery and CSS and CLI commands and AJAX can all get along, why couldn't humans?

Why have a CLI Ty-- I mean, CLI box?

I'm glad I asked! Because one of my design goals for this script is to enhance relay adventuring so hard that people don't need to click back to the CLI at all while adventuring. We're certainly not there yet, and may never be, but it's a big step in that direction.

Another step is that I have added more zone-specific info to the Adventure Again menu. Pirate insults, bang potions, and Evilness were added for Barrrney's Barrr, the Dungeons of Doom, and Defiled zones, respectively. If you can think of more info you might need to check which takes you away from the relay browser while adventuring, please suggest it so I can add it.

Enjoy this significant pile of enhancement!
 

Winterbay

Active member
What's the difference between your CLI Box and the CLI that you can use to replace the Chat-frame on the left with the help of Mafia? That works just fine for me (but then granted I almost never use chat, and if I do I use Mafia's builtin client).
 

zarqon

Well-known member
What's the difference between your CLI Box and the CLI that you can use to replace the Chat-frame on the left with the help of Mafia? That works just fine for me (but then granted I almost never use chat, and if I do I use Mafia's builtin client).

Assuming you mean right and not left (?), the differences are as follows:

1) You can use the CLI box without having to switch focus and regardless of what you're doing with your chat frame, even (or especially) if you haven't entered chat at all.
2) After writing the CLI box, I knew it existed.

And 3) is coming with the next update: the CLI box interacts with the Adventure Again info box. When you execute a CLI command, either by clicking a CLI link or entering something in the CLI box, the Adventure Again box refreshes, possibly with new info. For now, this will mainly be useful when setting or canceling goals via CLI links/box.

I can assume fairly safely that if I as a longtime mafia user didn't know it was possible to add the CLI to the chat frame, lots of other people wouldn't know about it either. For such users who choose to use BatMan RE, the CLI box is clearly documented in the first post.

In short: for great handiness.
 
I've been trying to use this, and I think I have the latest version of all the various requirements - but I'm getting an error when doing fights, "Unknown variable 'smack' (fight.ash, line 96)". My cursory searching of the thread didn't find anything... I'm running kolmafia head (now... r11038), and I'm happy to do whatever debugging is appropriate to work it out. :) My apologies if I'm missing something obvious/stupid...
 

Theraze

Active member
The variable (advevent) smack is defined in batbrain.ash, so make sure you have that and it should be in your script folder, not the relay folder.
 

zarqon

Well-known member
BatMan RE 1.4 Updates!

First, the big news:

In the interest of faster page loads, I completely restructured the script to AJAX in the table of options and the quick menu after the page loads in your browser. This means that fight.ash now serves the role that fight-preload.ash previously served. It loads the page, cleans some things up, links the jQuery and CSS files, and adds a placeholder div for the BatMan content. It doesn't even need to import BatBrain or SS, so its load time should be much faster.

Then, after the page loads in your browser (which happens basically just as fast as playing with no relay override), batman.js calls BatMan-RE.ash to fetch the actions table and the quick menu, and adds them to the page. This means all the BatBrain calculations start right after the page displays, and it also means a short delay between page load and having your options available. But since the delay would happen regardless, I thought this to be preferable; you get an indicator that the script is thinking, plus you can start thinking yourself in that <1 - 10 second wait.

Now, the small news:

  • I added an "Automate" menu. Click the circular arrows to hand the combat over to mafia (it calls run_combat()), just like the CAB's "Script" button.
  • I added more hotkeys. Now the left side of the top keyboard row [`12345] corresponds to the quick menu, so if three menu options are showing, they can be triggered by pressing `, 1, and 2, respectively.
  • I added a quick form for handily editing your unknown_ml setting and updating the actions table when you face monsters with unknown stats (such as certain individuals of the genus Entomursus).
  • The runaway button adds a repeat, since if you click Run Away you want to run away.
  • Check your is_100_run setting and enforce 100% runs prior to loading the page.
  • Adventure Again box: add quick links for checkpointed visits to Yossarian when you have acquired a tool.
  • Adventure Again box: quick links to use hand chalk and evil eyes when appropriate.
  • Adventure Again box: display banished monster information in Boriscore.

Enjoy!

NOTE WHEN UPDATING: After extracting the zip in your relay directory, you may freely delete fight-preload.ash, since it no longer exists as of this update.
 

Winterbay

Active member
Question: What happens with keyboard layouts where the `-button is not left of 12345 but instead somewhere else? Does the button now left of 1 (for me this is a §/½-button) work instead or would I need to press "Shift+´" (two steps to the right of the 0 on my keyboard) to get to that button?
 

zarqon

Well-known member
I'm not sure, but I can tell you how to fix it to your liking. The script checks the keyCode property of the keypress event, so if keycode 96 (line 156) isn't the correct number for the button to the left of your '1', uncomment batman.js line 154, at which point the script will annoyingly alert you with the keyCode every time you push a key. Use that to get the number you want and change line 156 to the new number. Then don't forget to delete or re-comment line 154.
 

zarqon

Well-known member
I don't have Chrome on any of my machines; and I've recently realized that my only WebKit-powered browser is the Android browser in my phone (where obviously I can't test it). So I'm afraid I'm not able to debug this at the moment.

You aren't pressing 0 when a form input has focus are you? Because those keypresses ought to be given to the form inputs rather than show the CLI Box.
 
Great script Zarqon, thanks for sharing. I'd like to make a suggestion for a simple modification.
I use BumcheekCity's BUMRATS master override, and when I find useful scripts, I incorporate them into it.

I've made a few small refactoring changes to the 3 .ash files and attached them at the end of this post. The scripts still work on their own, but also have functions that can be called from elsewhere (e.g. a master override).

I just moved the global code from adventure.ash and fight.ash into functions, and passed around the results buffer as a parameter rather than making it global.
I also renamed the main function in fight.ash and BatMAN_RE.ash, and created 1 line mains to replace them.

I'm making the suggestion for selfish reasons, in the hope I won't have to redo my modifications after each update. :)

Thanks again.
 

Attachments

  • batmanrelay.zip
    11.3 KB · Views: 38
Last edited:

Winterbay

Active member
I tried this out today, I did however have the cab active since I like that layout, so that may be part of my problem I guess but it appeared that every time I started an adventure (in any way), it ran 2 adventures and automated the first. Is this an effect of the cab or something else?
 
Top