SmartStasis -- a complex script for a simple CCS

zarqon

Well-known member
Yes; it would require building a preferred list of combos for each possible item stolen, then adding subs to the macro for all possible combos, then subs which call them in the right order for all possible lists, then adding conditionals to the post-stealing bit of the macro (couldn't "match" after other actions, right?) calling the preferred list. However, it would have to avoid killing the monster if there were other custom actions following the steal. Further, it would have to know how much damage further custom actions are likely to do and avoid overdamaging the monster. Then, the consult script would have to parse the page to know what happened and determine which combos didn't get cast and are thus still available. Prone to error and a pain to code.
 

Theraze

Active member
Tertiary answer: Does that have anything to do with SS? SS had its own check for pickpocket success, but that is not a macro command.

I'm working right now on refactoring disco combos a bit -- which will enable me to reduce page loads a bit further. Profitable combos will be cast consecutively (in a single page load) if possible. Unfortunately, this can't be easily appended to the FTF segment (further reducing page loads) since the combo(s) chosen will depend on your pickpocketing success.

I thought that the question related, as zarqon had directly referenced FTF pickpocket being the reason why the FTF section can't be combined with disco combos currently...
 

zarqon

Well-known member
Oh, that would make it slightly easier then. I'll TODO it in the script and think about getting to it on a rainy day when the rest of the script is finished. Might also mean the familiar spentness detections aren't working properly.

I've just about got combos refactored to submit multiples where possible; in the debugging phase with a couple DB characters. It's much less code to build the available combos now that I can use get_action() and merge() to build them. It also involved some reworking of macro() -- macro now always clears the queue, no matter which version was called. It's also smarter about how it calls batround in there. If you specify a repeat condition for an action (in either enqueue() or macro()), it will build a sub for it inclusive of batround and then call the sub with the repeat condition. Yay for more detections!

I think I'm going to make myself fix Rave Steal accounting for a 100% drop before I update though, just so Bale doesn't report that bug a third time. :)
 

Bale

Minion
LOL :D

Sorry about that, really!

Though I wasn't reporting a bug involving 100% drop. I was reporting that if rave steal gets the item then there isn't a reason to use rave concentration, so rave steal should be used BEFORE rave concentration.
 
Last edited:

Winterbay

Active member
Managed to get beaten up today while (admittedly being in over my head) in the Bathroom. Stats are 35/73/45 with a level 11 Rogue Program and the CCS is
Code:
consult smartstasis.ash
consult spamattack - batbrain.ash

This is what happened:
Code:
[197] Haunted Bathroom
Encounter: claw-foot bathtub
Round 0:     winterbay wins initiative!
Monster: Claw-foot     Bathtub (ATT 90.0, DEF 90.0, HP 100.0)
Running     away would cost you 919.5 meat.
Getting     beaten up would cost you 975.5 meat.
Monster resistances: 0
Player     resistances: 0 (0.25) (0.05)     (0.25) (0.25)     (0.25)
Monster     value: 419.5
Profit per round:                             Action                          Profit                          Damage                          Other                                      base; Rogue Program (0μ)                          -48.98μ                          3.47 (0 MPD)                          MP: 3.47                      
    Round 1: winterbay executes a macro!
Round 1: winterbay attacks!
You     lose 35 hit points
You've had the crap beaten out     of you... attempting to find some more crap.
Visiting Relaxing     Hot Tub in clan VIP lounge
You lose an effect: Beaten Up
You gain 67     hit points

Why did SS try to attack here? We are clearly not in the clear... (I know it's SS and not Spamattack since Spamattack prefaces all actions with "Spamattack:")
 

zarqon

Well-known member
I'm fairly certain that's not SS's doing. If prolonging the combat is not profitable and you've finished your custom actions (certainly not including attacking with weapon), then SS is done. It doesn't attempt to kill monsters; I've never seen it use attack on any character versus any monster at any point during its development.

@Bale: I'm beginning to suspect that people would generally always prefer Rave Steal to be performed prior to Concentration, even if it means Concentration cannot be cast. It needs further consideration, but might be a good thing (easier to code, too).
 

Bale

Minion
Bug report time! YAY! We all love bug report time!

[1111] The Marinara Trench
Encounter: diving belle
Strategy: C:\My Dropbox\KolMafia\ccs\default.ccs [default]
Round 0: --- wins initiative!
Round 1: --- executes a macro!
Round 1: --- tries to steal an item!
Round 2: --- executes a macro!
Round 2: --- casts BREAK IT ON DOWN!
Round 3: diving belle takes 8 damage.
Round 3: --- casts POP AND LOCK IT!
Round 4: diving belle takes 11 damage.
Round 4: --- casts RUN LIKE THE WIND!
Round 5: diving belle takes 18 damage.
Round 5: --- executes a macro!
Round 5: --- casts BREAK IT ON DOWN!
Round 6: diving belle takes 8 damage.
Round 6: --- casts POP AND LOCK IT!
Round 7: diving belle takes 14 damage.
You lose 83 hit points
Round 7: --- casts RUN LIKE THE WIND!
Round 8: diving belle takes 5 damage.
Round 8: Cuddles rubs a ballpoint pen really fast across a nearby wall, then pokes her with it for 46 damage.
Round 8: diving belle takes 46 damage.
Round 8: --- executes a macro!
Round 8: --- casts BREAK IT ON DOWN!
Round 9: diving belle takes 7 damage.
Round 9: --- casts POP AND LOCK IT!
Round 10: diving belle takes 11 damage.
Round 10: Cuddles drops a week-old strip of bacon down your opponent's back, doing 66 damage from the stench.
Round 10: diving belle takes 66 damage.
Round 10: --- casts RUN LIKE THE WIND!
Round 11: diving belle takes 10 damage.
Round 11: --- executes a macro!
Round 11: --- casts BREAK IT ON DOWN!
Round 12: diving belle takes 6 damage.
Round 12: --- casts POP AND LOCK IT!
Round 13: diving belle takes 15 damage.
Round 13: Cuddles shouts, "last one out is a rotten egg," then throws a rotten egg at her. She takes 70 damage from the stench.
Round 13: diving belle takes 70 damage.
Round 13: --- casts RUN LIKE THE WIND!
Round 14: diving belle takes 6 damage.
Round 14: --- executes a macro!
Round 14: --- casts BREAK IT ON DOWN!
Round 15: diving belle takes 7 damage.
Round 15: --- casts POP AND LOCK IT!
Round 16: diving belle takes 11 damage.
Round 16: Cuddles drops a week-old strip of bacon down your opponent's back, doing 72 damage from the stench.
Round 16: diving belle takes 72 damage.
Round 16: --- casts RUN LIKE THE WIND!
Round 17: diving belle takes 6 damage.
Round 17: Cuddles throws an M-80 at her, hitting her for 70 points of explosive hot damage.
Round 17: diving belle takes 70 damage.
Round 17: --- executes a macro!
Round 17: --- casts BREAK IT ON DOWN!
Round 18: diving belle takes 10 damage.
Round 18: Cuddles shouts, "last one out is a rotten egg," then throws a rotten egg at her. She takes 48 damage from the stench.
Round 18: diving belle takes 48 damage.
Round 18: --- casts POP AND LOCK IT!
Round 19: diving belle takes 11 damage.
Round 19: Cuddles gives her a good ol' fashion Indian Rugburn. Which is probably a Native American Rugburn, these days. She takes 48 damage from the friction-induced heat.
Round 19: diving belle takes 48 damage.
Round 19: --- casts RUN LIKE THE WIND!
Round 20: diving belle takes 10 damage.
Round 20: --- executes a macro!
Round 20: --- casts BREAK IT ON DOWN!
Round 21: diving belle takes 10 damage.
Round 21: Cuddles eats a clove of garlic (wait, what's garlic?) and breathes a toxic cloud into her face for 66 damage.
Round 21: diving belle takes 66 damage.
Round 21: --- casts POP AND LOCK IT!
Round 22: diving belle takes 14 damage.
Round 22: --- casts RUN LIKE THE WIND!
Round 23: diving belle takes 5 damage.
Round 23: --- executes a macro!
Round 23: --- casts BREAK IT ON DOWN!
Round 24: diving belle takes 6 damage.
Round 24: --- casts POP AND LOCK IT!
Round 25: diving belle takes 15 damage.
Round 25: Cuddles rubs a ballpoint pen really fast across a nearby wall, then pokes her with it for 70 damage.
Round 25: diving belle takes 70 damage.
Round 25: --- wins the fight!
After Battle: Cuddles does a little shimmy-and-shake to celebrate your victory. It's a little skanky, even if you're into fish. Not that I'm into fish.Cuddles holds out the plastic pumpkin bucket, hoping for extra goodies.
You acquire an item: salinated mint julep
A dolphin stole: diving muff
You gain 20 Beefiness
You gain 30 Magicalness
You gain 65 Chutzpah

As you might suspect, BREAK-POP-RUN is rave steal. Unfortunately SS does not detect a successful steal so it tries again and again and AGAIN! There are some items that aren't marked as no steal, so if rave steal fails to steal, please don't do it again.
 

Winterbay

Active member
As you might suspect, BREAK-POP-RUN is rave steal. Unfortunately SS does not detect a successful steal so it tries again and again and AGAIN! There are some items that aren't marked as no steal, so if rave steal fails to steal, please don't do it again.

Huh, and I thought I had gone through the item drops table and submitted all non-pickpocketable sea items as such. Which ones do you feel is wrong still?
 

Bale

Minion
At the end of the combat it dropped a "salinated mint julep". Mafia does not mark that as "no pickpocket", but this combat seems have pretty clearly spaded the truth of that. I am not aware of any others, I'm just not ruling out the possibility that another monster might have an improperly marked item either now or in the future.
 
Last edited:

Winterbay

Active member
Odd. I went by the Wiki which states
All items found on undersea monsters are, by default, unable to be pickpocketed. This includes pickpocket, divine crackers, and V for Vivala mask critical hit item steal.

Exceptions to this rule are bazookafish bubble gums, salinated mint juleps, bottles of Alewife™ Ale and booze slugs from monsters in The Dive Bar.

Which seems to indicate that juleps should be stealable. Wouldn't be the first time that they are wrong over there though :)
 

Winterbay

Active member
Feature/Bug Report: While fighting the big swarm of ghuol whelps (swarm of ghoul whelps, level 2) I got the following:
Code:
You're fighting a big swarm of ghuol whelps

You summon a storm of hot Steak Sauce, which drenches two of them for 168 damage.

Indicating that this is a plural monster, though it is not listed in the plural monster data file. I'm going to go out on a limb and guess that the two other swarms (level 1 and 3) are also plural. No idea if they count as more than 2 though as saucestorm only attacks two I think. The picture is defintely of more than 2...
 

Winterbay

Active member
Ahh. Also, the monster in itself is listed as a bad monster by Mafia and so crashes the consult script. I should probably go and report that as a bug.
 

zarqon

Well-known member
I wish there were a way around that "Bad monster" error.

Feel free to add the various swarms of whelps to pluralMonsters.txt yourself using the Map Manager, once mafia recognizes them as monsters.
 

Winterbay

Active member
I wish there were a way around that "Bad monster" error.

Would it be feasible to get an override file for monster.txt that just adds the name of an unknown monster (and whatever else Mafia needs to recognise a monster) when one is encountered or is there a good reason for this not existing?
 

slyz

Developer
"Swarm of Ghuol Whelps" was added in r9239, but I guess "big swarm of ghuol whelps" and "giant swarm of ghuol whelps" should be added as well, I'll post a patch.
 
Top