BatMan Relay -- more info, less clicking

zarqon

Well-known member
I just created an imgur account to upload images with which to enhance my first post. Then, I carefully edited my post using all the generated URLs. However, when I submitted the edit, I discovered that evidently this forum has a limit of 4 images per post? I had 13, which was a bit over the limit. Can any minions or admins give me more image power? Or should I figure out a different way to make my first post graphically informative?

@Theraze: perhaps you missed the TODO comments in my previous post.

@Magus: What browser are you using? Does it happen when you comment out this line from the main() function in fight.ash?

PHP:
   if (post contains "runcombat" && post["runcombat"] == "heckyes") results = run_combat();

So far the only clue I have is Winterbay saying it doesn't happen when you remove adventure.ash. Since it doesn't happen to me, I'm not really able to fix this without more information.
 

Magus_Prime

Well-known member
I'm using Mozilla Firefox 12.0 and when I comment out the line from fight.ash nothing changes. The character still adventures twice in certain circumstances. Once as if I were autoadventuring and then BMR takes over.
 

lostcalpolydude

Developer
Staff member
However, when I submitted the edit, I discovered that evidently this forum has a limit of 4 images per post? I had 13, which was a bit over the limit. Can any minions or admins give me more image power?

I'm pretty sure only fewyn can do anything about that.
 

StDoodle

Minion
Might be time for a wiki page! Ugh, if I had this thing called "free time" I'd get one started for you.
 

Theraze

Active member
I saw it, but I was trying to determine what exactly it meant. :) Whether it meant you DID want to sort by the number inside the parenthesis, or toss it out and just keep the full-sized number.
 
I've been using this for a few days now, and I'm not sure what functionality I'm missing from no adventure.ash, but the fight relay part sure is purdy (that's Texan for "pretty"). It's prompting me for flyers, id bang potions, stasising gremlins... just awesome.
 

xKiv

Active member
It also makes it painfully obvious when the page finishes loading into the browser (by jumping when the long table rolls into a scrollbarred pane).
(this is not a bad thing)
 

zarqon

Well-known member
If it's not that line (which is the only code in the script that would actually completely automate a combat), I suspect it's something to do with the relay browser's interaction with mafia for redirects, which means I could probably duplicate the problem in Firefox 12, if I felt like installing it just to possibly fix this.

Hmmm, actually my netbook running eeebuntu has some version of Firefox on it. I'll give that a shot and see if I can get the problem 1) to occur, and then 2) solved. I'm already giving only half-functionality to IE users, it would be nice if all the other major browsers could get the whole kit 'n' caboodle (Texan for "complete package").

Of course in Opera (which is objectively the best browser) everything works. :p Also, <political opinion>.

@xKiv: Before this was released, Theraze had suggested that the table not be visible until fully DataTable-ized. That would probably be smoother than the table getting loaded and then converted while visible. I didn't think to make that change because everything loads so fast for me in Opera that I don't notice anything of the sort. Since it is definitively the best browser, of course. Also, <religious proselytizing>.

@Weatherboy: Thanks for the encouragement -- I speak a little Texan myself, but I'm barely conversational in it. As another person with the 2-adventure issue, are you also a Firefox user? Have you considered switching to Opera? Or, Chrome has also become quite good -- I hear it scores the highest in every single test devised by Google. But Opera is best, not to mention <racial stereotyping>.

@lost: Alas. Well, it just means more time while I figure out how to make a single diagram containing all the stuff I want it to, rather than individual pics for each thing. I'm rubbish at computer graphics these days. I used to know my way around Paint Shop Pro way back at version 5 when it was Jasc, not Corel, but now only have the GIMP and never really used it. But it shouldn't be overwhelmingly hard so it'll still end up nice, I think.

@StDoodle: I don't think a Wiki page for this script is necessary, but one for BatBrain would be nice! It's settled down enough that I'd like to write up some proper documentation for the various functions/variables.
 

Paragon

Member
Fantastic work zarqon. I only wish that there were a way to 1) Not have the initial slide out effect, so the actbox would be clickable immediatly instead of waiting for it to finish it's animation. and 2) I really wish there were a way to still use the tilde button to repeat last action and adventure again... I really want to use the script as the information is immensely useful and laid out so nicely, but it just slows game play down so much to lose the tilde functionality... even if the tilde wasn't "repeat last action" but instead imitate clicking on the sword (use best action i guess?) it would be great.

For some unsolicited advice

if you add
Code:
actbox.append("\n<script>$(document).keydown(myHandleCombatHotkey);function myHandleCombatHotkey(kbdEvt){\nswitch (kbdEvt.which){case 192:$('#atkInput').click();break;}\n}\n</script>");

just after
buffer actbox;

and modify
Code:
// attack
      if (smack.id != "") {
         actbox.append("\n   <div class='onemenu'><form name='batattack' style='display: inline' action=fight.php method=post><input type=hidden name=action value='macro'>"+
           "<input type='hidden' name='macrotext' value='"+batround()+smack.id+"; call batround"+"'><input type=image[COLOR=#ff0000] id='atkInput'[/COLOR] src='images/itemimages/nicesword.gif' "+
           "title='"+smack.id+"' height=22 width=22 onclick='return killforms(this);'></form></div>\n<div class='popout'>");
         actbox.append(to_html(smack,0,true)+"<p><span id='attacksort' class='littlesort'><img src='images/itemimages/bgecalendar.gif'> Sort by attack_action()</span></div>");
      }

It will at least let the tilde trigger clicking the attack button...



Also, as a badmoon seal clubber... why is it selecting clobber as a better skill then attack with weapon? I am fighting creatures that will not be able to hit me, but it takes 2-3 rounds of clobber to do what 1 round of attack with weapon could do... oh wait... is it because of the possible fumbling i guess? See, that why I want to use the script I never would have even thought about that otherwise...

Fantastic work Zarqon
 
Last edited:

Paragon

Member
Also, you can edit
Code:
     // adventure again link, includes location info?
      actbox.append("\n   <div class='onemenu'>[COLOR=#ff0000]<form name='batstasis' style='display: inline' action='"+to_url(my_location())+"' method=post> "+[/COLOR]
[COLOR=#ff0000]      "<input type=image id='atkInput' [/COLOR]src='../images/itemimages/hourglass.gif' height=22 width=22 border=0 [COLOR=#ff0000]onclick =$('#batstasis').submit();></form>[/COLOR]</div>"+
to adventure again on tilde
 

zarqon

Well-known member
Awesome ideas Paragon! Thanks also for providing some code to get me started!

I do want this script to stack in some way with both the KoL and mafia combat bars, despite the fact that it duplicates most of their functionality. Whether that means overriding their default functionality with "improved" functionality, or staying out of the way. Since I don't use either bar, I'm not sure what would best yet. What you suggest appears to override (or maybe conflict with) one of the existing bars.

We could do one better using jQuery and attach the event handler to the first form in actbox, meaning that the button would always work to submit whatever the top menu item is. And if we're going that way, we may as well also make a key correspond to each menu item.

Can we use regular letters? If not, should we use numbers or F keys -- overwriting the default hotkey actions with BatMan ones? I'll give this more thought, but of course in the meantime additional suggestions and opinions on how to integrate hotkeys would be appreciated.
 

StDoodle

Minion
Well, you could put it all on one page. Or do similar to Sally's guide and have an intro page with separate pages for the relay script info. Whatever adds buoyancy to your naval vessel. ;) But if we gave you some admin powers you'd be able to post images willy-nilly, which Bale can tell you helps with "how-to" guides.
 

Paragon

Member
I think regular keys would be the best since you mentioned keys for each menu item, and it would be a good idea to avoid overlapping hot keys. It would be perfect to have a hot key for the use once, and the spam repeatedly versions... the space bar might be a good candidate also? Or the numpad if it is possible to differentiate those keys from the number row keys...
 

xKiv

Active member
Can we use regular letters? If not, should we use numbers or F keys -- overwriting the default hotkey actions with BatMan ones? I'll give this more thought, but of course in the meantime additional suggestions and opinions on how to integrate hotkeys would be appreciated.

Please don't, and / too. Sometimes chat defocuses inappropriately and this would result in embarassing "misclicks".
 

Theraze

Active member
Yeah... avoiding regular characters would be nice, since that might cause some major problems with the chat and gCLI.
 

zarqon

Well-known member
What does that leave? We can't use F-keys or CTRL+letters, since those are used by the browsers themselves. It looks like the top row (` and numbers) is the best bet for adding hotkeys, but we'd want to disable them if they were already being used by an existing combat bar, unless our functionality is unequivocally superior. I'm a complete combat bar neophyte -- what exactly does the tilde button do? Do hotkeys exist for both the KoL and the mafia action bars? Bah, research time.
 

lostcalpolydude

Developer
Staff member
Mafia sets serverAddsCustomCombat to true if the CAB is active, so there's an easy-ish way to add things only if they aren't already being used there.
 

seandamnit

New member
Playing around with this today - my only character with playable adventures way out levels everything, so I'm sure I haven't had a chance to experience the most our of this tool just yet, but this looks very nice.

One thing I noticed in the attack table that just about everything was at a negative profit - due of course to chance of getting hit and item costs - except some MP restorers like Dyspepsi-Cola. I had full MP at the time, so I'm not sure why this would show as a positive profit?

Also, does this take MP regen in to consideration when calculating MP costs of skills? Like if I had 6 MP regen per combat, would Cannon break even in the profit calculation? Would something like noodles come out as a net profit?
 

zarqon

Well-known 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).

The profit calculations for HP/MP presently appear to consider regeneration for gain but not loss. Profit for MP, for example, is calculated like so:

PHP:
minmax(a.mp,
       -my_stat("mp"),
       max(0, my_maxmp() - my_stat("mp") - 0.9*numeric_modifier("_spec","MP Regen Min"))) * meatpermp

a.mp is the total MP alteration from the action. In the case of the Actions Table, it also includes any MP gain/loss from familiar actions, monster actions, effects, gear, etc.

It has a lower limit of -(current MP) because you can't lose more MP than you have. Note that it does not increase this number towards 0 by the amount of "free" MP you have available. It probably should -- meaning with minimum MP regen of 4, a 5 MP skill will effectively reduce your profit by only 1 MP.

It has an upper limit of the amount of MP you can possibly gain minus 90% of your minimum MP regen value. If you have 5 MP out of a possible 10, but you have a minimum MP regen of 6, the upper limit will be 0, since any MP gain beyond 4 is worthless during combat, in terms of profit.

I think the 90% multiplier was added to try to help eliminate the Salve bug. It should probably be removed since we are already considering only MP Regen Min and not averaging it with Max. I'll make these changes for both HP and MP and see what happens. :)
 

zarqon

Well-known member
1.2 Updates

First, none of the fixes today will solve the problem of this script not playing nicely with the KoL CAB. That fix is in the next BatBrain, though, so whenever that's updated, this script should work no matter which action bars you have enabled or disabled. Until then, however, this script is not compatible with the KoL CAB.

"You suck Zarqon!" says a nearby script user. "We wanted awesome updates! That don't suck!"

Well, there are a few of those:

  • Fixed sorting as previously discussed. All columns other than HP now sort correctly. Managed to accomplish both of the TODO's in the incomplete function I posted previously, despite it being Javascript and regexes! Feeling proud. Big thanks/ups/propz/kudos/respeck to Theraze for instigating the idea and supplying the initial code, however. Without that I wouldn't have had a clue where to start!

  • When you are fighting evil, it's handy to have a mentor with you who knows everything. As if just having all the data that players have learned about each action available wasn't enough, the Bat menu now contains a juicy morsel of wisdom from Batman himself! Said morsel is often timely and appropriate for the situation at hand. Holy wisdom tidbits!

  • The stun menu now appears at much more appropriate times. Or rather, it no longer appears at so many inappropriate times.

"Those updates are okay!" yells the user, mollified. "They don't suck at all."

Thank you, user. By the way, this script is the reason I have just added all the tower items to SS's custom actions. Most people who automate and even a lot who don't use mafia's built-in tower helper, but if you ever do climb the tower in the relay browser using this script, it's a surprising pain not to have the item there in custom actions. So that will be part of the next SS update. Yay for this script getting updated piecemeal!
 
Top