SmartStasis -- a complex script for a simple CCS

1.3 Updates:

Okay, I've kind of added ghosts and hobos. I could not check for absense of action, because in certain rounds the familiar may not act, no matter how full (for example, when casting Saucy Salve for the first time).

So currently SmartStasis simply checks at the beginning to see if your ghost/hobo is completely out of sustenance. This is less than ideal, but it's the best I could manage at the moment. I tested this very briefly using my ghost. It is untested with hobos (anyone want to give me a spirit hobo so I can test?). :)

I have one further question before implementing a "real" solution: the ghost's "stomach growls loudly" message and the hobo's "Oh, Helvetica" message appear to happen every time the familiar completely runs out of starfish capability. Is that a correct assumption? If so, it would be easy to add that to the act() function and detect when the ghost/hobo runs out.

@Bale: "chogochochogo" is Korean and "nantoko kantoko" is Japanese.
 
I have one further question before implementing a "real" solution: the ghost's "stomach growls loudly" message and the hobo's "Oh, Helvetica" message appear to happen every time the familiar completely runs out of starfish capability. Is that a correct assumption? If so, it would be easy to add that to the act() function and detect when the ghost/hobo runs out.

Oh yeah. That's a good point although I often miss the moment the message happens since it will only occur once. You're just a little wrong. The hobo has two messages that trigger when she runs out of booze. The other is the "millennium hands and shrimp" message. The ghost has a bunch of messages when he runs out of food. Check the wiki for the list.

If they've run out of stock in a previous round, there is no message at all.
 
boohya! Problem fixed!

Code:
[1132] Next to that Barrel with Something Burning in it
Encounter: batwinged gremlin
Strategy: C:\Documents and Settings\E073933\My Documents\KM\ccs\solomonster.ccs [default]
Round 0: solomonster wins initiative!
true
Round 1: solomonster casts ENTANGLING NOODLES!
Round 1: Senor Senor ties its shoelaces together. It trips and takes 27 damage as it lands on its face.
Round 1: batwinged gremlin takes 27 damage.
Now running round 2
true
Round 2: solomonster uses the turtle totem!
Round 2: batwinged gremlin takes 1 damage.
Now running round 3
true
Round 3: solomonster uses the turtle totem!
Round 3: batwinged gremlin takes 1 damage.
You lose 3 hit points
Now running round 4
true
This gremlin does not have a molybdenum item!
Round 4: solomonster casts SHIELDBUTT!
Round 4: Senor Senor holds out the plastic pumpkin bucket, hoping for extra goodies.
Round 4: Senor Senor bends its brim into an approximation of a smile.
Round 4: batwinged gremlin takes 148 damage.
You gain 59 Meat
You gain 27 Strengthliness
You gain 11 Magicalness
You gain 18 Sarcasm

Requests complete.
 
I have looked at the code and don't really see an easy way to set a MIN and MAX % for my MP stasising.

Meaning I am ok with it bleeding down to say 30% before I would like to stasis it back up to say 90%.

Is there an easy way to do that or am I just being blind tonight?

Thanks!
 
At the top of the stasis loop you could put something like

Code:
if (to_float(my_mp()) / to_float(my_maxmp()) > 0.3)
   inmp = 0;

I'm pretty sure that would work like you want. It would not enter the stasis loop for +mp unless your MP was 30% or less of your max MP. The check for a maximum would have to be done somewhere else within the stasis loop, again setting inmp to 0 if you had reached your desired MP percent.
 
News Flash

Updates coming shortly to the FTF/SmartStasis suite! To be included:

  • Properly intelligent support for ghosts and hobos.
  • Snappy integration with your poison-removal combat setting.

This is due to two unequally amazing facts:

1) I have finally popped out of HC and will be able to test, using
2) the spirit hobo that someone sent me.

Holy crap! I was more than half-joking about that.

This mysterious someone, whose name may or may not rhyme with "Dorm's Row Shorty's Crew," shall remain unnamed. But know that this anonymous donor, whose parcel arrived despite inclement weather as though carried by a mighty airborne messenger, though he be shrouded in mystery (akin to the very answer of Life, the Universe, and Everything), has my undying gratitude.
 
Looks like I'm triple-posting in my own thread. Someone please flame me.

1.5 Updates!

Recent updates to FTF and SmartStasis:

  • They now operate transparently with your poison-removal combat setting. If you have it set to remove poison at Really Quite Poisoned or worse, that's what SmartStasis will do.
  • Thanks to the mysteriously anonymous unnamed donor, I now have SS working perfectly with hobos. It's lovely.
  • Someone suggested that FTF always cast Spring Raindrop Attack if you have a haiku katana equipped. I thought it too limiting to include in FTF (it would prevent you from using any of the other katana-granted combat skills), but in the case of stasis, it's a perfect restore option. SmartStasis will now cast Spring Raindrop Attack as part of its stasis restore loop.

Evil, evil GGG's

The dratted things have completely useless messages. There is no way to detect when a ghost runs out of MP-restoring ability, since the "hungry" messages show even when the ghost has restores remaining. The only way to be sure that a ghost has run out is if it has no message at all, but even that might be inaccurate due to Salve or some later-introduced something-or-other. The only thing that will work is a huge mash of contains_text() comparisons against every possible ghost message (checking for absense) and making sure it's not a Salve round, which is very ungainly and easily breakable by the smallest server-side change. Needless to say, that is not in this update. This version will stasis using ghosts regardless of their restore ability.
 
Looks like I'm triple-posting in my own thread. Someone please flame me.
You're a bat-loving bastard son of a batty burrowgrub! Anyone who'd triple-post in his own thread probably plays with bits of bats in the belfry. You're the absolute lowest form of life, even lower than bat blade breeders, bedders of bat hat begeters and stuffed stab bat stuffers.


Okay, I'm not great at flaming, but I at least I tried!
 
@rinn: that's another thing that I don't think a CCS should necessarily automate since its uses are limited. As always, I'm open to being convinced.

Would people be happy with SmartStasis casting Consume Burrowgrub during stasis if you were sure to make full use of its restoration?

@asturia: You also need to update FTF.

@Bale: Nice! You have me dead to rights.

Speaking of bats... friggin' Cheshire bats! I've been on a crusade for one since I joined the game. When I checked long ago they were at 18M, when I decided I needed one for my bat-loving character they were at 36M, and now that I'm getting close to 36M they're over twice that. What is the deal. What. Is. The. Deal. Guess I should give up and learn how to be happy with my stab bat.

I think I just needed to get that off my chest.
 
Quick question:
I have a spirit hobo as my familiar.
and have configured SmartStasis like this:
int mpforstasis = 100;

My current mp is 58.
and when I go to fight a monster it doesn't stasis.

Even with my NPZR it doesn't stasis:
Code:
[426] F'c'le
Encounter: creamy pirate
Round 0: Asturia wins initiative!
Round 0: edding produces a tubular red firecracker labeled M-39, lights the long fuse, and tosses it behind your opponent.
Round 1: Asturia attacks!
Round 1: creamy pirate takes 103 damage.
You lose 1 hit point
Round 2: Asturia attacks!
Round 2: edding does a pelvic thrust at your opponent. A piece of toast ricochets off his head, momentarily stunning him (and/or driving him insa-a-a-a-ane.)
Round 2: edding lights a miniature Catherine wheel and dances in the shower of sparks.  How cute!
Round 2: creamy pirate takes 103 damage.
You acquire an item: toast
You gain 91 Meat
You acquire an item: cream stout
You gain 22 Beefiness
You gain 12 Wizardliness
You gain 10 Cheek
 
The mpforstasis variable has nothing to do with your character's MP. It is the amount of inmp required for the script to stasis. You can see a little lower down that the starfish is worth 15, hobo is worth 13, NPZR is worth 10, etc. If you set this value to 100, the script requires an impossible amount of inmp and will never stasis.
 
I haven't used this script yet, but it looks useful.

When fighting a gremlin that might have the right tool, I like to attack until 1 more hit will kill the gremlin, then start stasising. This minimizes wasted HP if it turns out to not have the tool. Does the script do that?
 
This script does not detect whether or not you have a combat familiar (which you might on a 100% run). Therefore, no -- it stasises gremlins from the beginning of the combat.
 
On a quick look through the code, it appears that you stasis any gremlin, even if you're fighting the wrong one. Is there a nice way to check whether you're fighting the right gremlin?
 
On a quick look through the code, it appears that you stasis any gremlin, even if you're fighting the wrong one. Is there a nice way to check whether you're fighting the right gremlin?

starting on line 108:
Code:
         if (contains_text(to_string(nowfightingonstageone),"Gremlin") &&     // gremlins lack tool
             (contains_text(page,"A.M.C. gremlin") || contains_text(page,"does a bombing run") ||
              contains_text(page,"picks a beet") || contains_text(page,"picks a radish") ||
              contains_text(page,"bites you in the fibula") || contains_text(page,"make an automatic eyeball"))) {
            print("This gremlin does not have a molybdenum item!","olive"); return page;
 
I got errors trying to run this, the first one was

Code:
Unknown variable 'famspent' (SmartStasis.ash, line 93)
Consult script 'SmartStasis.ash' not found.
You're on your own, partner.

eventually realized that, though I had downloaded the latest version of FirstThingsFirst.ash it was picking up an earlier one (2.2) removing this cured the problem.
 
Back
Top