SmartStasis -- a complex script for a simple CCS

Theraze

Active member
Actually, no. It's a WHAM question, and in WHAM there are two WHAM_roundcost variables you'll want to look into - WHAM_roundcost_aftercore and WHAM_roundcost_ronin. How much meat is it worth to you to skip a round of combat when farming in aftercore? What about in a HC or pre-break SC run? If you are spending more time in stasis than you'd like, just raise the values in your vars_<name>.txt file, either by editing it with a text editor or by using zlib to reconfigure it. Tweak until you like your results.
 
Does the script support casting of get a good whiff from the nose when on bounty hunts or for monsters that require olfacting?
 
Last edited:

Saklad5

Member
I am trying to use a mime army infiltration glove with WHAM, and it isn’t pickpocketing whenever possible like I want it to. After going through the code, I think the issue lies with SmartStasis. I can’t be sure, though. I’ve tried commenting out every check for classes I see, and it has not made a difference.
 
It might be due to the fact that the mime glove is currently bugged, even kol native macro's don't realize the pickpocket skill is available and skip it.
 

Saklad5

Member
I solved it for myself in the least elegant way possible: by adding “steal();” to the start of the main method in WHAM.

Works like an extremely crude charm.
 

Saklad5

Member
After carefully examining the code of SmartStasis, I have come up with an excellent solution for pickpocketing that does not routinely break automation. It is still a hack, but as far as everything else is concerned it is expected behavior.

I modified the function in BatBrain that actually performs actions to intercept any submitted pickpocket action, delete it from the macro, run the ASH steal() function (which bypasses the bug in combat macros by submitting the PHP requests manually), then run the macro. As far as BatBrain, SmartStasis, and WHAM are concerned, nothing has changed: the only difference is that the first action of the macro was interpreted separately.

Here is the rewritten function, in case anyone wants to use it themselves. Just search for “string macro(string mac)” in BatBrain.ash to find it in your copy, then replace it.


string macro(string mac) { // basic wrapper, adds action filter to final page
if (my_primestat() != $stat[moxie] && contains_text(mac, "pickpocket")) {
steal();
mac = replace_first(create_matcher(" pickpocket;", mac), "");
}
return mac == "" ? page : act(visit_url("fight.php?action=macro&macrotext="+url_encode(mac),true,true));
}
 

Saklad5

Member
I also modified my copy of SmartStasis to only pickpocket if the monster has unspaded drops. I can post that change if anyone wants me to.

Until I made the change, it was only pickpocketing when monsters had drops that were either confirmed to be pickpocketable or were previously pickpocketed while BatBrain was installed. Now it pickpockets unless there is definitely no reason to do so: against monsters that have no pickpocketable drops, or have drops that are all guaranteed.
 

zarqon

Well-known member
@littlereddot: A bit late (I acquired an effect that prevented me from addressing this sooner), but I can now say that with the latest BatBrain update the answer to your question is yes! The skill had heretofore not been flagged as an "attract" skill in the data file.

@Saklad5: I believe the update probably also fixes your pickpocketing issue, a little further upstream in the enqueue() function. If you have the infiltration glove equipped and "pickpocket" gets enqueued, rather than adding it to the queue, it will call steal() directly.
 

Saklad5

Member
I believe Gallapagosian Mating Call works exactly the same as Get a Good Whiff of This Guy. Could you add that as well? I already have on my own copy, but it gets overwritten with updates.
 

zarqon

Well-known member
@Saklad: Okay, r113 adds even better support for all the various tracking skills/items, and now avails itself of some of mafia's various tracking properties to avoid re-attracting an already attracted monster.

I did not add Mating Call to batfactors though. You seem up to the task!
 

Saklad5

Member
I’m not sure, but I think each kind of attraction can stack. I certainly can’t find anyone saying otherwise. Having On the Trail doesn’t necessarily mean that you can’t benefit further from the mating call, for example.

By the way, the code for set_happened(“attracted”) seems to have a hard-coded list of attraction options, rather than using batfactors.
 

Saklad5

Member
Is there a way to set priorities or values for custom skills? SmartStasis seems to ignore Transcendent Olfaction in favor of Gallapagosian Mating Call due to the lower MP cost. That would make sense if they were equally effective, but that is hardly the case.

Ideally, I’d want to use Transcendent Olfaction first, then use Gallapagosian Mating Call if I currently have On the Trail for a different monster. This could be accomplished with the following changes:

  • Add an optional float value to the custom keyword, which can be used as a multiplier when determining the benefit of using the skill.
    • Transcendent Olfaction could be “custom attract 3”, since it adds 3 copies of the monster to the adventure queue.
    • Gallapagosian Mating Call could be “custom attract 1” or “custom attract”, since it appears to add 1 copy of the monster to the adventure queue.
  • Ignore attract skills that give On the Trail if the effect is already present, but don’t ignore attract skills that do not use it. Don’t try to attract at all if On the Trail corresponds to the monster you are currently fighting. This would probably need to be hard-coded, but the current solution is hard-coded anyway.

If you agree with that design, I might try implementing it myself and submitting a patch.
 

zarqon

Well-known member
Thanks Theraze. r40 brings us a warnings-free SmartStasis, which will also run away from barrow wraith?s.

@Saklad: I agree that SS should prefer the most effective attraction method you have. Your proposal sounds great but would be nontrivial to implement, especially the "when determining the benefit of the skill" part, which is presently basically a boolean. However, attaching numbers to the custom flag is already being done with banishers, so doing it with attraction options sounds good to me. Perhaps an easier solution for the nonce would be to just tell SS to attempt Olfaction first if attraction is desired, then if unavailable proceed as normal.
 

lostcalpolydude

Developer
Staff member
Not that it matters to me since I don't use this script, but I would expect Olfaction and Gallapagosian to both be used on the same monster if possible, rather than only casting Gallapagosian on a second desirable monster if there is one.
 

Glazius

Member
Kind of a weird interaction here. I'm bumming around in aftercore with some mime skills permed and occasionally the New-You club wants me to use a mime combat skill like Silent Knife or Silent Treatment. I can see it getting set correctly in the _newYou related properties, but SmartStasis doesn't seem to be queueing it up. It works fine with other skills. Is there anything I can do to help diagnose this?
 

zarqon

Well-known member
Glazius: SS was still using properties from before mafia tracked the New-You quest. r41 updates it to use mafia's properties. Let me know if that fixes it!
 

Glazius

Member
Hm. Nope. At r41, still not doing it for the mime skills.

It does olfact the monster so if I sneak the skill into line 1 of the combat script enough log parsing happens that I can tell the quest is progressing, so no real big, but I figured it was worth bringing up.
 
Top