Chamois - Use it automatically!

Bale

Minion
Here's a perfected chamois script. It will calculate the expected damage from Covered in Slime based on your slime resistance and level of slime.

It then compares this to your current HP and max HP. If you need healing to survive the slime, it will heal you. If the expected damage is greater than max HP, it will use a chamois. This is guaranteed to use the minimal number of chamois without getting you beaten up (as long as you can kill the slime).

Put chamois.ash in your /scripts directory. It is called by your mood
Trigger On: When an effect is gained
Check for: Coated in Slime
Command: call chamois.ash


Changelog:
v1.1 - Adds support for KolMafia eventually having monster data for slimes.
v1.2 - Adds support for using Hot Tub to remove slime.
v1.3 - Now reports on number of remaining chamoix.
v1.4 - Fixed restoration bug.
v1.5 - Fixed effect name since mafia is picky about that now.
 

Attachments

  • chamois.ash
    2.9 KB · Views: 1,160
Last edited:

Tom Sawyer

Member
Bale This rocks the world

Takes the tedium out of the run :D

I see it sends you a kmail so you should know lots are using this one :D
 

Bale

Minion
I see it sends you a kmail so you should know lots are using this one :D
Not so many -- so far only 7 people, counting you. Still, you did just bring a smile to my face by letting me know that at least one person liked it.

By the way, here's an undocumented feature: If you want to set a minimum level of slime at which it will alway use a chamois, there's a variable at the beginning of the script you can set. That way it will always chamois at (for instance) 6 turns of slime, instead of trying to heal. I figure that might be nice for very casual runs where you aren't worried about maximizing chamois for a future speed run.
 

Muhandes

Member
Sounds very useful, I'll definitely be using it once I start slime killing (read, when I have more than 30 mins a day to play)
 

Fujiko

New member
I registered to download it, and now to thank you. :)

This is wonderful - takes a lot of the tedium out of the slime tube.
 

nWo4Life

New member
Best script ever! I asked around /hardcore to see if anyone knew how to do this and they directed me to you...havent been defeated in over 100 adv of sliming now =)

thx Bale
 

Amilianna

New member
This is fantastic - especially for people like me who can't program to save their life. :) Thank you thank you thank you!
 

Bale

Minion
All this thanks from people who have never posted on this forum before? I'm overwhelmed. You're all very welcome.
 

Muhandes

Member
You have my thanks too, and I posted once or twice before.
I think some people have actually started using mafia just for this small trinket.
 

Muhandes

Member
Today this stopped working for me.
Calling chamois.ash either from mood or directly does nothing.

Edit: I'm not sure how it worked before, as I just looked and it wasn't set right. Anyway, now it works.
 
Last edited:

Bale

Minion
Made a small update. I'd recommend updating, but honestly mafia's monster data doesn't yet support my update so it is no big deal. Just trying to stay ahead of the curve.

Someday, when mafia has data on the different slimes, then this update will be appreciated.
 

Poki

New member
Very efficient-looking script - much cleaner than one I wrote for myself.

A small mod, for those of use with access to the clan hot-tub, was simply to add
Code:
	if(have_effect($effect[Coated in Slime]) > 0) {
		print ("Using VIP bath.", "blue");
		visit_url("clan_viplounge.php?action=hottub");
	}
within the chamois function (I put it before using a chamois, as I want to use my VIP tub until all its turns are used). Now I just need to wait for loot distribution before I can try it out.
 

ironsting

Member
I'd like to add my thanks

I can't say enough about the people that make this game and this tool better all the time.

I have been using this successfully for several days until today it failed to compute the HP and I was killed. I thought perhaps I had changed a setting or there was a change so I downloaded a new copy and the same thing happened. Doing a more thorough recheck of the setup I found that instead of when the effect was gained my mood said call chamois.ash when the effect was lost. Now I know that is the default when you are editing a mood but I know I selected it correctly because the script worked before. Is there anything I could have done that would change the format of a mood elsewhere in mafia?

Thanks again.

Fe

edit: Upon reflection I thought that perhaps the tube I was in had no chamois and that was why it failed but I checked and there are >400 in the bucket.
 
Last edited:

Veracity

Developer
Staff member
By the way - I thought I'd mention that this is the first KoLmafia script that I use that I didn't write for myself. Not that I use even self-written scripts, much at all.

Thanks Bale. You saved me at least 5 minutes of programming. ;)

(Which was not meant in a mean spirited manner at all. Consider it good-natured teasing. I DO use this script and do appreciate it.
 

Bale

Minion
Yay! Me so happy. Bale was patted on the head by Veracity-sama.


A small mod, for those of use with access to the clan hot-tub, was simply to add
I think I'll improve on that. It should also check to make sure that you actually have access to the VIP room before it tries to use the hot tub or else it's no good for some people. It should also check to see if you've already used up your 5 hot tubs for the day. While I'm at it, just make sure that no other healing has been at work or else it would be a waste to remove status and not heal HP. Finally, just as a mention you should know that there is an actual command for using the hot tub.

I'll upload that a little later after I've had a chance to test it.
 
Last edited:

Bale

Minion
Update!
New version adds support for Hot Tub.​
It checks if you've got the VIP key. If you do, then it will check if you've used it less than 5 times today -and- if you're reasonably low on HP. If the answers to both are yes, then it will soak away the slime. (Yeah, if you want to remove slime the odds are that you're really low on HP, but there are some rare cases where full HP healing would be wasted, such as clicking on the remove link next to the effect in the relay browser.)

 

Poki

New member
... -and- if you're reasonably low on HP. ...
Lovely update, but I see you've chosen current HP to be 1/6 of your max HP for triggering the hot-tub. Is this an arbitrary number? Would a "better" arbitrary number be the restore_hp trigger percentage, or would we then get scripts fighting each other to restore us?
 
Top