Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 26

Thread: MultiCAB - Show an extra Combat Action Bar

  1. #11
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    That was a very good reason. The script is now perfect for my uses.

    Thanks!

  2. #12
    Senior Member
    Join Date
    Jan 2011
    Posts
    498

    Default

    Thanks for providing the Bale HAX. That made this script so useful.

  3. #13

    Default

    Oh wow, wish this existed when I was doing leaderboard runs.

  4. #14

    Default

    Thanks, DCLS. Looks great. I just screencapped my action bars, installed it, and it didn't wipe anything out, so best of all worlds.

  5. #15
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    KoL broke this script! To fix it (and future-proof it against similar KoL-side changes in the future) I made the following change to my version:

    PHP Code:
    buffer addMultiCABbuffer result ) {
        
    matcher m create_matcher"actionbar\\.\\d+\\.js.*?</script>" result );
        if(
    m.find())
            
    result.insertm.end() , "<script src='MultiCAB.js'></script>" );
        return 
    result;


  6. #16

    Default

    You could have just tried updating it :P

  7. #17
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    Oh! Oh sorry.

    I forgot I don't have it on SVN and didn't think to check to see if you updated it! I'm so used to my script auto-updating that I forgot this one was different.

    (Because of my complicated fight.ash situation I just didn't want to deal with svn on this script.)

    Sorry.

  8. #18

    Default

    No worries. Your regex also handles future changes to the GET request section, so I'll probably merge that. And yeah, the problems inherent in dealing with multiple overrides for things like fight and choice are... problematic.

  9. #19
    Senior Member
    Join Date
    Jan 2011
    Posts
    498

    Default

    I've found a particular script called Batman_RE. Which looks useful and nifty. But I tried copying the addMultiCAB() function into the fight.ash that it creates:

    Code:
    buffer addMultiCAB( buffer result ) {
      matcher m = create_matcher( "actionbar\\.\\d+\\.js.+?<\\/script>" , result );
      if ( !m.find() ) return result;
      result.insert( m.end() , "<script src='MultiCAB.js'></script>" );
      return result;
    }
    And apparently, it's also expected that I modify the main function, as per the original post. Here's the batman_RE fight.ash main:

    Code:
    void main() {
       handle_post();
      // 100% run enforcement
       if (to_familiar(vars["is_100_run"]) != $familiar[none] && my_familiar() != to_familiar(vars["is_100_run"]))
          use_familiar(to_familiar(vars["is_100_run"]));
      // load the KoL page
       if (post contains "runcombat" && post["runcombat"] == "heckyes") results.append(run_combat());
        else results.append(visit_url());
      // enhance it
       add_features();
      // write it
       results.write();
    }
    here's my attempts to make it look like what (I think) you say the main should look like:

    Code:
    void main() {
       buffer page = visit_url();
       handle_post();
       page = page.addMultiCAB();
      // 100% run enforcement
       if (to_familiar(vars["is_100_run"]) != $familiar[none] && my_familiar() != to_familiar(vars["is_100_run"]))
          use_familiar(to_familiar(vars["is_100_run"]));
      // load the KoL page
       if (post contains "runcombat" && post["runcombat"] == "heckyes") results.append(run_combat());
        else results.append(visit_url());
    
      // enhance it
       add_features();  
      // write it
       results.write();
     page.write();
    }
    apparently I broke something as this is what I get:

    https://prntscr.com/aoq18y

    So, obviously I'm doing something wrong. What can I do to the batman_RE fight.ash script to make multicab work, or is this a losing battle?

  10. #20
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    I don't use Batman_RE and I haven't looked at the code to see how it actually handles things, but results is probably a global variable containing the page's html data, so I'd try this...

    Code:
    void main() {
       handle_post();
      // 100% run enforcement
       if (to_familiar(vars["is_100_run"]) != $familiar[none] && my_familiar() != to_familiar(vars["is_100_run"]))
          use_familiar(to_familiar(vars["is_100_run"]));
      // load the KoL page
       if (post contains "runcombat" && post["runcombat"] == "heckyes") results.append(run_combat());
        else results.append(visit_url());
      // enhance it
       add_features();
      // MuiltiCAB
       results = addMultiCAB(results);
      // write it
       results.write();
    }

Posting Permissions

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