SmartStasis -- a complex script for a simple CCS

Winterbay

Active member
Nope. I tried that today and when my macro stopped due to being poisoned (well I say stopped, it looped until I pressed ESC) and I used an antidote to remove the poison and then restarting the macro it continued to claiming to want to abort due to matching on the *poisoned*

Here's the fight in question:
Code:
[490] Dungeons of Doom
Encounter: swarm of killer bees
Round 0: winterbay loses initiative!
 > Monster value: 182.11
 > SpamAttack: Monster HP is 75.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 4.0 rounds.
Round 1: winterbay executes a macro!
Round 1: winterbay attacks!
Round 2: swarm of killer bees takes 8 damage.
Round 2: swarm of killer bees takes 11 damage.
Round 2: swarm of killer bees takes 2 damage.
Round 2: swarm of killer bees takes 3 damage.
You lose 1 hit point
You acquire an effect: Somewhat Poisoned (duration: 10 Adventures)
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 2: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 3: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 4: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 5: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 6: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 7: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 8: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 9: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 10: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 11: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 12: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 13: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 14: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 15: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 16: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 17: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 18: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 19: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 20: winterbay executes a macro!
 > Poison level: 4 (set to remove if 3 or lower)
 > SpamAttack: Monster HP is 51.0
 > You have 0.0% chance to hit the monster
 > SpamAttack: We're actually NOT going to one-shot (with Saucestorm) because noodles and then two shotting would be cheaper.
 > SpamAttack: We are going to 2-shot with Salsaball and Salsaball.
Round 21: winterbay executes a macro!
 > Poison level: 4 (set to remove if 5 or lower)
Round 22: winterbay uses the anti-anti-antidote!
You lose an effect: Somewhat Poisoned
Round 23: swarm of killer bees takes 19 damage.
Round 23: swarm of killer bees takes 1 damage.
Round 23: swarm of killer bees takes 3 damage.
You lose 2 hit points
You acquire an effect: Somewhat Poisoned (duration: 10 Adventures)
 > Poison level: 4 (set to remove if 5 or lower)
Round 23: winterbay uses the anti-anti-antidote!
You lose an effect: Somewhat Poisoned
Round 24: swarm of killer bees takes 16 damage.
Round 24: swarm of killer bees takes 2 damage.
Round 24: swarm of killer bees takes 5 damage.
You lose 2 hit points
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 24: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 25: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 26: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 27: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 28: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 29: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 30: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 31: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 32: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 33: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 34: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 35: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 36: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 37: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 38: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 39: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 40: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 41: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 42: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 43: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 44: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 45: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 46: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 47: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 48: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 49: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 50: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 51: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 52: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 53: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 54: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 55: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 56: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 57: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 58: winterbay executes a macro!
 > SpamAttack: Monster HP is 5.0
 > You have 55.84416% chance to hit the monster
 > Monster is weak. We are just going to bash its head in. It'll take 1.0 rounds.
Round 59: winterbay executes a macro!
 > Monster: Swarm of Killer Bees (ATT 59.0, DEF 49.0, HP 5.0)
 > Running away would cost you 682.1086 meat.
 > Getting beaten up would cost you 711.5203 meat.
Round 60: winterbay attacks!
Round 61: swarm of killer bees takes 14 damage.
Round 61: winterbay wins the fight!
After Battle: Arog flits around like a hummingbird on crack, helping you pick stuff up.
You acquire an item: royal jelly
You gain 3 Strengthliness
You gain 4 Enchantedness
You gain 10 Cheek

I stopped the macro when it posted the "not set to remove just now"-message. I then changed that setting restarted the macro and it removed my poison (twice) followed by claiming to match the stop condition for another ~30 rounds until I stopped it again and killed it manually.
 

Bale

Minion
Winterbay is correct. To make the match go away I need to take a non-macro action against the monster.
 

zarqon

Well-known member
That is silliness.

I guess the way around this is just a bunch of haseffect checks. But I'm not sure what a good solution is for situations where the only check is text, but it could happen multiple times (if such situations exist).
 
Last edited:

Bale

Minion
Well, you could put the following in batround...

if haseffect toad in the hole; abort "Toads in the Hole"; endif
 

Winterbay

Active member
The start of my batround() currently looks like this:
Code:
res.append("abort " + ((get_property("autoAntidote") != "0") ? "" : "match effect*Poisoned || ") + "match \"Toad In The Hole\" || match \"a massive loogie\" || hpbelow "+round(m_dpr(0,0))+"; scrollwhendone; sub batround");
if(to_int(get_property("autoAntidote")) > 0)
{
	res.append("; if ");
	switch(to_int(get_property("autoAntidote")))
	{
		case 1: res.append("haseffect 8 ||");
		case 2: res.append("haseffect 282 ||");
		case 3: res.append("haseffect 283 ||");
		case 4: res.append("haseffect 284 ||");
		case 5: res.append("haseffect 264 ||");
		case 6: res.append("haseffect 436;"); break;
	}
	res.append(get_action($item[anti-anti-antidote]).id + "endif");
}

Which obviously doesn't let you recalculate stats but at least should make sure that you manage to remove the poison at the level you've specified should you get poisoned and let the macro continue. I think the abort would work just fine if Mafia actually aborted but since it continues forever when a macro aborts on a match-condition this seems to not work atm.
 
Last edited:

StDoodle

Minion
You could parse out which round effects were given on, and track when things such as a-a-antidote were used (either in properties or in html comments) and go from there... but it sounds like a lot of regex! :(
 

zarqon

Well-known member
Hehe. The issue is in BALLS, which doesn't even have regex support, not ASH; "match" apparently matches text in every round, and not only in the current macro but also in subsequent macros (less useful than a single-round match, if you ask me). "haseffect" should work since it won't be true after removing the effect.

Bale: SS assumes, as it has from the beginning, that if your starfish-type has charges, they are freely available, since a charge is an arbitrary value. Is there a general-purpose solution for determining when someone would want to hold them in reserve? We could add the minimum value of a charge -- charges come from items, so it seems like for those familiars a fee of 50 meat per charge (less than mallmin since charges often come from junk items) would be reasonable.
 

Bale

Minion
Bale: SS assumes, as it has from the beginning, that if your starfish-type has charges, they are freely available, since a charge is an arbitrary value. Is there a general-purpose solution for determining when someone would want to hold them in reserve? We could add the minimum value of a charge -- charges come from items, so it seems like for those familiars a fee of 50 meat per charge (less than mallmin since charges often come from junk items) would be reasonable.

That sounds like a good idea to me.
 

slyz

Developer
We could ask of a "matchall" predicate for the whole fight, and a "match" predicate that only matches the previous round ?
 

fronobulax

Developer
Staff member
Not sure whether this is a problem or an error in expectations. Please enlighten me either way.

DB with Noodles available. NPZR. Universal Recovery. CCS consults SmartStasis and then attacks with weapon.

1) Get poisoned during combat. Go into infinite loop where mafia round counter increases but the KoL counter does not. May be a known concern but I would like to continue to use SmartStasis and not have that happen.

2) Stasis for a bit, then "normal" combat and then end up getting Beaten Up. The cost of being Beaten Up exceeds the benefit of Stasis for me, especially when the manual sequence of Pickpocket (if available), Noodles, attack with weapon until win works against the same monster. I thought Stasis was Smart enough to not stasis if doing so would result in a lost combat so I am wondering if I have hit an edge case or there is incorrect data somewhere? Known concern? Would additional information be helpful?

Thanks.
 

Winterbay

Active member
The poison thing is known and is what is discussed on a couple of the posts above this. Basically a KoL-macro "match" command matches on the entire fight and you can't therefore use it to abort on poison effects and then run a new macro. Also, I don't think that mafia aborts a fight when the macro aborts which is why the round number keeps upping. Possibly it could be set to abort fighting in some way similar to the "you don't have two of that" when an "abort()" is thrown by the macro.
 

StDoodle

Minion
Zarqon, do you already make use of the "times" predicate? If not, you could use it to track how often things like un-poisoning are done, and do all of it in a special subroutine (macro sub). If the times predicate is exceeded, and you're under one of the effects the script has been configured to uneffect, the entire thing aborts. Otherwise, if you have one of the effects, it's uneffected.
 

fronobulax

Developer
Staff member
The poison thing is known and is what is discussed on a couple of the posts above this. Basically a KoL-macro "match" command matches on the entire fight and you can't therefore use it to abort on poison effects and then run a new macro. Also, I don't think that mafia aborts a fight when the macro aborts which is why the round number keeps upping. Possibly it could be set to abort fighting in some way similar to the "you don't have two of that" when an "abort()" is thrown by the macro.

Thanks. I had seen the poison discussion but was not clear to me where the problem was nor whether it was being addressed. I understand now on both points.
 

Winterbay

Active member
Looking at the script it appears to be using teh Mafia property autoPutty so possibly add the monster to that one would help?
 

slyz

Developer
I did that, but that only helps if you want to olfact it.
Oh sorry, I misread your post for some reason.

You can turn on Mafia's auto-putty by typing "set autoPutty = monster goth giant" in the gCLI. SmartStasis will follow Mafia's auto-putty setting.

I also just realized you might be puttying goth giants so you can olfact them easily when olfaction runs off. In this case, I can direct you to puttyOlfact.ash‎. It will set Mafia's auto-olfact and auto-putty settings (that SmartStasis will obey) when needed.
 
Last edited:

Bale

Minion
You can turn on Mafia's auto-putty by typing "set autoPutty = monster goth giant" in the gCLI. SmartStasis will follow Mafia's auto-putty setting.

For people who prefer not to use the set command, you can use the UI to set automatic putty. On the Adventuring tab, under "action" there is a field called "special". If you click on that you can select "one-time automatic Spooky Putty/4d Camera" and a pop-up box will appear for you to tell it "monster goth giant".

Slyz's method works also, but I like to use the user interface for such things when I have an option.
 

Rinn

Developer
match doesn't check every round while a macro is running. I have a match check to see if my hobo money stole meat and it almost never triggers because meat is stolen in rounds before I start checking (because I'm doing disco combos or something, this is actually kind of annoying because my other exit condition is round 20 so I use a bunch of spices and spam up my log). It seems like there's some difference after a macro ends, the next new macro treats the entire old macro as a single page.
 
Top