SmartStasis -- a complex script for a simple CCS

Haven't tested -- just read that somewhere. It might be mistaken or old information. I've basically been in aftercore with all my characters for a long while now (oddly enough, due mostly to working on this, ha) so have no bosses available.
 
I would suggest going to the relay browser and start a fight with the "script" button in order to get the KoL response printed out. Might help narrowing down what the problem is.

Character has finished the war and ascended so no can do, but will try next time. Never used "Script' from relay browser. Will it automagically execute combat using my CCS or will I need to do something else to get the information?

I sense a logical disconnect. I am running Wossname to automate and it recommends Smartstasis to handle the gremlins. But if SmartStasis really breaks on bosses then using it will force Wossname to stop when it doesn't need to.

That said, what I observed was not an abort but seemed more like an infinite loop.
 
That said, what I observed was not an abort but seemed more like an infinite loop.
Depending on the error that caused the KoL Macro to abort, Mafia won't abort, and might submit the same macro over and over again.

These are the strings that cause Mafia to abort (FightRequest.java, lines 1698-1704):
PHP:
if ( responseText.indexOf( "Macro Abort" ) != -1 ||
	 responseText.indexOf( "Macro abort" ) != -1 ||
	 responseText.indexOf( "macro abort" ) != -1 || 
	 responseText.indexOf( "Could not match item(s) for use" ) != -1 )
{
	FightRequest.nextAction = "abort";
}

Although, in the case of a consult script that submits macros on its own, setting FightRequest.nextAction to "abort" probably has no effect whatsoever.
 
BatBrain probably needs the same macro error handling added to act(), especially as it relies on mafia's knowledge rather than KoL's (it doesn't include haveitem or haveskill checks in the macros). That would make it easier to debug these situations.

@frono: I only read that recently. If it's true, it would mean a majorly annoying tweak to macro(), executing every action in the queue one-by-one if you're fighting a boss.
 
Regarding boss macro, I think that's not true anymore... if it were, this shouldn't have worked:
[675] Boss Bat's Lair
Encounter: The Boss Bat
Strategy: C:\Program Files (x86)\KoLMafia\ccs\default.ccs [default]
Round 0: Theraze wins initiative!
Monster value: 85
Profit per round: ActionProfitDamageOtherbase; Cocoabo (10.31μ)10.31μ2.56 (-4.03 MPD)Att: -0.83 (0 DPR) Def: -0.83 HP: 2.97 MP: 2.97
Round 1: Theraze executes a macro!
Round 1: Theraze attacks!
Round 2: the boss bat takes 35 damage.
You lose 8 Muscularity Points
Round 2: the boss bat heals 8 hit points.
Round 2: Theraze attacks!
Round 3: the boss bat takes 41 damage.
Round 3: the boss bat takes 5 damage.
You gain 5 hit points
Round 3: Tog roots around in the ground, and comes up with some Meat. He wings it to you.
You gain 161 Meat.
Round 3: Theraze wins the fight!
You acquire an item: dense meat stack
You acquire an item: Boss Bat bandana
You acquire an item: Boss Bat britches
You gain 5 Strongness
You gain 2 Mysteriousness
You gain 2 Chutzpah

Or at worst case, KoL turns the macro back to single attacks... we don't need to do any additional weird handling.
 
Character has finished the war and ascended so no can do, but will try next time. Never used "Script' from relay browser. Will it automagically execute combat using my CCS or will I need to do something else to get the information?

The script button causes Mafia to fight the battle for you as if you were automating (i.e. it calls your CCS) only it shows everything in the browser window. With the invention of macros this works much better than before where it made 1 page load every action :)
 
Last edited:
Bug reporting time. I got Evaluator syntax error: can't understand weight/6.0 when using a misshapen animal skeleton. In batfactors is this line:

Code:
fam	55	Misshapen Animal Skeleton	0.66*(0.4+0.1*ceil(fweight/5))*(0.75*fweight+5.5)	spooky	rate 1, att -0.33*weight/6.0, def -0.33*weight/6.0

Shouldn't weight be fweight? Also, there are several other familiars where weight is used. If that was an error you can change those also: fam 17, 52, 61, 265)
 
If you find data file errors like that, you could just fix them yourself. That's basically the point of the Map Manager. I'll fix it when I have time if you haven't already fixed it.
 
I know I could fix it, but I wanted confirmation first because I'm not very familiar with eval(). The fact that weight and fweight are used on the same line made me nervous. I'll take care of it for you.
 
Well, this may have been answered somewhere in the 90+ pages of the thread, but is there a way to turn off the "profit Stasis" effect, but keep the four "additional" stasises (Gremlins, Ruby Rod, Rave skills, Yellow Ray)? I don't really plan on running Stasis combats myself aside from those situations.
 
It only uses "profit stasis" when its good for you.

It checks how much damage you would take in the fight and balances that against how much it would cost to restore that damage. It will then stasis only if you'd gain more than you lose. It really does ensure that you profit so it won't take actions that are likely to get you beaten up or waste HP for no reason. For instance, if the monster would do a lot of damage or your familiar/gear won't restore HP/MP/meat in combat you can be sure it won't try to extend combat.

tl;dr: It automatically turns off "profit stasis" whenever you'd want it turned off.
 
Last edited:
Technically, "stasis" is the wrong word to describe most of SS's behavior presently, since what it is actually doing is prolonging the combat when the combat environment is profitable. The idea is that you are improving your character each round (thus, not stasis) and should therefore use a low-cost, low-damage action to stay in that environment as long as it is profitable.

If you only want to stasis when it's actually stasis (i.e. waiting for something to happen), that's easy enough to do using your CCS -- only use SS in those locations. Or, if you want to keep all the other things SS does, just delete the call to stasis(), which happens almost at the very bottom of SS.

But I don't get why you'd want to. If you had an item in the game, usable 500 times daily, and each time it gave you at least 15 meat, wouldn't you want to use it all 500 times each day? Each round of profitable combat is just like that item. Why not take advantage of them?
 
Last edited:
It only uses "profit stasis" when its good for you.

It checks how much damage you would take in the fight and balances that against how much it would cost to restore that damage. It will then stasis only if you'd gain more than you lose. It really does ensure that you profit so it won't take actions that are likely to get you beaten up or waste HP for no reason. For instance, if the monster would do a lot of damage or your familiar/gear won't restore HP/MP/meat in combat you can be sure it won't try to extend combat.

tl;dr: It automatically turns off "profit stasis" whenever you'd want it turned off.

Well, even when it is profitable for me it also makes battles take longer and thus if your connection is slow it may make the game run more slowly than you would really like...
 
It's getting better. It still takes 1 page load per:

  • FTF (everything)
  • single disco combo
  • stasis series until your HP/MP changes (which could happen frequently if you're starfishing) or your familiar is spent
  • noodling if it hasn't already happened and is projected to be profitable for the remainder of combat

Then, you need to finish the combat. Even using a finisher script that submits the remainder of combat as one macro, using SS can certainly make things take longer, especially on a slow connection.

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.
 
Short answer: no.

Long answer: READ THIS!

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 think pickpocket attempts could be followed by
Code:
if match "grab something" || "You manage to wrest" || "knocked loose some treasure."; goto stole; endif
and the rest of the macro could be rearranged so that one part is executed if something was stolen, and another part is executed if not.

That would make for a complicated macro generation though.
 
Last edited:
Which combo is chosen may also depend on which item is stolen. As far as I'm concerned, it's worth the server hit to not code that.
 
Back
Top