Page 210 of 212 FirstFirst ... 110 160 200 208 209 210 211 212 LastLast
Results 2,091 to 2,100 of 2118

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

  1. #2091
    Senior Member
    Join Date
    Mar 2008
    Posts
    110

    Default

    Ahh, Therein lies the problem

    I got a new computer since the HD on my old one died. Before the HD totally died I copied my mafia file to dropbox. Apparently not all the files didn't download from dropbox.

    I actually got it working just after I posted. I found an older version of mafia and updated things with that.

    Thanks for the reply!

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

    Default

    Attention New-You questers!

    While we await mafia support for New-You quest tracking, I've added support for the quest to BatBrain and SS. It accesses four tracking properties to determine which spell to cast vs. which monster, and whether to attempt Olfaction vs. said monster. Also BatBrain increments your tracking property as you advance the quest. Once mafia tracks the quest, we can easily switch to using those properties.

    But for now, use this code to set the four properties SS needs to access to perform your action:

    PHP Code:
       monster fixedmon(string monstr) {
          if (
    to_monster(monstr) != $monster[none]) return to_monster(monstr);
          switch (
    monstr) {
             case 
    "Orcish Frat Boy": return $monster[orcish frat boy (music lover)];
          }
          return 
    $monster[none];
       }
       
    matcher m create_matcher("Looks like you've cast (.+?) during (\\d+) of the required (\\d+) encounters with  ?(?:a|an|some|the) (.+?)!"visit_url("questlog.php?which=1"));
       if (
    m.find()) {
          for 
    i from 0 to m.group_count() print(i+": "+m.group(i));
          
    monster target fixedmon(m.group(4));
          if (
    target == $monster[none]) abort("Unable to identify monster '"+m.group(4)+"'");
          
    set_property("_newYouMonster"target);
          
    set_property("_newYouSkill"m.group(1));
          
    set_property("_newYouSharpeningsCast"m.group(2));
          
    set_property("_newYouSharpeningsNeeded"m.group(3));
          foreach 
    l in $locations[] if (!l.nocombats) foreach mon,rate in appearance_rates(l) if (mon == target) print("Found in "+l+" with an appearance rate of "+rate);
       } else print(
    "Quest didn't match."); 
    I have this saved as a separate script, but you could also put it in your login script behind a check for eudora() == "New-You Club".

    Once running this code, the tracking properties will be set correctly, and adventuring in a location with the specified monster will automatically use the correct skill vs. the correct monster (and Olfact it if appropriate). This will work no matter how you encounter the monster, so it would also work throughout your adventuring day if you decided to Digitize the monster.

    The New-You quest can now be accomplished with

    PHP Code:
    while (get_property("_newYouSharpeningsCast").to_int() < get_property("_newYouSharpeningsNeeded").to_int())
       
    adventure(1,$location[place that has the monster]); 
    Enjoy!
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossnam | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer***ar***d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  3. #2093

    Default

    Hmm. So, I incorporated this into my version of NewYou.ash, but it doesn't seem to quite be working. The _newYouSharpeningsCast counter updates as expected, but then seems to get stuck at one fewer than the max:

    Code:
    Visit to Woods: Whitey's Grove in progress...
    
    [6796] Whitey's Grove
    Encounter: whitesnake
    Round 0: CrankyOne wins initiative!
    WHAM: Running SmartStasis
    Round 1: CrankyOne executes a macro!
    Round 1: CrankyOne casts SUMMON LOVE GNATS!
    Round 2: CrankyOne casts TANGO OF TERROR!
    WHAM: Starting evaluation and performing of attack
    WHAM: We are going to 1-shot with attack with your weapon.
    Round 3: CrankyOne executes a macro!
    Round 3: CrankyOne attacks!
    Round 4: CrankyOne wins the fight!
    After Battle: You gain 29 hit points
    After Battle: You gain 33 Mana Points
    You gain 49 Meat
    You acquire an item: white snake skin
    You acquire an item: bird rib
    After Battle: You gain 5 Fortitude
    After Battle: You gain 21 Mysteriousness
    After Battle: You gain 3 Smarm
    
    Post Adventure done, boop.
    New You progress: cast Tango of Terror 8 of 10 times against whitesnake at Whitey's Grove
    
    Visit to Woods: Whitey's Grove in progress...
    
    [6797] Whitey's Grove
    Encounter: white chocolate golem
    Round 0: CrankyOne wins initiative!
    WHAM: Running SmartStasis
    WHAM: Starting evaluation and performing of attack
    WHAM: We are going to 1-shot with Thrust-Smack.
    Round 1: CrankyOne executes a macro!
    Round 1: CrankyOne casts THRUST-SMACK!
    Round 2: CrankyOne wins the fight!
    After Battle: You gain 35 hit points
    After Battle: You gain 25 Mana Points
    You acquire an item: white chocolate chips
    After Battle: You gain 6 Muscleboundness
    After Battle: You gain 21 Mysteriousness
    
    Post Adventure done, boop.
    New You progress: cast Tango of Terror 8 of 10 times against whitesnake at Whitey's Grove
    
    Visit to Woods: Whitey's Grove in progress...
    
    [6798] Whitey's Grove
    Encounter: whitesnake
    Round 0: CrankyOne wins initiative!
    WHAM: Running SmartStasis
    Round 1: CrankyOne executes a macro!
    Round 1: CrankyOne casts SUMMON LOVE GNATS!
    Round 2: CrankyOne casts TANGO OF TERROR!
    WHAM: Starting evaluation and performing of attack
    WHAM: We are going to 1-shot with attack with your weapon.
    Round 3: CrankyOne executes a macro!
    Round 3: CrankyOne attacks!
    Round 4: CrankyOne wins the fight!
    After Battle: You gain 22 hit points
    After Battle: You gain 33 Mana Points
    You gain 54 Meat
    You acquire an item: bird rib
    After Battle: You gain 3 Muscleboundness
    After Battle: You gain 23 Wizardliness
    After Battle: You gain 3 Chutzpah
    You gain a Moxie point!
    
    Post Adventure done, boop.
    New You progress: cast Tango of Terror 9 of 10 times against whitesnake at Whitey's Grove
    
    Visit to Woods: Whitey's Grove in progress...
    
    [6799] Whitey's Grove
    Encounter: whitesnake
    Round 0: CrankyOne wins initiative!
    WHAM: Running SmartStasis
    Round 1: CrankyOne executes a macro!
    Round 1: CrankyOne casts SUMMON LOVE GNATS!
    Round 2: CrankyOne casts TANGO OF TERROR!
    WHAM: Starting evaluation and performing of attack
    WHAM: We are going to 1-shot with attack with your weapon.
    Round 3: CrankyOne executes a macro!
    Round 3: CrankyOne attacks!
    Round 4: CrankyOne wins the fight!
    After Battle: You gain 24 hit points
    After Battle: You gain 24 Mana Points
    You gain 49 Meat
    You acquire an item: white snake skin
    After Battle: You gain 4 Beefiness
    After Battle: You gain 18 Magicalness
    After Battle: You gain 5 Roguishness
    
    Post Adventure done, boop.
    New You progress: cast Tango of Terror 9 of 10 times against whitesnake at Whitey's Grove
    Here's the code that's directing that:
    Code:
    	while (get_property("_newYouSharpeningsCast").to_int() < get_property("_newYouSharpeningsNeeded").to_int()) {
    		boolean success = adventure(1,_loc_NewYou);
    
    		string msg = "New You progress: cast " + _sk_NewYou + " " + get_property("_newYouSharpeningsCast") + " of ";
    		msg = msg + get_property("_newYouSharpeningsNeeded") + " times against " + _mon_NewYou + " at " + _loc_NewYou;
    		print(msg, "blue");
    
    		// A location can become unavailable mid-adventure (if, for example, your location is McMillicancuddy's Farm)
    		if (!success)
    			abort("Could not adventure at " + _loc_NewYou);
    	}
    It looks like something's causing BatBrain to not update the variables correctly on the last iteration. Thoughts?

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

    Default

    At such a low verbosity that output doesn't give any clues for what's happening in the fights (like being able to see the quest messages being tracked), but your print output after the fights at least allowed me to find the error. I had carelessly released some dangerous wild regex characters into a contains_text() check without thinking! Should be fixed in r107.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossnam | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer***ar***d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  5. #2095

    Default

    At such a low verbosity that output doesn't give any clues for what's happening in the fights (like being able to see the quest messages being tracked), but your print output after the fights at least allowed me to find the error. I had carelessly released some dangerous wild regex characters into a contains_text() check without thinking! Should be fixed in r107.
    Originally Posted by zarqon View Post
    Thanks much! Sorry about the low verbosity -- by the time I saw the problem, the quest was already done for the day and I couldn't jack up the verbosity and try again.

  6. #2096

    Default

    Interesting. The fix seems to have been a little overzealous -- it's now overshooting by one. Still, that's a much less quest-breaking bug than undershooting. Either way, here's what I'm seeing now, same code as last time:

    Code:
    [7209] South of the Border
    Encounter: La Farmacia de Sue?os
    You acquire an item: Meleegra? pills
    
    Post Adventure done, boop.
    New You progress: cast Salsaball 7 of 8 times against handsome mariachi at South of the Border
    
    Visit to Beach: South of the Border in progress...
    
    [7210] South of the Border
    Encounter: handsome mariachi
    Round 0: CrankyOne wins initiative!
    WHAM: Running SmartStasis
    Round 1: CrankyOne executes a macro!
    Round 1: CrankyOne casts SUMMON LOVE GNATS!
    Round 2: CrankyOne casts SALSABALL!
    WHAM: Starting evaluation and performing of attack
    WHAM: We are going to 1-shot with attack with your weapon.
    Round 3: CrankyOne executes a macro!
    Round 3: CrankyOne attacks!
    Round 4: CrankyOne wins the fight!
    After Battle: You gain 29 hit points
    After Battle: You gain 42 Mana Points
    You gain 12 Meat
    You acquire an item: bottle of tequila
    You acquire an item: handsomeness potion
    After Battle: You gain 2 Beefiness
    After Battle: You gain 19 Enchantedness
    After Battle: You gain 4 Sarcasm
    
    Post Adventure done, boop.
    New You progress: cast Salsaball 9 of 8 times against handsome mariachi at South of the Border
    Your saw is so sharp!
    Requests complete.

  7. #2097
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,511

    Default

    Looks like BatBrain may have been running more than once on the same page text. I've just changed it to a method that -- if your properties are set beforehand correctly -- won't care how many times it checks a given page. If your properties aren't set, it'll keep adding 1, even if that means overshooting.

    Also, coandco's New-You 2 script has brought to light a conflict that can occur where you may have multiple attraction targets in a single zone. You may even be on a bounty hunt in a zone that also has your New-You quest monster, with a different monster set to be automatically olfacted in your BatMan_attract setting! In that case, which one takes priority? I see three options:

    1) Print a red message (without aborting) letting you know you have multiple valid attraction targets in your current zone. Attentive users can then adjust the configuration as they like, or leave things as they are and end up olfacting the first one that comes along (current behavior). Upside: we don't presume to make that important decision for you. Downside: inattentive users may end up olfacting the wrong monster, significantly extending a quest (odds are, the quest they wanted prioritized).

    b) Prioritizing your New-You quest monster. If your quest properties are set (which at present, must be deliberate) and you're adventuring in the quest zone, chances are high you will save more turns by olfacting the quest monster than you would another monster in the zone. Upside: always speeds up the quest you're probably on. Downside: users who don't care strongly about completing the New-You quest (probably anyone who already has the skill) may set the properties as part of logging in, with the idea that they may be able to opportunistically complete the quest as they go about their regular day, but still prefer that SS olfact the monster they have specified.

    III) Not olfacting any monsters until only one target remains. Olfacting one target will drastically reduce the likelihood of encountering the second target, so wait until there's only one monster to attract. Upside: fastest multiple-quest completion. Downside: we don't know when the reason for olfacting your non-New-You quest target is satisfied, so there will always be multiple targets until the New-You quest is done.

    My BatMan_attract setting looks like this at present:

    dairy goat, Knott Yeti, violent fungus, dirty old lihc, unemployed knob goblin, giant man-eating shark, desperate gold farmer, mutated alielephant, pine bat, Mer-kin monitor, Skinflute, writing desk, Mob Penguin entrepreneur, angry tourist, anesthesiologist bugbear, creepy eye-stalk tentacle monster, angry mushroom guy, gamblin' man, possessed wine rack, endless winter, pygmy shaman, tomb rat

    (Incidentally, it looks like I can remove several of those now.) But the rest of them either speed up quests or maximize my item/meat results in a zone. In the latter case I'd prefer if the New-You monster were Olfacted instead, but in the former case I'd prefer if no monster were olfacted, so that I could accomplish both goals at once. After completing either quest, I'd olfact the remaining monster.

    This all makes me lean towards option III, but it would require adding conditionals for specific monsters in SS, i.e. only olfacting dairy goats if you need the quest cheese. Some feedback from the community would be most helpful in figuring out what to do here: which monsters do you regularly olfact, and why?

    For me:

    • dairy goat: quest cheese
    • violent fungus: amino acids for quest
    • dirty old lihc: faster Evil reduction
    • unemployed knob goblin: beer lenses
    • giant man-eating shark: more harmless than other monsters in zone
    • writing desk: speed up quest completion
    • anesthesiologist bugbear: speed up clearing the Medbay
    • creepy eye-stalk tentacle monster: speed up getting the bugbear communicator badge
    • angry mushroom guy: speed up Nemesis quest
    • possessed wine rack: speed up getting the bottle of Chateau de Vinegar
    • pygmy shaman: hopefully get Thrice-Cursed before the first choiceadv
    • tomb rat: speed up getting tomb ratchets for finding Ed

    • desperate gold farmer: maximize gold piece drops
    • gamblin' man: maximize Chroner from playing cards
    • mutated alielephant: maximize lunar isotope drops
    • Mer-kin monitor: maximize cheatsheets
    • Skinflute: maximize star/line drops
    • angry tourist: maximize meat drops
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossnam | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer***ar***d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  8. #2098
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    808

    Default

    angry tourist: maximize meat drops
    Originally Posted by zarqon View Post
    Why not the garbage tourist for max bag of park garbage?

  9. #2099
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,054

    Default

    I let scripts manage olfaction for me in most cases. One character doesn't have the skill yet, one character lets Veracity's Meat Farming script make the choice and one character needs to start using WHAM (or SmartSmack) again before this is relevant. That character is in Never-Ascended Aftercore so olfactions that make quests easier are not relevant.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  10. #2100
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,741

    Default

    My usual olfaction target is just "goals" so that if I have a goal set, SS can automatically figure out who in the zone is the best for that. Not optimal, but it's dynamic at least.

Similar Threads

  1. Feature - Implemented random_attributes not being passed to consult scripts
    By DoctorRotelle in forum Bug Reports
    Replies: 7
    Last Post: 05-25-2015, 04:38 AM
  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
  •