SmartStasis -- a complex script for a simple CCS

Seeing as I've now separated WHAM and SS to a certain extent again I think I should post this bug/unwanted feature here:

When SS decides it should use an item or a skill and also decides it should stun with something it often doesn't behave in very smart way. Two recent examples:
1) Wanting to heal the player with Saucy Salve the script decides to stun first with Entangling Noodles. The only problem being that I only had MP enough for one of those actions and so the "real" action failed to enqueue due to being out of mana.

2) When banishing pirates with Cocktail Napkins the script once again decides to through in a cast of Entangling Noodles first to stun leading to a net loss of MP since the fight ends directly after throwing the napkin.

Also, if you somehow manages to run build_custom() twice in a script that imports SS you get interesting effects like trying to auto-funk two pirate books even though you only have one and thus none of them being used since KoL says "You only have one of those" and moves on.
 
I noticed also that WHAM is duplicating things that SS did already. For example SS was jiggling my staff for the first round, then WHAM tried to jiggle for a last round. The WHAM requested jiggle failed of course, dropping me back to relay browser to finish combat. I'm sure this is why you originally duplicated so much of SS in WHAM. My quick question now is: can I just set jiggling as a WHAM_dontuse option so that WHAM won't jiggle, as I assume SS will continue to do so?
 
Using Olfaction on the monsters you specify in ftf_olfact, as well as bounty monsters when you are on a bounty hunt! If you are on a hunt, Olfaction will ignore ftf_olfact 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 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!

Is it possible to disable olfaction in SS completely? I don't want to olfact bounty monsters when castle farming, because I'll get enough ravers no matter what, so I just want to keep goth's olfacted

Additionally #1, is there a reason to cast noodles before releasing the boots?

Code:
Round 2: fxer casts ENTANGLING NOODLES!
Round 3: fxer casts RELEASE THE BOOTS!

Additionally #2, I don't understand how SmartStasis chooses to pickpocket. I gain initiative every round but I only see a 'tries to steal an item!' attempt maybe 25% of the time while in the castle Top Floor? Sometimes it will pickpocket Goths, sometimes not. Seems totally random?
 
Last edited:
@Winterbay: The stun logic could use some improving. I was kind of assuming that a script which imports SS would want to have its own function for performing the custom actions, since it may actually want to delay some of the actions until after the monster has been attacked down to the point where it may be one-shotted. But for users of SS followed by a regular CCS, that's a problem I should address. I'm considering adding some kind of "ends combat" flag to actions that are guaranteed to finish the combat (such as auto-kills or automatic runaways, although BB has deliberately ignored runaways thus far), since presently BB can only assume that an action is a combat-ender based on its doing enough damage.

As for calling build_custom() twice, that's simple: don't. :)

@Palinathas: There were several problems with jiggling which I've fixed during my (incredibly slow) PM run recently. KoL reports that action as "chefstaff" which is not a valid macro command, so we have to change that back to "jiggle" in happenings, just like we did for "steal" and "summon". Secondly, we don't need to add "once" to the event -- we need to just skip adding it if it's already happened, so once the tracking was fixed I could also fix the issue of enqueueing it more than once. These fixes will be in the next BatBrain.

@fxer: There is no way to disable it aside from editing the script, however there is a partial workaround: set your autoOlfact property to "monster Goth Giant". This isn't a perfect solution, since it will still olfact either giant, depending on which shows up first.

The easiest way to edit the script to do what you request is to change line 134

PHP:
   item ihunt = to_item(to_int(get_property("currentBountyItem")));

to

PHP:
   item ihunt;

This will cause the script to think that you are never on a hunt, so it will simply olfact monsters in ftf_olfact as normal.

Additional #1. The reason is that the script has no idea that Release the Boots will end the combat, so it is trying to protect you from the damage it predicts you will be taking (as mentioned above, a fix for this is under consideration).

Additional #2. Presently SS pickpockets when 1) you have a chance of getting either pickpocket-only items or regular drops with a less than 100% drop rate, and b) either the monster drops a goal OR you are "in the clear" which is defined as your attack action will kill the monster before the monster kills you.

This means that SS may not pickpocket in several non-obvious cases: a) your +items actually raised all items to a 100% drop rate, or 2) you had no valid attack action as calculated by attack_action(). If you're getting inconsistent pickpocking on the same monster, it sounds like the latter. I'm thinking of removing the intheclear check, but I also don't want to get people killed.

Hope this knowledge assists everyone! :)

I'm waiting on spinning a BB update until I try out Jarlsberg and make whatever necessary adjustments haven't already been suggested. Unfortunately, RL is rather crazy right now as it's the beginning of the school year over here. Wish me luck!
 
@Winterbay: The stun logic could use some improving. I was kind of assuming that a script which imports SS would want to have its own function for performing the custom actions, since it may actually want to delay some of the actions until after the monster has been attacked down to the point where it may be one-shotted. But for users of SS followed by a regular CCS, that's a problem I should address. I'm considering adding some kind of "ends combat" flag to actions that are guaranteed to finish the combat (such as auto-kills or automatic runaways, although BB has deliberately ignored runaways thus far), since presently BB can only assume that an action is a combat-ender based on its doing enough damage.

As for calling build_custom() twice, that's simple: don't. :)

Well, yes.
It was a mistake since when I did the separation I took out the SS-specific parts of build_custom and kept the ones I had made myself and so build_custom_WHAM calls build_custom and I had first done this call at the top and then moved it to the bottom but forgot to remove the first instance :)
And since SS is such a good script in itself I felt it better to actually use the custom actions suggested therein and build onto that rather than make up my all own things. Easier for my brain then :)

Looking forward to getting to remove all my extra chefstaff-handling code when the next BB gets released :)
 
Additional #2. Presently SS pickpockets when 1) you have a chance of getting either pickpocket-only items or regular drops with a less than 100% drop rate, and b) either the monster drops a goal OR you are "in the clear" which is defined as your attack action will kill the monster before the monster kills you.

This means that SS may not pickpocket in several non-obvious cases: a) your +items actually raised all items to a 100% drop rate, or 2) you had no valid attack action as calculated by attack_action(). If you're getting inconsistent pickpocking on the same monster, it sounds like the latter. I'm thinking of removing the intheclear check, but I also don't want to get people killed.

Hope this knowledge assists everyone! :)

That is very helpful, thanks for the explanation zarqon, appreciate it!

With the vastly lower drop rates of Warm Certs on Goth Giants I figured they would always be pickpocketed now, maybe the numbers haven't been spaded/put into mafia yet. But my +150% item or so certainly doesn't make them a 100% drop since the castle revamp
 
Last edited:
With the vastly lower drop rates of Warm Certs on Goth Giants I figured they would always be pickpocketed now, maybe the numbers haven't been spaded/put into mafia yet. But my +150% item or so certainly doesn't make them a 100% drop since the castle revamp
They're not in mafia yet. The file monsters.txt contains those facts. Search for Goth Giant and you'll see the certificates are still listed at 30%.

On an unrelated note, the new code browser is slow, ugly, and hard to use. I'm not sure what the people at Sourceforge were thinking.
 
Is it possible to enqueue a yellow beam so batbrain/smartstasis will toy with whatever monster it is currently fighting until it is time to release the beam? Or will beams only work for monsters in ftf_yellow?
 
You can enqueue it but the enqueueing will fail unless you actually have said beam as a valid option at the moment. I guess you could do a script that stasises with some low damage option until get_action($skill[yellow ray (or whatever it is called)]) != "" and then enqueue it.
 
Thanks winterbay, I just modified my script to interact better with ftf_yellow, sounded like that was going to be the easier route.

Another question, my script adds an action to build_custom() so I can unleash nanites, but SS unleashes them before it probably should. Shouldn't it try to pickpocket first? Do I need to put more details in to_event() so it knows it should happen after pickpocketing etc?

Code which is injecting the nanites skill
PHP:
custom[count(custom)] = to_event("skill " + $skill[Unleash Nanites].to_int(),"",1);

The outcome:
Code:
[156082] Giant's Castle (Top Floor)
Encounter: Steampunk Giant
Round     0: fxer wins initiative!
Round 1: fxer executes a macro!
Round 1:     fxer uses the Rain-Doh blue balls!
Round 2: steampunk giant takes 10     damage.
Round 2: fxer casts UNLEASH NANITES!
You lose an effect:     Nanobrawny
 
Similarly with autoPutty enabled, SmartStasis seems to know it wants to putty a monster but fires a yellow beam before doing it:

Code:
[156179] Spooky Putty Monster
Encounter: Goth Giant
Round 0: fxer wins initiative!
Auto-funk: merging 'use 5561' and 'use 3665'.
Round 1: fxer executes a macro!
Round 1: fxer tries to steal an item!
Round 2: Morty Goldfarb's bells jingle merrily.
Round 2: Morty Goldfarb glares with his yellow eye at a passing pigeon. There's a gentle *pop* as air rushes into the pigeon-shaped hole in reality.
Round 2: fxer casts POINT AT YOUR OPPONENT!
Round 3: Morty Goldfarb swings his eyestalk around and unleashes a massive ray of yellow energy, completely disintegrating your opponent.
You acquire an effect: Everything Looks Yellow (duration: 100 Adventures)

Notice the Auto-funk line where it is planning to use both the spooky putty sheet and rain-doh black box, but fires a beam instead. Maybe SS would have thrown the putties if the yellow eye had not appeared so soon, in round 2? Still seems like you'd want to throw the putty regardless, and stasis until yellow eye comes up again
 
Similarly with autoPutty enabled, SmartStasis seems to know it wants to putty a monster but fires a yellow beam before doing it:

Code:
[156179] Spooky Putty Monster
Encounter: Goth Giant
Round 0: fxer wins initiative!
Auto-funk: merging 'use 5561' and 'use 3665'.
Round 1: fxer executes a macro!
Round 1: fxer tries to steal an item!
Round 2: Morty Goldfarb's bells jingle merrily.
Round 2: Morty Goldfarb glares with his yellow eye at a passing pigeon. There's a gentle *pop* as air rushes into the pigeon-shaped hole in reality.
Round 2: fxer casts POINT AT YOUR OPPONENT!
Round 3: Morty Goldfarb swings his eyestalk around and unleashes a massive ray of yellow energy, completely disintegrating your opponent.
You acquire an effect: Everything Looks Yellow (duration: 100 Adventures)

Notice the Auto-funk line where it is planning to use both the spooky putty sheet and rain-doh black box, but fires a beam instead. Maybe SS would have thrown the putties if the yellow eye had not appeared so soon, in round 2? Still seems like you'd want to throw the putty regardless, and stasis until yellow eye comes up again

The problem here is actually that while SS decides on all those things BatBrain uses yoru yellow ray as soon as it can when it sees that you have the option against a ftf_yellow monster potentially overriding the decision made by SS.
Also, on the pickpocket/nanite thing: Do you call build_custom() before or after your own call to to_event()? If it is after then SS should pickpocket first, and if it is before your action will come first...
 
Off topic and possibly a stupid question, but why would you want to putty and yellow ray a goth giant?

Normally I do a clod hopper but there was a problem with the puttying so I didn't get a copy. I switched to a goth giant for the rest of the day to continue testing the script :)
 
The problem here is actually that while SS decides on all those things BatBrain uses yoru yellow ray as soon as it can when it sees that you have the option against a ftf_yellow monster potentially overriding the decision made by SS.
Also, on the pickpocket/nanite thing: Do you call build_custom() before or after your own call to to_event()? If it is after then SS should pickpocket first, and if it is before your action will come first...

Nanites comes after build_custom(), because that skill can be fired whenever and work. Only the Nanite setup, aka using a muscle combat skill with a charged nanorhino to gain the effect Nanobrawny, has to be fired before SS/BB does anything else (like entangling noodles). Maybe SS just decided it wasn't worth pickpocketing that round?

Hmm yes I see that ftf_yellow is handled in BatBrain.ash but is described in this post as a feature of SmartStasis. Doesn't SS seem like a better place to handle yellow-rays, especially with the existence of conditional drops that you would want to pickpocket attempt before yellow beaming, in addition to throwing putties first etc?
 
So...if I can one shot, why does smartstassis delevel when I'm using Eggman?

There's no reason for me to extend the combat, and there's no reason not to one shot since I have a nice relaxing campfire and 21-27 MP regen on top of that and nothing to use that MP with (all summons done, my librams cost more than my max MP).


Code:
[542] A-Boo Peak
Encounter: Battlie Knight Ghost
Round 0: chef_rannos wins initiative!
WHAM: Running SmartStasis
Round 1: chef_rannos executes a macro!
Round 1: chef_rannos casts SLICE!
Round 2: battlie knight ghost takes 1 damage.
Round 2: battlie knight ghost drops 18 attack power.
You lose 5 hit points
WHAM: Starting evaluation and performing of attack
Round 2: chef_rannos executes a macro!
Round 2: chef_rannos casts CURDLE!
Round 3: battlie knight ghost takes 66 damage.
Round 3: chef_rannos wins the fight!
You gain 5 hit points
You gain 5 Mana Points
You gain 6 Beefiness
You gain 11 Enchantedness
You gain 5 Cheek
 
I actually think it tried to delevel for you (which slice does do). Not that the question isn't valid since I had it prolong my battles with the sceptre until I died...
 
Don't know if it's the same problem, but during AoJ runs SS+BB+WHAM always Blends Battlefield mobs although they can be one-shot with Freeze.
 
WHAM uses curdle a lot for me too, when I have tons of MP already and so much MP regen that it doesn't matter what combat spell I use. For example, if I have over 20 MP regen, I don't mind wasting 5 MP to one shot compared to using curdle a couple times and losing some HP.


Maybe the value of losing HP isn't high enough when you're in AoJ so it thinks it should save more MP for some reason?
 
WHAM uses curdle a lot for me too, when I have tons of MP already and so much MP regen that it doesn't matter what combat spell I use. For example, if I have over 20 MP regen, I don't mind wasting 5 MP to one shot compared to using curdle a couple times and losing some HP.


Maybe the value of losing HP isn't high enough when you're in AoJ so it thinks it should save more MP for some reason?
Assuming it got those costs from UR they should be very accurate. You can always bump up verbosity a bit and see. I think they start printing at 3 (or maybe 5). What WHAM doesn't know about is how much MP you'll restore at the end of combat and so it is effectively free if you don't use it. Maybe that's the issue. I dealt with that by just burning it away before combat with mafia, which I guess isn't always optimal.
 
Back
Top