SmartStasis -- a complex script for a simple CCS

fxer

Member
Has anyone else tried using Romantic Arrows with smartstasis/batbrain? Mafia still aborts for me as in this post: http://kolmafia.us/showthread.php?1...for-a-simple-CCS&p=98069&viewfull=1#post98069

Here's the output on verbosity 9 from just now, against a clod hopper:
Code:
Round 2: fxer casts FIRE A BADLY ROMANTIC ARROW!
Round 3: Angel Dustin' fires a badly romantic arrow at your opponent. It roars an angry "RAAAH! RAAAH!" but it quickly turns into an "OOO LA LA!" It gazes at you, too stunned by your beauty to attack this round.
Happened: pickpocket
Happened: skill 7108
Parsed round number: 3
You snatched a floaty sand (3,300μ)!
floaty sand (15.0 @ +397.75): 3,300μ * 74.66% = 2,463.86
floaty sand (15.0 @ +397.75): 3,300μ * 74.66% = 2,463.86
Revised monster value: 4,927.72
Happened: stolen
Building options...
Creating event 'attack'...
Creating event ''...
Creating event ''...
Creating event 'use 2'...
Creating event 'use 8'...
Creating event 'use 27'...
Creating event 'use 28'...
Creating event 'use 145'...
Creating event 'use 181'...
Creating event 'use 185'...
Creating event 'use 208'...
Creating event 'use 231'...
Creating event 'use 232'...
Creating event 'use 233'...
Creating event 'use 234'...
Creating event 'use 270'...
Creating event 'use 344'...
Creating event 'use 345'...
Creating event 'use 347'...
Creating event 'use 353'...
Creating event 'use 357'...
Creating event 'use 452'...
Creating event 'use 464'...
Creating event 'use 469'...
Creating event 'use 474'...
Creating event 'use 546'...
Creating event 'use 547'...
Creating event 'use 548'...
Creating event 'use 549'...
Creating event 'use 550'...
Creating event 'use 551'...
Creating event 'use 559'...
Creating event 'use 563'...
Creating event 'use 624'...
Creating event 'use 630'...
Creating event 'use 747'...
Creating event 'use 779'...
Creating event 'use 819'...
Creating event 'use 820'...
Creating event 'use 821'...
Creating event 'use 822'...
Creating event 'use 823'...
Creating event 'use 824'...
Creating event 'use 825'...
Creating event 'use 826'...
Creating event 'use 827'...
Creating event 'use 829'...
Creating event 'use 910'...
Creating event 'use 1051'...
Creating event 'use 1055'...
Creating event 'use 1067'...
Creating event 'use 1071'...
Creating event 'use 1075'...
Creating event 'use 1079'...
Creating event 'use 1159'...
Creating event 'use 1316'...
Creating event 'use 1334'...
Creating event 'use 1335'...
Creating event 'use 1336'...
Creating event 'use 1389'...
Creating event 'use 1390'...
Creating event 'use 1391'...
Creating event 'use 1394'...
Creating event 'use 1510'...
Creating event 'use 1704'...
Creating event 'use 1705'...
Creating event 'use 1777'...
Creating event 'use 1907'...
Creating event 'use 1922'...
Creating event 'use 1939'...
Creating event 'use 1958'...
Creating event 'use 1960'...
Creating event 'use 2040'...
Creating event 'use 2041'...
Creating event 'use 2042'...
Creating event 'use 2043'...
Creating event 'use 2067'...
Creating event 'use 2068'...
Creating event 'use 2091'...
Creating event 'use 2092'...
Creating event 'use 2129'...
Creating event 'use 2131'...
Creating event 'use 2133'...
Creating event 'use 2138'...
Creating event 'use 2237'...
Creating event 'use 2240'...
Creating event 'use 2341'...
Creating event 'use 2348'...
Creating event 'use 2349'...
Creating event 'use 2350'...
Creating event 'use 2351'...
Creating event 'use 2369'...
Creating event 'use 2371'...
Creating event 'use 2374'...
Creating event 'use 2378'...
Creating event 'use 2396'...
Creating event 'use 2397'...
Creating event 'use 2400'...
Creating event 'use 2402'...
Creating event 'use 2437'...
Creating event 'use 2438'...
Creating event 'use 2439'...
Creating event 'use 2492'...
Creating event 'use 2493'...
Creating event 'use 2537'...
Creating event 'use 2538'...
Creating event 'use 2575'...
Creating event 'use 2581'...
Creating event 'use 2582'...
Creating event 'use 2606'...
Creating event 'use 2608'...
Creating event 'use 2613'...
Creating event 'use 2617'...
Creating event 'use 2619'...
Creating event 'use 2644'...
Creating event 'use 2645'...
Creating event 'use 2646'...
Creating event 'use 2647'...
Creating event 'use 2648'...
Creating event 'use 2678'...
Creating event 'use 2687'...
Creating event 'use 2696'...
Creating event 'use 2704'...
Creating event 'use 2715'...
Creating event 'use 2947'...
Creating event 'use 2956'...
Creating event 'use 2966'...
Creating event 'use 2992'...
Creating event 'use 3020'...
Creating event 'use 3063'...
Creating event 'use 3065'...
Creating event 'use 3082'...
Creating event 'use 3099'...
Creating event 'use 3111'...
Creating event 'use 3112'...
Creating event 'use 3146'...
Creating event 'use 3147'...
Creating event 'use 3148'...
Creating event 'use 3149'...
Creating event 'use 3150'...
Creating event 'use 3151'...
Creating event 'use 3152'...
Creating event 'use 3153'...
Creating event 'use 3154'...
Creating event 'use 3155'...
Creating event 'use 3388'...
Creating event 'use 3403'...
Creating event 'use 3448'...
Creating event 'use 3462'...
Creating event 'use 3467'...
Creating event 'use 3480'...
Creating event 'use 3594'...
Creating event 'use 3597'...
Creating event 'use 3665'...
Creating event 'use 3726'...
Creating event 'use 3729'...
Creating event 'use 3730'...
Creating event 'use 3734'...
Creating event 'use 3754'...
Creating event 'use 3755'...
Creating event 'use 3756'...
Creating event 'use 3757'...
Creating event 'use 3758'...
Creating event 'use 3759'...
Creating event 'use 4045'...
Creating event 'use 4046'...
Creating event 'use 4084'...
Creating event 'use 4087'...
Creating event 'use 4116'...
Creating event 'use 4118'...
Creating event 'use 4119'...
Creating event 'use 4120'...
Creating event 'use 4121'...
Creating event 'use 4137'...
Creating event 'use 4210'...
Creating event 'use 4231'...
Creating event 'use 4236'...
Creating event 'use 4251'...
Creating event 'use 4256'...
Creating event 'use 4330'...
Creating event 'use 4331'...
Creating event 'use 4582'...
Creating event 'use 4628'...
Creating event 'use 4698'...
Creating event 'use 4699'...
Creating event 'use 4736'...
Creating event 'use 4867'...
Creating event 'use 5048'...
Creating event 'use 5105'...
Creating event 'use 5120'...
Creating event 'use 5308'...
Creating event 'use 5309'...
Creating event 'use 5327'...
Creating event 'use 5433'...
Creating event 'use 5531'...
Creating event 'use 5557'...
Creating event 'use 5560'...
Creating event 'use 5561'...
Creating event 'use 5563'...
Creating event 'use 5678'...
Creating event 'use 5750'...
Creating event 'use 5907'...
Creating event 'use 5983'...
Creating event 'use 5988'...
Creating event 'use 5989'...
Creating event 'use 6278'...
Creating event 'use 6282'...
Creating event 'use 6284'...
Creating event 'use 6864'...
Creating event 'use 6865'...
Creating event 'use 6866'...
Creating event 'use 6871'...
Creating event 'skill 15'...
Creating event 'skill 55'...
Creating event 'skill 2022'...
Creating event 'skill 2023'...
Creating event 'skill 3019'...
Creating event 'skill 3022'...
Creating event 'skill 3004'...
Creating event 'skill 3005'...
Creating event 'skill 3007'...
Creating event 'skill 4009'...
Creating event 'skill 6025'...
Creating event 'skill 7010'...
Creating event 'skill 7011'...
Creating event 'skill 7012'...
Creating event 'skill 7013'...
Creating event 'skill 7014'...
Creating event 'runaway; repeat'...
Options built! (225 actions)
SmartStasis complete.
You're on your own, partner.
Click here to continue in the relay browser.
 
Last edited:

coandco

Member
As of the new bounty system and KoLMafia's support for it, SmartStasis no longer works. When I attempt to use it (via WHAM.ash), I get the following:

Code:
Invalid field name 'bounty_count' (SmartStasis.ash, line 152)
Consult script 'WHAM.ash' not found.
You're on your own, partner.

There are also a couple other locations in the code where this occurs. I commented them out in my local copy and SmartStasis works again, sans its ability to decide if it should use Olfaction for bounty-related reasons. I'm on KoLMafia build 13579.
 

Theraze

Active member
Attached is my version that removes the bounty bits but still includes olfacting BatMan_attract monsters. I suggest only putting this into the scripts folder and not putting it into the SVN folder, so that whenever zarqon makes an official release, it just does away and official goodness overwhelms it. :) The new bounty code will be checking for (once the to_bounty function exists) get_property("currentEasyBountyItem").to_bounty().monster and the other 2 current bounties to see if the monster you're fighting happens to be one of the 3 possible bounty monsters. Since you can have all 3 at the same time, if you really want.
 

Attachments

  • SmartStasis.ash
    37.3 KB · Views: 45

zarqon

Well-known member
Working again with r15. This is a stopgap fix so that the script still runs while mafia sorts out how it's going to deal with the revamped bounties.

SS will still automatically attract monsters in your BatMan_attract setting, or specified in your autoOlfact property.
SS will also still copy the monster specified in your autoPutty property (something I think Theraze accidentally nixed in his fix above).

So if you want SS to olfact/putty your bounty monster while hunting, for now you'll have to type "monster <monstername>" in for autoOlfact and/or autoPutty for SS to help you out with it. This is easily managed in the mafia GUI: Adventure tab | Custom Combat tab | Special field (right-click). Or in the CLI: "set autoOlfact = monster <monstername>".
 

Theraze

Active member
SS will also still copy the monster specified in your autoPutty property (something I think Theraze accidentally nixed in his fix above).

Shouldn't have. I removed the should_putty section that's tied into the ihunt, but left the set_autoputtification() part in. I removed the part during puttification that checks whether or not it's time to olfact a puttied monster, but... the rest should still all be there. :)

Happy that the official release is out now though. And hey, since to_bounty() exists now, you should be able to make it smart again. :)
 

bumcheekcity

Active member
Zlib olfacted a goth giant, but my ftf_olfact is blank. Am I misunderstanding the setting or how to edit it?

Code:
> zlib ftf_olfact

Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

(If no values were shown, no settings or values matched your input text. Type "zlib vars" to see all.)
 

Theraze

Active member
Lazy fix for olfacting bounty monsters:
Code:
  // second, set puttifaction for bounty monsters
   if (to_bounty(get_property("currentEasyBountyItem")).monster == m) should_olfact = true;
   else if (to_bounty(get_property("currentHardBountyItem")).monster == m) should_olfact = true;
   else if (to_bounty(get_property("currentSpecialBountyItem")).monster == m) should_olfact = true;

Since I don't believe we track how many of the bounty items we've gotten in an easily accessed way besides parsing the preference with a split_string manually, I didn't try to do anything fancy for putty. But at least this way it doesn't take 54 adventures for a simple bounty anymore...
 
Recently I've encountered SmartStatis running to 26 rounds, then aborting to combat. Is there a way to have it just attack if it's going to hit the round limit soon?
 

Theraze

Active member
Recently I've encountered SmartStatis running to 26 rounds, then aborting to combat. Is there a way to have it just attack if it's going to hit the round limit soon?

That's what WHAM_safetymargin is supposed to do, if you're running SS through WHAM. If you're running it by itself, then you need to manually edit your SVN copy of SS and add in your safety margin for how many additional rounds it's supposed to leave for you to finish with combat beyond its 'best guess' which tends to be... erratic.

Basically look for the spots that do maxrounds and either + or - your margin.
 
Winterbay: my CCS is

skill pocket crumbs
consult SmartStasis
attack with weapon

That's what WHAM_safetymargin is supposed to do, if you're running SS through WHAM. If you're running it by itself, then you need to manually edit your SVN copy of SS and add in your safety margin for how many additional rounds it's supposed to leave for you to finish with combat beyond its 'best guess' which tends to be... erratic.

Basically look for the spots that do maxrounds and either + or - your margin.
I'm running it manually. I'd rather not edit the SmartStasis file, as I'd have to redo those edits every time the file updated. It's not the stopping that concerns me, so much as the stopping to user input. If I use WHAM, can I make it attack the last round, rather than abort to "you're on your own"? I'm going to attack each time it does that, so I'm just trying to avoid mafia sitting waiting for me to do something without me noticing.
 

Theraze

Active member
You don't have to edit it everytime it updates if you put them into your SVN copy and sync it. But otherwise, you're basically stuck with either the default behaviour or not... and the default will stasis as long as it believes it's useful.
 
I think I found the problem: my default CCS behavior has "attack with weapon" after "consult SmartStasis", but my specific behavior for pygmy orderlies omitted the "attack with weapon". That meant KoLmafia had nothing to do but keep consulting, eventually leading to the abort. I fixed my CCS, and haven't had that problem. Theraze and Winterbay, thanks for your help.
 

digitrev

Member
An incredibly minor quibble with the BatMan_attract setting. Is there any way to tell it not to Olfact wandering monsters? I typically wink at Hellions on day one to get some extra Hell Ramen throughout my run, but since I use WHAM.ash (which calls SmartStasis.ash), I frequently find it olfacting Hellions when it doesn't make sense to.
 

digitrev

Member
SmartStasis should probably check get_monsters(my_location()) or something along those lines.

While on the one hand that seems not unreasonable, it does run into the (admittedly slight) problem of running into a copy while in the appropriate zone. But since it does seem like a reasonable fix, I changed
Code:
if (list_contains(vars["BatMan_attract"],m)) should_olfact = true;
to
Code:
if (list_contains(vars["BatMan_attract"],m) && get_monsters(my_location()) contains m) should_olfact = true;
 

Crowther

Active member
I know some people fax in a copy of a monster and want to scent trail it before adventuring in the zone were it appears. I've never done that, but they might not like the proposed fix.

EDIT: Or putty. Maybe it was putty.
 
Top