Page 220 of 221 FirstFirst ... 120 170 210 218 219 220 221 LastLast
Results 2,191 to 2,200 of 2201

Thread: BatBrain -- a central nervous system for consult scripts

  1. #2191
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,936

    Default

    Well, I broke it. Seems only fair that I should fix it.

  2. #2192
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Default

    Well, I broke it. Seems only fair that I should fix it.
    Originally Posted by Veracity View Post
    You're still awesome.
    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!

  3. #2193
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Default

    r132 adds basic Plumber support. Besides blacklisting "attack", each Plumber skill should also now contain the proper results for its current tier, which should also be set correctly in BatBrain. I'm just starting my first run so this is mostly untested. I am aware of two problems already:

    1) I had to guess what the possible costume names were for the costume property when setting the tier. If any of my guesses were wrong, you won't be able to reach tier 3 according to BatBrain.
    b) Happenings tracking is wrong because mafia defaults to the Passive version of the skill when to_skill()-ing the message from the session log. This also confuses/renders useless the "submit previous fight again" macro button in BatMan RE.

    The first is easily enough fixed if someone tells me what the canonical values are, or I figure them all out myself eventually (EDIT: Just got a costume; looks like they're all stat names? Convenient). The latter is less easily fixed and would probably require a feature request -- either to use [1234]this sort of name in the session logs, or adding a version of to_skill() to ASH where you can specify a preference for lower-number matches.
    Last edited by zarqon; 03-23-2020 at 07:29 PM.
    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!

  4. #2194

    Default

    The first is easily enough fixed if someone tells me what the canonical values are, or I figure them all out myself eventually.
    Originally Posted by zarqon View Post
    Quickly checking the code (mafia and yours), it seems your first guess wasn't right. Carpenter is "muscle", gardener is "mysticality", ballerina is "moxie" otherwise "none".

  5. #2195

    Default

    I could prefix an [id] easily enough to skills in the session log, but perhaps some might find that overly chatty? Seems fine to me though.

  6. #2196
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,936

    Default

    II think I'd prefer something like

    skill to_combat_skill( string )

    SkillDatabase.getCombatSkill( String ) will do it.

    Or even

    skill to_skill( string, type )

    Internal types, which can be used to filter skills in SkillDatabase.getSkillsByType:

    CASTABLE
    COMBAT
    REMEDY
    PASSIVE

    (each of which combines multiple subtypes) or

    SUMMON
    SELF_ONLY
    BUFF
    SONG
    EXPRESSION
    WALK
    COMBAT_NONCOMBAT_REMEDY
    Last edited by Veracity; 03-23-2020 at 07:21 PM.

  7. #2197

    Default

    I just (r19905) added something that I've wanted for ages that would pave the way for a workaround for issues like this. cli_execute_output will give you the results of a cli_execute as a string, which I've seen lots of people asking about before. It's not foolproof of course, because you might trigger some output to the RequestLogger that isn't directly related to your command, but it can be useful.

    Here you could have then done

    Code:
    cli_execute_output(`test skillids {skillName}`);
    then parse the output and loop through the ids for the one you wanted. Of course, Veracity's solution in this particular case would be a lot better.

  8. #2198
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,936

    Default

    I will also point out that you can easily create your own list of just combat skills.

    Code:
    typedef skill [string] skill_name_map;
    
    skill_name_map buff;
    skill_name_map combat;
    skill_name_map expression;
    skill_name_map passive;
    skill_name_map song;
    skill_name_map summon;
    skill_name_map walk;
    
    foreach sk in $skills[] {
        if ( sk.buff )
    	buff[sk.name] = sk;
        if ( sk.combat )
    	combat[sk.name] = sk;
        if ( sk.expression )
    	expression[sk.name] = sk;
        if ( sk.passive )
    	passive[sk.name] = sk;
        if ( sk.song )
    	song[sk.name] = sk;
        if ( sk.summon )
    	summon[sk.name] = sk;
        if ( sk.walk )
    	walk[sk.name] = sk;
    }
    
    print( `There are {count(buff)} buffs` );
    print( `There are {count(combat)} combat skills` );
    print( `There are {count(expression)} expressions` );
    print( `There are {count(passive)} passive skills` );
    print( `There are {count(song)} songs` );
    print( `There are {count(summon)} summoning skills` );
    print( `There are {count(walk)} walk skills` );
    yields

    Code:
    > skills_by_type
    
    There are 47 buffs
    There are 504 combat skills
    There are 16 expressions
    There are 403 passive skills
    There are 11 songs
    There are 57 summoning skills
    There are 3 walk skills
    You can use the "combat" map to take a skill name from the session log and get the skill object.
    Last edited by Veracity; 03-23-2020 at 07:55 PM.

  9. #2199
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Default

    I will also point out that you can easily create your own list of just combat skills.
    Originally Posted by Veracity View Post
    This is quite true. What makes me hesitant to do it this way is that foreaching $skills[] and a handful of map lookups every round of every combat is a good bit more expensive in terms of processing time. "It's too slow" is probably the biggest drawback/criticism of BatBrain, and I've been over the script repeatedly with the profiler to try to make it faster, using static variables where I can, caching parsed information to avoid parsing it every time, etc. and it still is noticeably slower than most other methods of combat automation. I can do what you're suggesting but I'd really prefer a solution that didn't add quite so much to the runtime, if possible.

    I think I'd prefer something like

    skill to_combat_skill( string )

    SkillDatabase.getCombatSkill( String ) will do it.
    Originally Posted by Veracity View Post
    That would be excellent.

    @gausie: I missed your adding cli_execute_output(). I think that's been brought up over the years numerous times; cheers on implementing it! Your solution provides a nice lateral-thinking hack if a pure data approach is unavailable or too sluggish.
    Last edited by zarqon; 03-24-2020 at 12:39 PM.
    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!

  10. #2200
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,936

    Default

    This is quite true. What makes me hesitant to do it this way is that foreaching $skills[] and a handful of map lookups every round of every combat is a good bit more expensive in terms of processing time.
    Originally Posted by zarqon View Post
    No. Make those maps static and initialize them in a static block. They will be initialized the first time the script is run. You can access them forevermore with no additional overhead.

    That said, KoLmafia has those maps built in, so perhaps the "to_skill( name, type )" solution would be best.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Similar Threads

  1. Feature - Implemented random_attributes not being passed to consult scripts
    By DoctorRotelle in forum Bug Reports
    Replies: 9
    Last Post: 02-07-2019, 01:53 PM
  2. Replies: 25
    Last Post: 04-05-2015, 07:20 PM
  3. Feature - Implemented Duplicate scripts cause "not found" error for consult scripts
    By nightslide in forum Bug Reports
    Replies: 6
    Last Post: 06-10-2013, 07:07 PM
  4. Multiple consult scripts?
    By fxer in forum Scripting Discussion
    Replies: 2
    Last Post: 03-04-2013, 08:43 PM
  5. Passing variables to consult scripts from the ccs
    By Captain Kirk in forum Custom Combat Settings
    Replies: 0
    Last Post: 08-17-2008, 05:53 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
  •