Page 4 of 31 FirstFirst ... 2 3 4 5 6 14 ... LastLast
Results 31 to 40 of 309

Thread: BatMan Relay -- more info, less clicking

  1. #31
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,685

    Default

    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.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  2. #32
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,510

    Default

    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).
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

  3. #33
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,751

    Default

    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.
    Attached Files
    Last edited by Theraze; 04-30-2012 at 04:49 AM.

  4. #34
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,685

    Default

    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.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  5. #35
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,751

    Default

    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.
    Attached Files

  6. #36
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,685

    Default

    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.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  7. #37
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,751

    Default

    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.

  8. #38
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,685

    Default

    Here's what we need:

    PHP Code:
    function goodNum(n) {
       
    // TODO: if match (Dealt:&nbsp;(\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.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  9. #39
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,751

    Default

    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?

  10. #40
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,094

    Default

    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?

Similar Threads

  1. Replies: 2
    Last Post: 10-06-2014, 08:42 PM
  2. Replies: 9
    Last Post: 06-01-2011, 11:08 PM
  3. StDoodle's Gum Master (relay Info Script)
    By StDoodle in forum Informational Scripts
    Replies: 0
    Last Post: 02-03-2011, 12:28 AM
  4. Info Request: Relay Overrides & fight.php
    By StDoodle in forum Scripting Discussion
    Replies: 2
    Last Post: 11-17-2010, 03:03 PM
  5. 7633 - When KoL has timed you out, clicking in the Relay ...
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 09-19-2009, 03:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •