SmartStasis -- a complex script for a simple CCS

Skill 4014 is Saucy Salve. Either SS tries to use it at some point without checking if you have it permed, either it doesn't check whether you have enough MP to cast it in the generated macro.
 
Latest BatBrain appears to be double-displaying on stolen items, as per this:
Round 1: Theraze tries to steal an item!
You acquire an item: ballroom blintz
Round 2: "Evaluating target... Target judged: ungroovy" Gog intones solemnly, then blasts your opponent with a laser beam for 25 damage.
Round 2: zombie waltzers takes 25 damage.
You snatched a ballroom blintz (43 μ)!
Revised monster value: 871.63
You snatched a ballroom blintz (43 μ)!
Revised monster value: 871.63
Round 2: Theraze executes a macro!
Round 2: Theraze attacks!
 
Skill 4014 is Saucy Salve. Either SS tries to use it at some point without checking if you have it permed, either it doesn't check whether you have enough MP to cast it in the generated macro.

I do not have it permed, but the only reference to it I could find in the script has a have_skill check:
SmartStasis.ash line 153 said:
if (have_skill($skill[saucy salve]) && my_hp() < m_dpr(0,0) || min(hpgoal - my_hp(),12)*meatperhp > mp_cost($skill[saucy salve])*meatpermp)

Only thing I can think of is that it may be an order-of-operations thing related to the || and && operators.
 
I think jdeyke may be correct; I'm pretty sure everything from "have_skill(" to "m_dpr(0,0)" needs an extra set of parentheses.
 
SS 3.1 Update

I've eliminated jump_action(), since stealing is technically the only jump action and it can be integrated into the custom actions macro. This means faster combats and even fewer server hits! Yay! The tricky bit was adding the GMoB and Cyrus into the custom actions builder -- unfortunately I won't be in a position to test this soon since I'm doing some aftercore stuffs. Can anyone doing a relaxed run test GmoB or Cyrus using SS and make sure it behaves smartly? It should use flyers if you have them, otherwise the mirror/base pair. If you have funkslinging, it should sling both. If you make it past the item-throwing phase (quite possible with noodles), it will try to run away.

Also added some detections to the stasis loop to stop the macro if your familiar runs out of juice -- assuming it's the sort that needs juice. Once the next BatBrain goes up, the transition to macrofied combat will be complete as far as detections are concerned.

@mredge: This update is simply a transition making the existing detections macro-friendly, so if you had a problem before SS 3 this won't fix it. I don't know what you mean about the image server -- BatBrain is not looking for an actual image, it's checking the HTML of the page to see if it includes the image name.

@jdeyke: This problem was mentioned a few posts back. You are one of the lucky few who managed to get an extremely short-lived version of SS. It was only online for a few minutes, when I caught that and fixed it. Fortunately, this is all irrelevant with this update.

@Bale: Surely you can't be serious!

Added the slimelingFullness reset. Yet another good idea from you.

@Theraze: I'm unable to duplicate that. Evidently act() is somehow getting called twice on the same page text. It's mostly harmless, but looks stupid. If it still happens with this update, I'd like to hear more about your situation, particularly how it differs from mine.

I would like to mention that this script is working great for me. :)
 
I think I've found a bug in BatBrain, in the hitchance-function. It currently does:
Code:
float attack = my_buffedstat(weapon_type(equipped_item($slot[weapon])));

However if you have a mysticality weapon this will lead to the attack stat being set to myst which is not the case, the stat should be muscle, so perhaps something like this instead:

Code:
	float attack;
	if(weapon_type(equipped_item($slot[weapon])) != $stat[mysticality])
		attack = my_buffedstat(weapon_type(equipped_item($slot[weapon])));
	else
		attack = my_buffedstat($stat[muscle]);

This gives the following change against a triffid with 22 myst and 7 muscle:
(before change)
Code:
SpamAttack: Monster HP is 13.0
Expected damage give: 13.0, Monster damage per round: 0.22000003, Rounds to kill: 1.0, Hit chance: 0.97727275

(after change)
Code:
SpamAttack: Monster HP is 13.0
Expected damage given: 2.6646972, Monster damage per round: 0.22000003, Rounds to kill: 5.0, Hit chance: 0.1861472

Which I feel is much more correct given my cli-output of the latest battle with the triffid...
 
zarqon, I think my double-posting steal results may have to do with the lovely fight override... the version I'm using was the one you had in post 617 back Feb 21. First line of main runs act...
 
@Winterbay: Ooh. I hadn't realized mysticality would ever be a weapon_type. Does current_hit_stat() return the correct stat? That might be an easier way to do it.

@Theraze: I've attached my current fight.ash for you. The biggest change you'll notice is that it has buttons in front of every damage-dealing action for spamming that action with autoresponses built-in. I haven't made a thread for this since I don't want to support it yet -- it's not up to my standards of releaseworthiness. Last time I did that (CanAdv) it was a disaster.

If you (or anyone Java-savvy) can figure out how to get the tablesorter working on this you will be my new BFF.

EDIT: removed no-longer-compatible files
 
Last edited:
How exactly do you want the tablesorter to work... prioritized by value of action, or are there multiple possible sorts (in case of duplicate values)? No guarantees, but I'll do my best to stare at it along with my current EatDrink project. :)

Edit: Still getting doubles with the new fight.ash override, but then again, it does still have the act(results) in there, so I'm assuming that's just something that's an interesting 'feature' of using it. :) Not bad, long as I realize that I haven't just doubled my item gain.
 
Last edited:
Tablesorter is a jQuery plugin which makes a table sortable. You can click the header to sort the table by the information in that column. But it doesn't work on the actions table for some reason and I'm not much of a JavaScript wizard so I haven't been able to figure it out.

I usually don't play relay in aftercore -- and all of my characters are in aftercore right now because I'm busy scripting and don't have time to actually ascend. Next time I'm in a run I'll see about fixing the double-parsing issue.
 
@Winterbay: Ooh. I hadn't realized mysticality would ever be a weapon_type. Does current_hit_stat() return the correct stat? That might be an easier way to do it.

That seems to be working as well yes.
Code:
> ash current_hit_stat()

Returned:     Muscle

> ash     weapon_type(equipped_item($slot[weapon]))

Returned:     Mysticality
 
Did find one thing... the initial jquery is supposed to have a </script> immediately after it. I'll keep poking around to see what I can find. Looks like there's supposed to be more bits around that need tweaking still...

Yep. With the extra </script> in there, the table sorts. :) Attached it.
 

Attachments

Last edited:
Found an odd bug. It didn't cast Transcendent Olfaction here when I was auto olfacting a monster. A few turns later the spooky gravy fairy warlock appeared again and that time SS olfacted it just as I expected, so the first time it probably failed because it was busy with other things.

Code:
autoOlfact: monster spooky gravy fairy warlock

Request 1 of 5 (MusSign: Spooky Gravy Barrow) in progress...

[5917] Spooky Gravy Barrow
Encounter: spooky gravy fairy warlock
Strategy: C:\My Dropbox\KolMafia\ccs\default.ccs [default]
Round 0: bale wins initiative!
Round 1: Tumeric produces a tubular red firecracker labeled M-61, lights the long fuse, and tosses it behind your opponent.
Checking for updates (running BatBrain ver. 0.8.3)...
_version_batbrain => 0.8.3
You have a current version of BatBrain.
map_pluralMonsters.txt => 2011-02-28T13:05:11-06:00, checked 20110418
You have the latest pluralMonsters.txt. Will not check again today.
map_batfactors.txt => 2011-04-14T21:19:50-05:00, checked 20110418
You have the latest batfactors.txt. Will not check again today.
Checking for updates (running SmartStasis ver. 3.1)...
_version_SS => 3.1
You have a current version of SmartStasis.
map_use_for_items.txt => 2009-12-31T23:06:36-06:00, checked 20110418
You have the latest use_for_items.txt. Will not check again today.
Round 1: bale executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: bale executes a macro!
Round 2: bale casts CONSUME BURROWGRUB!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
You gain 30 hit points
You gain 15 Mojo Points
Round 3: bale executes a macro!
Round 3: bale casts CONSUME BURROWGRUB!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
You gain 30 hit points
You gain 15 Mojo Points
Round 4: Tumeric gives your opponent a sullen glance, and sighs dramatically, rolling her eyes. His feelings are hurt, causing 1 damage.
Round 4: spooky gravy fairy warlock takes 1 damage.
Round 4: bale executes a macro!
Round 4: bale casts CONSUME BURROWGRUB!
KoLmafia thinks it is round 5 but KoL thinks it is round 4
You gain 30 hit points
You gain 15 Mojo Points
Round 5: spooky gravy fairy warlock takes 91 damage.
Round 5: bale wins the fight!
After Battle: Tumeric lights a miniature Catherine wheel and dances in the shower of sparks. How cute!
Your familiar gains a pound: Tumeric, the 2 lb. Spooky Gravy Fairy
After Battle: Tumeric takes a drag on her clove cigarette while gesturing disdainfully at some stuff your opponent dropped.
You acquire an item: spooky mushroom
You gain 6 Muscleboundness
You gain 6 Magicalness
You gain 6 Chutzpah
 
Fantastic!! The next task is making it sort based on the info we want -- right now it looks like it's sorting everything like strings. That will probably involve <td> classes and moving the coloring/sizing to CSS.

Status update: Theraze is my new BFF.
 
I'm honestly not sure if this is a SS/BB bug or elsewhere, but it started shortly after updating to the latest version of both (and had never occurred before). The gCLI error-like verbiage:
Code:
[2580] The Purple Light District
Encounter: Grabby Nicky Thompson
Strategy: G:\KoLMafia-Otto\ccs\Smart_TT.ccs [hobo]
Round 0: tragus loses initiative!
Round 1: Nereis virens produces a tubular red firecracker labeled M-88, lights the long fuse, and tosses it behind your opponent.
Round 1: sleaze hobo takes 2 damage.
Round 1: sleaze hobo takes 4 damage.
Round 1: sleaze hobo takes 4 damage.
You lose 4 hit points
Factoring in Scarysauce: (6) damage, retal
Monster value: 2332.5
Profit per round: ActionProfitDamageOtherbase; Baby Sandworm (0μ)-3.72μ--
Round 1: tragus executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
Round 2: tragus executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
Round 3: tragus executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
Round 4: tragus executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
Round 5: tragus executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
Round 6: tragus executes a macro!
at which point I issue a manual STOP.
In the request-sync mini-browser, I see:
Code:
>Too many, or zero, matches for skill, "Ask Richard for a Bandage", macro aborted.
Note that I can manually and successfully ask for a bandage.


The relevant portion of my css:
Code:
[ hobo ]
consult SmartStasis.ash
skill entangling noodles
item divine noisemaker
skill head + knee + shield combo

I have the following (possibly) relevant vars set:
Code:
bbb_adjust_choiceadvs	false
bbb_famitems	false
bbb_miniboss_items	2
bbb_turtlegear	true
bbb_turtles	1
bbb_vampire_hearts	4
BatMan_baseSubstatValue	5.0
BatMan_macrofy	false
BatMan_profitforstasis	15.0

I'm current a TT Level 21. So much for auto-hoboing for now. Note that (so far) I've only had a problem in hobopolis.
 
That may be a bug with KoL Macros' "haveskill" or "skill". Maybe SS should use the skill numbers in macros instead of skill names.
 
I was just about to ruffle my feathers and reply snottily that BatBrain already uses skill numbers, but given that error message I just double-checked and somehow it doesn't. When I converted the datafile to the new format I somehow switched items to ints but not skills. I think that merits an immediate update. So behold, BatBrain 0.8.4. This also fixes familiar detections, and an attack damage calculation error when wielding mysticality weapons, found thanks to Winterbay's sleuthing.

BatBrain doesn't include "haveskill" in macros -- it's already checked and you have the skill.

@Bale: I'd missed your post earlier. SS will skip items in your custom list if a) you lack the MP to cast them, or b) your expected damage is likely to be the end of you. However, if these conditions change later in the stasis loop it will still perform the actions. I suspect your MP was simply too low.

MP restoration for Olfacting is easy enough to add -- I'll try to remember to put that in the next update.
 
Last edited:
Back
Top