Page 1 of 186 1 2 3 11 51 101 ... LastLast
Results 1 to 10 of 1853

Thread: SmartStasis -- a complex script for a simple CCS

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

    Lightbulb SmartStasis -- a complex script for a simple CCS

    SmartStasis

    What is it?

    SmartStasis handles basically everything you might want to do in combat other than actually kill the monster (although in a few special cases it will also do that). Once it's done with all that, it will hand the combat off to the next stage of your CCS in time for you to finish off the monster.

    The script assumes two categories for all actions available to you in combat:

    Custom actions. These are special actions, not necessarily profitable according to the script's logic, which should be done sometime before the end of combat, usually due to something highly situational or user-specified.
    Regular actions such as attacking, jiggling, spellcasting, itemslinging, etc.

    This script is designed to execute the first category smartly, and to prolong combat using actions from either category if it decides that stasising is called for (note the overlap).

    So, below is the nitty-gritty. All of the user-configurable script settings (mentioned in this teletype font) can be adjusted by typing "zlib settingname = value" in the CLI. Type "zlib vars" in the CLI to see the current values or to grab a convenient copypasta. These values will not change when updating the script (handy!), nor by editing it.

    Custom Actions Handled by SS

    • Pickpocketing if you're in the clear and/or if you could acquire a goal (twice if possible).
    • Stealing accordions where applicable.
    • Mug for the Audience: SS will generally try to keep you in Love rather than Hate, unless you still need to Incite a Riot for the day (and you've already Thrown a Party, if applicable). That means that although it will still pickpocket for goals, for other monsters it will Mug unless you are at full Love already.
    • Using Olfaction (or analogous skills) on the monsters you specify in BatMan_attract, as well as bounty monsters when you are on a bounty hunt! If you are on a hunt, Olfaction will ignore BatMan_attract monsters in the bounty location, only olfacting bounty monsters. Outside of the bounty location, specified monsters will still be olfacted. Puttying will also take place against bounty monsters for bounties requiring up to BatMan_puttybountiesupto items (default is 19). For puttying to be effective, you also need something that will fight your spooky putty monster after creating it. I recommend the Best Between Battle Script Ever!
    • Puttying bounty monsters (for bounties requiring at most BatMan_puttybountiesupto items). Also, both Olfaction and puttying are sensitive to mafia's one-time olfaction/putty combat settings, so including "special action" in your CCS is unnecessary. Note: any action that copies a monster (i.e. 4-d cameras) is considered when looking to putty.
    • Using Yellow Ray type actions against any monster specified in BatMan_yellow.
    • Using a banishing action (like Batter Up!, Creepy Grin, a tennis ball, etc.) on the monsters you specify in BatMan_banish.
    • Casting Summon Mayfly Swarm if the script determines it's desirable.
    • Casting Siphon Spirits if the resultant drink provides you with some mainstat and is an appropriate level.
    • Salving yourself for some safe HP gain if you need it or it's better than your out-of-combat restore options.
    • Using the Big Book of Pirate Insults (or Manual of Marauder Mockery) on pirates if you still need insults.
    • Using spooky putty (or analogue) on lobsterfrogmen if you haven't completed that sidequest yet.
    • Using specific items against the mini-bosses in the Cyrpt.
    • Throwing clumsiness bark at The Thorax and The Bat in the Spats.
    • Throwing jars full of wind at Thug 1 and Thug 2.
    • Throwing dangerous jerkcicles at Mammon the Elephant and The Large-Bellied Snitch.
    • Throwing flyers at everything you can if you have flyers (if BatMan_flyereverything is true).
    • Throwing a disposable instant camera at Bob Racecar (or Racecar Bob) to get your photograph of a dog.
    • Always throwing flyers and/or hand mirrors against the Guy Made of Bees.
    • Always throwing flyers and/or yet-unthrown base pairs at Cyrus the Virus.
    • Throwing meat vortices at thieving brigands.
    • Throwing opium grenades at pairs of burnouts.
    • Throwing skate decoys at groupers/urchins to get goal familiars.
    • Throwing cocktail napkins to drive away clingy pirates if clingfilm items are not goals.
    • Throwing the beehive and electric boning knife at the appropriate tower monsters.
    • Throwing useful punchcard combinations at monsters in the El Vibrato portal. It should be possible now to automate this zone.
    • Identifying unknown bang potions (transparent with the mafia setting).
    • Learning unknown Rave Combos.
    • Releasing the Boots! to get paste whenever your stomping boots are at full charge (and the monster doesn't give boring gooey paste).
    • Throwing quantum nanopolymer spider webs at bugbear scientists.
    • Throwing drone self-destruct chips at liquid metal bugbears.
    • Appropriately throw utensils in A Kitchen Drawer to gain the effect specified in BatMan_pretentioustarget (default is My Breakfast with Andrea).
    • Tunnel Upward or Downward in the case that your goal is a climate colada or digital underground potion.
    • Disco combos! SS will cast disco combos where profitable. It will also always cast Rave Steal if you're Outside the Club, and it won't cast Rave combos off-volcano until after you've vanquished your Nemesis.
    • Using lassos in the Sea to improve your lasso skill.
    • Throwing killscrolls and healscrolls to get dreadscroll clues when appropriate.
    • Throwing sea cowbells and a lasso at the wild seahorse.
    • Throwing complimentary refreshments to feed tourists in Dinseylandfill.
    • Using fingernail clippers on Weirdeaux creations.
    • Using tin snips to collect blood for Walford.


    Stasis Situations

    Under normal conditions, SS will stasis (use your most profitable low-damage action) if each round's expected profit meets or exceeds BatMan_profitforstasis (default 15.0). This profit is expressed as a meat value, but is really cumulative, including HP, MP, items gained, and other factors. Due to changes in your HP/MP, or familiars losing their ability to generate further meat/MP, the expected profit changes from round to round, and once it drops below the set value, the stasis loop is done. Unlike the pre-BatBrain version, SS does not check if you are in the clear before entering the stasis loop -- it simply considers your probable HP loss as a negative value.

    Some generally profitable situations which usually make SS decide to stasis:

    • Using a meat-producing familiar like the hobo monkey or NPZR.
    • Using an HP-restoring familiar such as the Cocoabo when you're low on HP.
    • Using an an MP-restoring familiar like the starfish.
    • Putting a familiar in your Crown of Thrones which restores HP/MP, produces meat, or drops an item.


    Additionally, there are some situations which will cause SS to attempt stasis regardless of profit:

    • If you have a molybdenum magnet and you are fighting gremlins, it will stasis until encountering the tool, then use the magnet (it will also exit stasis when encountering the "no tool" message).
    • If you have a Ruby Rod equipped and are fighting in the Seaside Megalopolis, it will stasis until the monster's elemental attack, then attack using the Ruby Rod, but only if you don't already have that particular disc.
    • If you have not learned the DB Nemesis dance skills, it will stasis the relevant monsters until they do their special move, then cast Gothy Handwave.
    • If you are fighting a hellseal pup and lack a seal tooth, it will stasis the pup until it cries out.
    • If you are fighting The Server, it will stasis until the panel falls off, then throw the strange goggles.
    • If you are fighting The Thorax, it will stasis until you defeat the monster.
    • If you are adventuring with a He-Boulder vs. a monster you have specified in BatMan_yellow, it will stasis until the yellow eye is showing, then use your major yellow ray.


    Additional Features

    • For all custom actions, if preceding that action with a stunning action would be more profitable, SS will do so, accounting for the fact that it's possible to funksling a single-round stunner with that action.
    • SS uses macros where possible to save server hits. Presently, this looks like a strange hybrid of consult/macro play, with chunks of actions being executed at once.
    • SS will automatically convert consecutive single item uses into a single funkslinging action where possible.
    • SS treats any unknown monster stat as being unknown_ml, rather than 0, for tweakable and more realistic results.


    Installation/Configuration

    • You can simply install this script by copying
      Code:
      svn checkout https://svn.code.sf.net/p/smartstasis/code
      into your CLI. This script depends on BatBrain.ash and ZLib, which will also be automatically installed if you don't already have them. Once these three scripts are installed, you may relocate them to a subfolder of your scripts directory if you like.
    • Since SS bases its decisions on overall profit, the value of HP and MP for your character is particularly important information. For this reason, I strongly recommend also configuring mafia to use Bale's Universal Recovery, since besides being the superior option for automatic HP/MP restoration, that script also calculates the value of HP and MP with far greater accuracy than this one. Bale and I have designed these scripts to play nicely together -- Bale's script outputs settings which are read by BatBrain to allow for much greater accuracy when calculating profit.
    • SS also needs to know accurate values for items, and since it can't search the mall in combat, it relies on the ASH function historical_price(). For best results, I also strongly recommend that you enable the "Share recent Mall price data with other users" option in mafia preferences. Leaving this unchecked may mean that you are using nonexistent (0) or very outdated prices for some items. Additionally, the aforementioned Best Between Battle Script will make sure your prices are up-to-date for all combat items in your possession before entering combat.
    • Include something like this in your custom combat script:

      [ default ]
      consult SmartStasis.ash
      attack

    • Make sure you have selected "custom combat script" for your battleAction.
    • ...
    • Profit!


    Changelog

    SmartStasis is on SourceForge and the changelog can be found here, though I will continue to post more detailed release notes in this thread. The pre-SourceForge changelog is in the following post.
    Last edited by zarqon; 01-07-2016 at 08:21 AM.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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!

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

    Lightbulb SmartStasis -- a complex script for a simple CCS

    Pre-SourceForge Changelog

    2.08.09 - ver. 1.0 posted, followed shortly by a couple fixes to the COMMENTS.
    3.12.09 - 1.1 changes: detect hobo monkey theft in FTF, not SmartStasis. This will ensure theft is always detected. Do not stasis Naughty Sorority Nurses. Only stasis gremlins if a tool is needed. For NPZR's and Cocoabos you can start attacking on the 9th round.
    4.07.09 - 1.2 changes: fix issue vs. gremlins where using combat healing skills caused endless loop.
    4.26.09 - 1.3 changes: added initial support for ghosts/hobos. FTF now has putty separate from use_special_item().
    4.30.09 - 1.4 changes: fix gremlins not being properly stasis'd when you are not in the clear.
    5.06.09 - 1.5 changes: works with latest FTF to provide proper support for hobo spirits, and poison removal that follows your combat setting. Detecting a used-up ghost still needs help -- so as of this version ghosts are permanently on for stasis. If you are weilding any haiku katana, cast Spring Raindrop Attack as part of stasis before trying restore skills.
    5.20.09 - 1.6 changes: works with the latest FTF to provide proper support for GGG's.
    6.09.09 - 1.7 changes: only stasis gremlins that may actually drop tools (untested). Keep up with changes to FTF.
    6.11.09 - 1.8 changes: handle stasising Seaside Megalopolis monsters. Added Consume Burrowgrub to restore skills used, but only if you will make full use of it.
    6.14.09 - 1.9 changes: moved a few things out -- now requires ZLib. Now has once-daily version checking. Improved stasis loop logic (no more loop-in-loop), removing several possible bug situations. Reorganized a bit to hopefully be independent from FTF changes, at least for a while.
    8.25.09 - 1.9.1 changes: added midget clownfish to MP-producing familiars.
    9.01.09 - 1.9.2 changes: added rock lobster to MP-producing familiars. Fixed bug with detecting 7-foot Dwarf Replicant's elemental attack/miss (after fighting about 10 of them without getting the dang essence disc).
    11.28.09 - 2.0 changes: fix a bug detecting stasis cutoff for MP. Move detection of gremlins/megalopolis monsters to FTF so they will be handled without fail. Add support for Disco Concentration, and fix formula for Disco Nirvana. Prefer dictionaries as they do 0 damage.
    12.06.09 - 2.1 changes: improved familiar support: added support for Stocking Mimic. Consider monster element for rock lobster and midget clownfish.
    12.30.09 - 2.2 changes: completely refactored familiar calculation to use formulas, thus improving speed and greatly improving accuracy AND reducing memory use! Add Snow Angels. Uses values of HP/MP set by Bale's Universal Recovery script to further increase accuracy, especially when calculating whether to cast disco combos. This also allowed me to add a "profitforstasis" variable. Use ZLib's new vprint().
    1.08.10 - 2.3 changes: adjust combo calculations based on refactored familiar calculations. Olfact if FTF determined you were supposed to but you didn't have enough MP. Include Static Shock as a restore option. Consider possible Bandersnatch bonus damage when calculating whether to cast disco combos.
    4.01.10 - 2.4 changes: add Rave combos. In fact, rework disco combos significantly.
    4.19.10 - 2.5 changes: slightly refactor DB combos to avoid an evil foreach error. Better DB combo profit calculations using item_drops_array(). Add support for more stasis familiars: Slimelings, Animated Macaroni Ducks, Adorable Seal Larvae, and Autonomous Disco Balls.
    4.25.10 - 2.6 changes: has_goal() now returns a float. Use better guestimates for Nemesis familiar weight.
    4.07.11 - 3.0 changes: the new BatBrain-powered SS goes online, to much fanfare and holladoodlin'. This version absorbs and thus obsoletes FTF. Far too many changes to list here (or remember, for that matter). It's a completely different kind of combat script altogether.
    4.17.11 - 3.1 changes: add familiar spentness detections to the repeat conditions of the stasis macro. Move all jump actions to custom actions -- stealing is now part of the custom actions macro. Initial support for post-SS noodling.
    4.24.11 - 3.2 changes: abort stasis properly for life-threatening huckleberries. Avoid Teleportitis. Use m rather than last_monster().
    5.02.11 - 3.3 changes: completely refactor DB combos to use BB's features. Additional combos besides the farming/stasis ones will be easy to add now as well. Yet again, BB drastically reduces the amount of code needed. Realized I hadn't gotten around to normalizing the ZLib settings which are lists of monsters, even though that functionality has been in ZLib for a long time.
    6.02.11 - 3.4 changes: don't stasis yourself to death. Prefer Marauder Manuals over Big Books. Solve annoying and seemingly inexplicable automation-stopping error (and added a few more high-verbosity debug statements in the process). Initial support for Summon Mayfly Swarm.
    6.15.11 - 3.5 changes: adjust to BatBrain round number changes.
    7.02.11 - 3.6 changes: don't try to Olfact in birdform. Be more permissive about HP/MP gain during the stasis macro (far fewer server hits for high-level farmers). Only try to Entangle if it will actually stun. Use BatBrain's new happenings tracking.
    10.21.11 - 3.7 changes: Haunted House changes! Use ghost trap vs. sexy sorority ghosts. Use mayfly bait and always try to steal in the Haunted House. Don't use bounty.txt anymore -- proxy records supply all our funky needs.
    11.30.11 - 3.8 changes: use BB's new attack_action() to determine your survivability rather than simply your attack, which should help in huckleberry situations where your regular attack is insufficient. The page variable is now global -- remove from parameters where necessary.
    12.01.11 - 3.9 changes: Fix to the last update: moved detection of unknown bang potions/spheres from BB into SS.
    12.09.11 - 3.10 changes: always try to steal in Lollipop Forest.
    1.15.12 - 3.11 changes: Re-add the check for the Unstoppable Banjo before trying Rave combos off-volcano. Make use of Release the Boots. Add stasis macro repeat conditions for Crown of Thrones. Speed: recognize when combat has ended and stop thinking.
    3.12.12 - 3.12 changes: Adapt to BatBrain's new format for advevents. Improved stomping logic. Avoid ID-ing bubbly potions in Beecore.
    3.31.12 - 3.14 changes: Where applicable, don't include custom actions that have already happened. Don't ID more than ceil(die_rounds/10) bang potions per fight. Properly add base pair event when fighting Cyrus. Refactor gremlin huckleberry detection a bit. Split the try_events() functions into enqueue_events() and try_events() functions. Use this to cast custom actions and combos in one server hit when not pickpocketing. Fix residual error detecting Gothy Handwave.
    4.29.12 - 3.15 changes: Important fixes to the server-hit-saving parts to fix a bug and keep you out of trouble. Move stasis loop conditions into separate function to allow access to other macro-building scripts. After calling sort functions, use the new global caches rather than declaring local variables.
    12.07.12 - 3.16 changes: Add tower monsters to custom actions. Throw some auto-killers at certain bugbears during Bugbear runs. Cast any preparatory stunning action rather than just Noodles. Adjust to monster name changes. Improve stomping logic.
    1.27.13 - 3.17 changes: Finally, support for black boxes and 4-d cameras as putty. Throw seal teeth at hellseal pups and treat them as huckleberries until they wail.
    1.31.13 - 3.18 changes: Monster damage is now a spread. Initial support for Siphon Spirits.
    5.8.13 - 3.19 changes: Names for phyla have changed (but names for pastes have not). More thoroughly flesh out Summon Mayfly logic. Bump required flyer amount to 100.5% to avoid possible shortage as per Bale's request. Set endscombat flag for custom actions in to_event() where possible. Don't stun before endscombat actions. Skip +items combos if you're going to yellow ray.
    5.29.13 - 3.20 changes: Optimize pirate insult logic using questM12Pirate setting (fixes a problem with insults in BIG! path).
    6.05.13 - 3.21 Contact! Treat BIG! like aftercore for siphoning spirits. Flyer the GMoB/Cyrus even if it kills you. Don't stun before a custom action if the stunner is the custom action.
    7.01.13 - 3.22 changes: SmartStasis is how hosted on SourceForge. Changes for this migratory update are detailed here.
    Last edited by zarqon; 07-20-2013 at 04:45 PM.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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. #3
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,268

    Default

    OH! Another nice one from you zarqon. Small "bug" though:

    # Have a suggestion to improve this script? Visit
    # http://kolmafia.us/index.php/topic,1739.html

    Somebody is a fan of copy/paste.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


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

    Default

    Haha! Well, that link links to the main page now... so in a way it kind of links here.

    Okay, I changed it. There was also another bad wording in one of the comments which I changed. But I didn't change the version number. If you find any more bugs in the comments, please continue to report them.
    Last edited by Bale; 04-21-2011 at 06:47 AM.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    23

    Default

    It doesn't appear to work if my hobo monkey steals the first round of combat. If this happens, it turtle-totems for 26 rounds, then starts attacking, instead of just attacking right away.

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

    Default

    @fuzzyevil: Good catch. The problem was that if the monkey stole while FTF was doing its thing, SmartStasis would have no idea about that. The fix involved editing both FTF and SmartStasis, so you'll have to download both of them again.

    A few other minor tweaks as well.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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!

  7. #7
    Junior Member
    Join Date
    Mar 2009
    Posts
    23

    Default

    @fuzzyevil: Good catch. The problem was that if the monkey stole while FTF was doing its thing, SmartStasis would have no idea about that. The fix involved editing both FTF and SmartStasis, so you'll have to download both of them again.

    A few other minor tweaks as well.
    Originally Posted by zarqon View Post
    Ah, thank you. That works now.

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

    Default

    2.1 Update

    Fought gremlins today on a character with Lasagna Bandages, and discovered that it would enter into a loop of healing as long as I had MP, without checking to see if the gremlin had or lacked the desired tool. Fixed that.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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!

  9. #9
    Junior Member
    Join Date
    Mar 2009
    Posts
    23

    Default

    I'm not sure if this is SmartStasis's doing, but I'm having a problem with lasagna bandages as well, and the new version of the script didn't fix it. When I win initiative, I'm automatically summoning a ghost (is that kolmafia or Smartstasis or FTF?). That isn't the problem though. After summoning the ghost, it automatically tries to use Lasagna Bandages, and it fails. The CLI says that it is redirected to a fight page, tells me I'm on my own, and puts up a Request Synch window.

    I think the problem is that some script or another is trying to use the "out-of-combat" version of Lasagna Bandages, but then can't, as I'm still fighting.

    EDIT: Another bit of relevant information: the error did not happen when my hobomonkey stole on the first round of combat.

    Scripts I am running:
    Bale's Universal Recovery
    FTF
    Smartstasis
    Kingdom of Loathing name: Goo Goo

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

    Default

    You are running an older version of First Things First. Re-download and your problem should be fixed.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********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!

Similar Threads

  1. Replies: 3
    Last Post: 09-15-2015, 04:34 PM
  2. Replies: 11
    Last Post: 01-25-2015, 11:27 AM
  3. Run a Complex Script for 'X' Turns - OCW, etc.
    By Raven434 in forum Community Support
    Replies: 5
    Last Post: 01-07-2010, 09:06 PM
  4. Help with Simple Script
    By skateboard34 in forum Community Support
    Replies: 6
    Last Post: 12-25-2008, 12:40 AM
  5. Simple (but trying to make it complex) breakfast script
    By Duffkiligan in forum Scripting Discussion
    Replies: 7
    Last Post: 02-08-2008, 07:09 PM

Posting Permissions

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