Universal Recovery Script

zarqon

Well-known member
I think this means I have "arrived." My function library has become popular enough that now it's cool to not use it!

Author: "And I did it without using ZLib!"
Crowd: "Oooohhhh"

I think ZLib serves its purpose well (making life easier for scripters and users), but it does introduce more bloat than I'd originally intended it would -- script authors have generally been rather cavalier about adding ZLib vars to their scripts; more so than I'd prefer, at least. I don't think it's clear enough in the documentation that ZLib vars are loaded into every instance of ZLib and the decision to add another ZLib setting should be made with care and forethought. I usually remove all the vars for certain scripts when I'm not using them.

On the other other hand, the bloat probably costs the average user a handful of milliseconds.
 

fronobulax

Developer
Staff member
Personally I'd rather see a zLib preference than yet another mafia property. When everyone else dies and leaves me as the sole living person with commit access to SourceForge I'm going to make it so that script writers can set and read mafia properties but not create new ones. Then I'm going to have mafia delete all properties that it did not create. Luckily for users, veracity is within a couple years of me and I suspect that statistically her life expectancy is greater than mine. I believe Jason is significantly younger so my preference Ain't Gonna Happen.

Since I just hijacked a UR thread, let me say that I still love it. If Bale wanted to gild the lily I will note that I have gotten in trouble several times because I ascend and fail to reset my recovery preferences until I have already wasted turns or done something else stupid. (I sometimes have the same problem with a CCS, too). If UR detected I had just ascended a message would be useful. Yes, I know I should probably look at the New Life type scripts but...
 

Theraze

Active member
Yeah... doesn't newlife set recovery to 10% and so on? I always have to set it back immediately following an ascension so I don't end up trying to adventure with 1 hp, though mafia isn't aware of its values having been changed, since the display hasn't refreshed after the mafia values were changed.
 

Winterbay

Active member
It restores at 20% up to 95%. The scroll of drastic healing is the only box I have checked there, but it uses other things as it can override those settings.

If you've got plenty of adventures left it will only use the hot tub when you are at 10% of your maximum HP so that you can maximize your use of it.

If it won't get lower than 20% I foresee that it will have a hard time getting to the 10% it wants before it uses the hot tub.
 

Theraze

Active member
Hot tub restoration is now a part of mafia's healing as well, since Veracity included it in the patch-set. In mafia's internal handling, it'll use it if you have less than 50% of health and restorations available.

But that won't make it override the RecoveryScript settings.
 

Bale

Minion
I think this means I have "arrived." My function library has become popular enough that now it's cool to not use it!

LoL! Yeah, but I've been not using zlib since before it was cool to not use zlib. :D


If Bale wanted to gild the lily I will note that I have gotten in trouble several times because I ascend and fail to reset my recovery preferences until I have already wasted turns or done something else stupid. (I sometimes have the same problem with a CCS, too). If UR detected I had just ascended a message would be useful. Yes, I know I should probably look at the New Life type scripts but...

That is one of the things I put into newLife, but I'm curious how you think it could/should be implemented in UR. How do you think I should detect if you have recently ascended? Should I have a preference for current ascension and if it changes give you a message? What recovery settings do you want at the beginning of an ascension? Why should this be here instead of a postAscensionScript like newLife? I'm not expecting to change anything, but if I knew what you wanted it is possible I could change my mind.
 
Last edited:

fronobulax

Developer
Staff member
When I have ascended since the last time I saved UR parameters then please tell me. More realistically, a change in the current ascension could trigger a message. The reason it goes in UR is because I use UR, not NewLife. I could make a case either way but if it is in NewLife then it will be there for people who don't use UR. If it is in UR then it is potentially relavent for every UR user who Ascends.
 

Bale

Minion
Universal recovery v 3.77 released!


Changelog:
version 3.77 January 12, 2011
  • Checks for presence of spleen familiar before assuming spleen consumption (for some people's improved Hot Tub usage).
  • Executive Narcolepsy allows a free rest
  • Fixes healing in "no heal zones" such as the hidden temple when it is a fighting holiday like FoB or you have a hipster equipped.
 
Last edited:

Winterbay

Active member
That is one of the things I put into newLife, but I'm curious how you think it could/should be implemented in UR. How do you think I should detect if you have recently ascended? Should I have a preference for current ascension and if it changes give you a message? What recovery settings do you want at the beginning of an ascension? Why should this be here instead of a postAscensionScript like newLife? I'm not expecting to change anything, but if I knew what you wanted it is possible I could change my mind.

You could detect if your current level is lower than the last time it was called I guess.
 

StDoodle

Minion
When everyone else dies and leaves me as the sole living person with commit access to SourceForge I'm going to make it so that script writers can set and read mafia properties but not create new ones

Sorry for the threadjack Bale, but this will make custom daily properties pretty dang difficult. :( If the issue is code clarity / separation, why not just make it so that all "non-KoLmafia" preferences go to a separate file, perhaps "[username]_custprefs.txt" or similar?
 
On line 1351 calculate expected adventures from spleen usage.
You calculate the number of items usable by spleen remaining, modulo 4.
Code:
expec_adv += ((spleen_limit() - my_spleen_use()) % 4 * 1.88);
Modulo returns the remainder though, I'm pretty sure that what you meant was:
Code:
expec_adv += (floor((spleen_limit() - my_spleen_use()) / 4) * 1.88);

A quick example
Code:
> ash (3 % 4)
Returned: 3
> ash floor(3 / 4)
Returned: 0
 

Bale

Minion
Of course that was what I meant. I know the difference between division and modulo.


Universal recovery v 3.78 released!


Changelog:
version 3.78 January 13, 2011
  • Fixed stupid idiot error because I'm a moron.
 
Last edited:

Bale

Minion
So there wasn't. I had a dream where there was a sewer in seaside town. Obviously that makes no sense since the only sewer that ever existed in this game is a terrifying place full of CHUMs and gators.

Thank you for calling my delusion to my attention.
 

Winterbay

Active member
I find this to be rather odd:

Code:
> restore hp

Casting Tongue of the Otter 1 times...
You gain 12 hit points
You lose an effect: Beaten Up
Tongue of the Otter was successfully cast.
Purchasing some palm-frond fans for use as a combat restorative.
Searching for "palm-frond fan"...
Purchasing palm-frond fan (3 @ 285)...
You acquire palm-frond fan (3)
Purchases complete.
Restoring HP! Currently at 12 of 190 HP, 138 of 145 MP, current meat: 37137 ... Target HP = 190.
Visiting Relaxing Hot Tub in clan VIP lounge
You gain 178 hit points

It first removes beaten up with a cast of tongue of the otter and then restore HP with help from the Hot Tub which would've removed beaten up as well thus "wasting" the cast of tongue of the otter.
 

Bale

Minion
WTF? That make no sense on two accounts:
1. The first thing my script does in cure_beatenup() is to try the hot tub!
2. It also makes no sense because my script removes beaten up AFTER it gets combat restoratives, not before.

Can you check your preferences for me? Go to Preferences -> General -> "Auto-remove malignant status effects". Verify that you turned that off. Also verify that you don't have anything in your mood that would cast tongue of the otter if you have beaten up. I suspect one of these two things is the real culprit.
 

Bale

Minion
I'm glad I was able to assist you. Sometimes I think UR should forcibly turn that option off regardless of what the user desires, but unfortunately people might actually want it for other negative status effects which it does not handle. I think it is bad, but that's not really up to me.
 
Top