BatMan Relay -- more info, less clicking

I love it! Except, when I click on again or adventure again, i'm getting 2 combats, the first one is automated w/ my ccs, the 2nd one loads the bat brain screen and lets me do combat manually. Not particularly ideal atm.

I'm getting the same behavior. I also got the version check problem. I downloaded the files from the first post this morning and while editing adventure.ash made the version check issue go away the other issue remains.
 
Last edited:
I'm getting the same behavior. I also got the version check problem. I downloaded the files from the first post this morning and while editing adventure.ash made the version check issue go away the other issue remains.

I pulled the adventure.ash file out of the relay directory, and it's no longer doing the 2 advs at a time thing.
 
Oh, I just noticed that I didn't update the adventure.ash version check after creating the placeholder, I only updated the fight.ash one. I was on the subway when I made my previous post earlier and couldn't check. Duh.

I think it would be exceptionally stupid for the first thing to bump the version number to be fixing the version number. I reject the concept entirely. I refuse it. It horrifies my mind. So I've just updated the first post without bumping the version number, despite the fact that one line of code in adventure.ash did in fact change. If this, in turn, horrifies you, I apologize. I tried to reconcile myself with version 1.1 being the version with a fixed version number, but I couldn't, I just couldn't.

I have no idea what the "two turns" thing is about, that has never happened for me. It's true that adventure.php gets redirected to fight.php when you have a combat, so both scripts get called, but that shouldn't cause any turns to get spent; it would just needlessly decorate a page which was never shown before following the redirect. Can anyone else with the problem confirm that it stops after deleting/renaming adventure.ash?

Optionally, does it stop when commenting out line 161 of BMR but retaining adventure.ash?

@lost: My computer is older than yours and I'm not seeing inconveniently slow loading times. Pages still generally load about as fast as I can think to click them. It may be that you think much faster than me, though. :)

In short, you are all having problems I don't have, so I'm really kind of at a loss as to how to help. I had tested this in three browsers over multiple runs (on that note -- does it work in Safari? I'm curious) and had thought it was pretty much ready to go. I feel sheepish.
 
I just tried it again, and it seems to be running fine. The difference between before and now is that I was in aftercore with nearly every skill in the game and all the disco bandit nemesis combos, and now I'm in a boris run with very limited options.
 
Optionally, does it stop when commenting out line 161 of BMR but retaining adventure.ash?

I'm sorry to be dense, but I don't know which file you are referring to as BMR. I don't see anything like that in your package.
The zip file contains:

fight.ash -- The script.
fight-preload.ash -- Necessary to load the combat prior to loading script libraries.
adventure.ash -- Maintains quick menu even for noncombats.
batman.css -- The stylesheet.
jquery1.7.1.min.js -- The minified jQuery library.
jquery.dataTables.min.js -- The minified DataTables jQuery plugin
batman.js -- Additional jQuery to make things awesome.

** I commented out 161 in fight.ash and restored adventure.ash and it still did the extra adventure. You can automate just fine, but if you click on any Again links in the browser it spends the extra adventure. So i put everything back the way I had it. It seems to be working fine w/o the adventure file. I'm using whatever the latest Firefox is with no greasemonkey.

I did notice that it's underestimating Mighty Axing damage dealt.
 
Last edited:
Sorry, BatMan Relay. That would refer to fight.ash, the main script.

Please don't report data bugs here unless they are errors in presentation -- those are BatBrain errors (although in this case, can you give me the formula so I can fix it? It wasn't known last I checked). One nice thing about this script is that it will be able to expose BatBrain's knowledge errors to a wider audience and hopefully get them fixed faster.
 
Hovering over the banana peel, it says "Stun with use 5560", which is rain-doh blue balls, and that's the only option it shows in the menu when I hover over that button. However, clicking on the button used my indigo cup (a complete waste when I'm not missing any HP), then cast Intimidating Bellow, then use Mighty Axing to kill the enemy (three clicks total). I think that's a bug.
 
Okay, that can justify bumping the version to 1.1. Fixed.

Also tracked down why Adventure Again doesn't appear when you have the KoL combat bar enabled, but that's yet another finished() issue, and I don't want to push out another BatBrain update quite yet. For now I'll have to recommend not using this and the KoL CAB at the same time. The one added by mafia seems to work fine, however.
 
Last edited:
Small issue
It doesn't account for elemental weakness it's showing heroic belch as a worse choice than cleave even when it would do more damage against the enemy i'm fighting

elemental.png
 
Not quite. It's showing Belch as an identical choice to Cleave, since they cost the same and both overkill the monster. Note the "Dealt" bit.
 
The damage shown by "Dealt" is capped by the monster's current HP. In your example, both Cleave and Heroic Belch have 195 damage dealt, because the monster only has 190 HP left (I guess the extra 5 is the HP variance).
 
Think I might have an answer on the sorting problem... maybe... :) Found this page on adding new sort types to jquery. You're needing to use html to make it strip the html tags, but want to use numeric instead of string, so it sorts numerically... and this page happens to have Numbers with HTML. Which strips the html tags, then does a numeric sort. I'll toy with adding this, but I think if I get it working, that will fix the weird sorting issues...

Edit: Adding this:
Code:
jQuery.fn.dataTableExt.oSort['num-html-asc']  = function(a,b) {
    var x = a.replace( /<.*?>/g, "" );
    var y = b.replace( /<.*?>/g, "" );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
};
 
jQuery.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) {
    var x = a.replace( /<.*?>/g, "" );
    var y = b.replace( /<.*?>/g, "" );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
};
and then turning the profit row to use it, like so:
Code:
           { "sType": "html", "aTargets": [ 1, 2, 3, 5, 6 ] },
           { "sType": "num-html", "aTargets": [ 7 ] },
           { "sType": "numeric", "aTargets": [ 8, 9, 10 ] },
makes it actually sort properly... well, unless it has commas. If something is REALLY good or REALLY bad, it only sorts to the first comma. So -1,254.67 is better than -3,156.87, but also better than -40, -80, and -132.63. Looks like we're going to need to combine this with a comma stripper on the sorting...

Edit2: And... done.
Code:
jQuery.fn.dataTableExt.oSort['formatted-num-html-asc']  = function(a,b) {
    var x = a.replace( /<.*?>/g, "" );
    var y = b.replace( /<.*?>/g, "" );
    x = x.match(/\d/) ? x.replace( /[^\d\-\.]/g, "" ) : 0;
    y = y.match(/\d/) ? y.replace( /[^\d\-\.]/g, "" ) : 0;
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
};
 
jQuery.fn.dataTableExt.oSort['formatted-num-html-desc'] = function(a,b) {
    var x = a.replace( /<.*?>/g, "" );
    var y = b.replace( /<.*?>/g, "" );
    x = x.match(/\d/) ? x.replace( /[^\d\-\.]/g, "" ) : 0;
    y = y.match(/\d/) ? y.replace( /[^\d\-\.]/g, "" ) : 0;
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
};
Use sType formatted-num-html for formatted numeric html code. :) Tested and verified as working on the profit column. To show this working, I've attached my batman.js. The profit column should now sort properly, the other columns are all still using the normal sorting code.
 

Attachments

Last edited:
Thanks Theraze! I started looking into custom sorts myself a while back and ended up deciding to save it for later when I felt like tackling something hard. Now I don't have to. :) That also works for the Deleveling columns, and if it could also ignore numbers inside parentheses, it would also work for the MP column. If you can add that in I think that would give us 1.2.

That just leaves Damage and HP, which would probably be more easily solved with more invisible "sort index" columns. Although since "Dealt: X" info is provided for any spread with non-physical damage, sort functions wouldn't be too hard (take the listed damage dealt, otherwise take the single float, ignoring parenthetical cost info). We could then even make the Damage sort multi-sort based on profit.

I momentarily toyed with the idea of making Damage sort by attack_action() descending and stasis_action() ascending, but while that would be cool, it probably wouldn't actually be the reason you were sorting by damage.

Isn't DataTables great? I love it.
 
Okay... added (, ), and + to the symbols that it will strip out for formatted numbers, and the updated batman.js is attached. Verified all the columns you'd mentioned (delevel attack, delevel defence, mp, and profit) sorts against the NS, just be aware that some columns have been told to only allow sorting one way and blanks will sort into the middle (as 0), so you might need to scroll down a bunch to see the good delevellers, etc. :)
 

Attachments

Ha, eeexcellent! Although I don't think that's quite it, since you need to also ignore the numbers within the ()'s. Otherwise, wouldn't something like "13 (4)" end up as 134?

Would duplicating the HTML-stripping lines work, changing the <>'s to ()'s?

I'm adding something needless and ridiculous to the script at the moment, once that's done we'll have us some 1.2.
 
I thought only damage and HP actually used numbers inside ()? Just finished running my last few turns of the day, so I can't validate anymore.
 
Here's what we need:

PHP:
function goodNum(n) {
   // TODO: if match (Dealt: (\d+)), return that number
    var res = n.replace( /<.*?>/g, "" );
   // TODO: perhaps as part of either the following or previous replace() calls, remove any parenthesized characters (including numbers)
    res = res.match(/\d/) ? res.replace( /[^\d\-\.]/g, "" ) : 0;
    return parseFloat(res);
}

If we could get that, it would work for damage, MP, deleveling, and profit. As written above, it is presently working for deleveling and profit. It also "works" for MP, but although it gets the right answer it doesn't arrive at that answer the right way. It's considering things like "100 (15)" to mean 10015, which ends up working since those parenthetical numbers only appear for MP gain in excess of your maximum. That would not work for damage, however, so we should fix it.
 
Oh right... my MP restoratives suck. :) Which is why they never had parenthetical numbers.

So... on those... would best results be grabbing the parenthetical number if it exists (for HP/MP) or using the full number and ignoring the other?
 
I did some more testing and even with everything cleared from my relay directory and a fresh download of BMR installed I'm still getting the adventure twice issue under the following circumstances:

- I enter a zone
- I click on the BMR hourglass icon
- I click on the adventure again URL

Any hints on what I should look for or change to help in tracking this down?
 
Back
Top