SmartStasis -- a complex script for a simple CCS

Bale

Minion
I am misremembering something then. My recollection was that its best guess failed to recognize that I had Cocoon and that I had several thousand hit points so that even at 20% health there was no reason to stasis in order to restore HP. I think setting it manually improved that but ultimately I decided that running SS just did not make sense for that character, Hooray for edge cases!

Well that is certainly true. It's best guess doesn't consider Cocoon. BatBrain relies on UR for that sort of calculation. The properties used are _meatperhp and _meatpermp and you would need to change them to adapt to that situation. Considering that BatBrain calculates the cost of a scroll of drastic healing, perhaps the presence of Cocoon should also be considered?
 
Last edited:

fronobulax

Developer
Staff member
So would the best course of action here be to remove SS and run OCW by itself? Or does OCW depend too much on SS functionality to run correctly?

The reason I started trying to use SS was because it is the easiest way to handle the gremlins in OCW. In fact there is a statement somewhere in the "How to OCW" that points that out. The character I had the troubles with is admittedly an edge case as a never ascended level 70+ who is unlikely to ever run OCW. In general not only is it safe to run SS with OCW but it is almost required.
 

dracura

New member
Oh my, I may have made a boo boo. When I installed UR I think I forgot to set is as the recovery script....

Edit: Yep, tested it again. No more lasagna shenanigans. I'm an idiot.
 
SmartStasis is not using the half-rotten brain against the conjoined zmombie. The gCLI output is basically the same as before without the errors. SmartStasis ends without doing anything and it moves on to the next line in my CSS which is attack. Any thoughts?

Well, I was having some trouble with bees the other day and I realized what the problem was. I'm in Beecore! I'm terribly sad it took me so long to realize what was going on.:( Freakin' noobs.

Anyways, on a related note, perhaps the choice adventures to get the friars boss items with b's in their names should be changed accordingly if you're in Beecore.
 

Idran

Member
I think I might have found a bug in SmartStasis. I've got Dirty Old Lihc listed in ftf_olfact, but while I was auto-adventuring in the Cemetery, it used Olfaction against a Lihc. I was thinking maybe it was an issue with how SmartStasis searches for monster names; I couldn't see any other reason the Lihc would have gotten olfacted.
 
So, I have two questions about editing my version of SS to handle the little stompin' boots' stompin' action.

I added the familiar to the drop familiar function of BBB, altho, I think the 5 there is hardcoded, and I couldn't really think of a way around it.

Second, I'd like to add a stasis action that if I have the release the boots skills available, and the monster doesn't drop a goal, to stomp his ass and collect the paste. I can do it easily enough by ccs, except for the "does the monster drop a goal" part.

Thanks for any suggestions you might have.
 
Last edited:

Theraze

Active member
Wouldn't the zlib has_goal(monster m) take care of this? I think you can just do something like:
Code:
if (has_goal(last_monster()) == 0) {<do stuff that is non-goal>;}
 

Bale

Minion
zarqon, question about SS. Why will it refuse to use the flyers in the Bathroom, unless you are fighting the GMOB? That doesn't make sense to me. The flyers work just fine there and someone might want to use the flyers even if he does not want to set up the guy.
 

Theraze

Active member
Isn't that part of the 'flyer everything' variable? If you want to flyer outside the HitS, GMoB, or Cyrus, you need to turn that on...
 

evilspoons

Member
Sometimes (I have not been able to determine when, I think it might be when I'm a disco bandit or have certain items equipped) I end up with combats that look like this:

Code:
Request 37 of 60 (Island: F'c'le) in progress...

[448] F'c'le
Encounter: clingy pirate
Strategy: C:\Users\Erik\Dropbox\KoLmafia\ccs\default-evilspoons.ccs [default]
Round 0: evilspoons wins initiative!
Evaluator syntax error: unexpected end of expr
Evaluator syntax error: can't understand |
Evaluator syntax error: can't understand |
1/6 monsters drop goals here.
Round 1: evilspoons executes a macro!
Round 1: evilspoons tries to steal an item!
You lose 12 hit points
Round 2: evilspoons uses the cocktail napkin!
Evaluator syntax error: unexpected end of expr
Evaluator syntax error: can't understand |
Evaluator syntax error: can't understand |

I tried to search this thread but searching for a pipe character is next to impossible short of going to each page of this thread by hand and doing a ctrl-F.

Any ideas? My CCS file is simply:
Code:
[ default ]
consult SmartStasis.ash
attack with weapon

Also: am I the only one who thinks that BatBrain/SmartStasis/etc are popular enough that they deserve their own subforum or prefix or something? It's extremely hard to search for information when it's all canned up in a 1200-reply single thread and the forum search engine doesn't link to the page that the search result is actually on.
 
Last edited:

Winterbay

Active member
The | is only used in 2 places in batfactors, "Fire orange bottle-rocket" and "Play a Guitar Solo". Did you at the time have a bottle-rocket or whatever that iotm that allows you to play guitar solos equipped?
 

Bale

Minion
Isn't that part of the 'flyer everything' variable? If you want to flyer outside the HitS, GMoB, or Cyrus, you need to turn that on...

It is on. SS has code to purposefully avoid flyering in the Bathroom.

The | is only used in 2 places in batfactors, "Fire orange bottle-rocket" and "Play a Guitar Solo". Did you at the time have a bottle-rocket or whatever that iotm that allows you to play guitar solos equipped?

Elvish Sunglasses
 

Crowther

Active member
The | is only used in 2 places in batfactors, "Fire orange bottle-rocket" and "Play a Guitar Solo". Did you at the time have a bottle-rocket or whatever that iotm that allows you to play guitar solos equipped?
Interesting! I've been wondering for while why I get those messages only out of ronin. Of course, that's when I use my bottle-rocket crossbow.
 

evilspoons

Member
Yes, you are right. I have my bottle-rocket crossbow equipped right now.

Now... what's broken, hmm.

EDIT: I imagine this is a problem with BatBrain,not SmartStasis... should I re-post there?
 
Last edited:

kain

Member
so I'm seeing SS perform stasis using lasagna bandages and saucy salve when there appears (to me) to be no reason for doing so. I have a Megadrone in my CoT (good for 3 rounds of MP) and a jumpsuited hound dog as my familiar.

Code:
> zlib verbosity = 8

Previous value of verbosity: 5
Changed to 8.

> adventure 1 guano

Restoring MP! Currently at 148 of 150 HP, 0 of 126 MP, current meat: 337 ... Target MP = 26.
Try to heal MP from inventory.
Last attempt to purchase MP with meat.
baleUr_MPtrouble => true
Did not fully restore MP for some reason.

Visit to BatHole: Guano Junction in progress...

[31] Guano Junction
Encounter: perpendicular bat
Strategy: C:\Users\E073933\Dropbox\KM\ccs\kain.ccs [default]
Round 0: kain wins initiative!
Running ZLib version: r29
Running BatBrain version: 1.9
1 MP costs 8.0µ.
1 HP costs 6.6666665µ.
batgut (15.0 @ +173.68561): 12µ * 41.05284% = 4.926341
bat wing (15.0 @ +173.68561): 1680µ * 41.05284% = 689.68774
sonar-in-a-biscuit (10.0 @ +173.68561): 11µ * 27.368559% = 3.0105414
Value of stat gain: 200.52µ
Factoring in navel ring of navel gazing: damage, stun 0.5
Profit per round: ActionProfitDamageOtherbase; navel ring of navel gazing; Jumpsuited Hound Dog; enthroned El Vibrato Megadrone (0µ)100µ--50% stun chance MP: 12.5
Running SmartStasis version: 3.6
Stasis action chosen: skill 6025
SmartStasis: 88 profit is good enough to stasis with Sing
batgut (15.0 @ +173.68561): 12µ * 41.05284% = 4.926341
bat wing (15.0 @ +173.68561): 1680µ * 41.05284% = 689.68774
sonar-in-a-biscuit (10.0 @ +173.68561): 11µ * 27.368559% = 3.0105414
Value of stat gain: 200.52µ
Monster: Perpendicular Bat, ATT: 36, DEF: 33, HP: 30, Value: 947.65
You will die in 42 rounds.
Your attack will kill the monster in 3 rounds.
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; pickpocket; call batround; if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 1: kain executes a macro!
Round 1: kain tries to steal an item!
You acquire an item: bat wing
Round 2: Danger Danger lowers itself down over your temples and shoots a beam of energy through your brain. Whee!
You gain 14 Mojo Points
You snatched a bat wing (1680µ)!
batgut (15.0 @ +173.68561): 12µ * 41.05284% = 4.926341
sonar-in-a-biscuit (10.0 @ +173.68561): 11µ * 27.368559% = 3.0105414
Value of stat gain: 200.52µ
Revised monster value: 257.96
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 14.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 2: kain executes a macro!
Round 2: kain casts SAUCY SALVE!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
You gain 10 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 11.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 3: kain executes a macro!
Round 3: kain casts SAUCY SALVE!
KoLmafia thinks it is round 4 but KoL thinks it is round 2
You gain 13 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 8.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 4: kain executes a macro!
Round 4: kain casts SAUCY SALVE!
KoLmafia thinks it is round 5 but KoL thinks it is round 2
You gain 24 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 5.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 5: kain executes a macro!
Round 5: kain casts SAUCY SALVE!
KoLmafia thinks it is round 6 but KoL thinks it is round 3
You gain 14 hit points
Round 6: Danger Danger lowers itself down over your temples and shoots a beam of energy through your brain. Whee!
You gain 11 Mojo Points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 13.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 6: kain executes a macro!
Round 6: kain casts SAUCY SALVE!
KoLmafia thinks it is round 7 but KoL thinks it is round 4
You gain 14 hit points
Round 7: Danger Danger lowers itself down over your temples and shoots a beam of energy through your brain. Whee!
You gain 12 Mojo Points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 22.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 7: kain executes a macro!
Round 7: kain casts SAUCY SALVE!
KoLmafia thinks it is round 8 but KoL thinks it is round 5
You gain 13 hit points
You lose 1 hit point
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 19.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 8: kain executes a macro!
Round 8: kain casts SAUCY SALVE!
KoLmafia thinks it is round 9 but KoL thinks it is round 6
You gain 10 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 16.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 9: kain executes a macro!
Round 9: kain casts SAUCY SALVE!
KoLmafia thinks it is round 10 but KoL thinks it is round 7
You gain 13 hit points
You lose 1 hit point
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 13.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 10: kain executes a macro!
Round 10: kain casts SAUCY SALVE!
KoLmafia thinks it is round 11 but KoL thinks it is round 8
You gain 11 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 10.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 11: kain executes a macro!
Round 11: kain casts SAUCY SALVE!
KoLmafia thinks it is round 12 but KoL thinks it is round 9
You gain 30 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 7.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 12: kain executes a macro!
Round 12: kain casts SAUCY SALVE!
KoLmafia thinks it is round 13 but KoL thinks it is round 10
You gain 10 hit points
Stasis action chosen: skill 4014
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; skill 4014; call batround; endsub; call batsub1; repeat hasskill 4014 && (!hpbelow 141.0 && hpbelow 150 && !mpbelow 4.0 && mpbelow 119 && !pastround 28); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 13: kain executes a macro!
Round 13: kain casts SAUCY SALVE!
KoLmafia thinks it is round 14 but KoL thinks it is round 11
You gain 11 hit points
Stasis action chosen: skill 6025
DestroyAllMonsters: attack... killrounds: 3, dierounds: 42
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; sub batsub1; attack; call batround; endsub; call batsub1; repeat (!times 30); if hpbelow 9; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 14: kain executes a macro!
Round 14: kain attacks!
KoLmafia thinks it is round 15 but KoL thinks it is round 12
Round 15: perpendicular bat takes 106 damage.
Round 15: kain wins the fight!
Your familiar gains a pound: Mr Wibble, the 3 lb. Jumpsuited Hound Dog
After Battle: Danger Danger surveys the scene from atop the throne, and gains 1 Experience.
You gain 20 Meat
After Battle: Mr Wibble does a couple of karate moves, then swivels his hips and gyrates his pelvis.
You acquire an item: batgut
You gain 4 Muscleboundness
You gain 3 Enchantedness
You gain 11 Roguishness
Look! You found 1 batgut (12µ)!

Requests complete.
 

fronobulax

Developer
Staff member
My guess, from having something that might have been similar happen to me, is that it thinks it is beneficial to heal you because each HP is worth about 6 meat.
 

Crowther

Active member
so I'm seeing SS perform stasis using lasagna bandages and saucy salve when there appears (to me) to be no reason for doing so. I have a Megadrone in my CoT (good for 3 rounds of MP) and a jumpsuited hound dog as my familiar.
I've been having the same problem. It continues to heal even if my HP is at maximum until it burns up all my MP. It was painfully expensive in hardcore. I tried commenting out Saucy Salve in SmartStasis.ash, but that didn't fix it. When I removed the Saucy Salve lines from batfactors.txt, the problem went away.
 

Winterbay

Active member
Seeing as I've never run into that problem I would be interested in seeing what your setup was when it occurred in order to try and figure out why it did that, when it doesn't for me.
 
Top