Universal Recovery Script

Theraze

Active member
My guess was that it was trying to remove one of the hippy effects I had which doesn't actually get removed by DPN. Besides UR, my only 2 scripts that use DPN are BCA, which only casts DPN during Bugbear runs, and get_skill, which only includes it as it's a skill so that you can learn it through the gCLI.

Maybe TPTB changed one of the effects to not be cured by DPN anymore?
Code:
	if(beset($effects[Apathy, Easily Embarrassed, Flared Nostrils, Prestidigysfunction, Tenuous Grip on Reality, 
	  The Colors...])
		skill_cure($skill[Disco Power Nap]);
Code:
	if(beset($effects[Cunctatitis, Tetanus, Socialismydia]) && !use_hot_tub()) {
		if(have_skill($skill[Disco Power Nap]))
			skill_cure($skill[Disco Power Nap]);
Code:
	if(beset($effects[Embarrassed, Sleepy]) && !use_hot_tub()
	  || (my_primestat() == $stat[Mysticality] && beset($effects[Confused, Light-Headed]))) {
		if(have_skill($skill[Disco Nap]))
			skill_cure($skill[Disco Nap]);
		else if(have_skill($skill[Disco Power Nap]))
			skill_cure($skill[Disco Power Nap]);
So that looks like:
Confused, Light-Headed (unlikely on those two, as I believe I have DN HP as well and it would have been used first)
Cunctatitis, Tetanus, Socialismydia, Apathy, Easily Embarrassed, Flared Nostrils, Prestidigysfunction, Tenuous Grip on Reality, The Colors...
 

Bale

Minion
According to the wiki Flared Nostrils can no longer be cured with DPN !


Universal recovery v 3.10.15 released!


Changelog:
version 3.10.154 August 6, 2013
  • Flared Nostrils can not be cured with Disco Power Nap!


Download Universal Recovery v3.10.15 here: View attachment 7842
(Universal_Recovery.ash goes in the /scripts folder)​
 

Veracity

Developer
Staff member
I was about to say that - based not on the Wiki, but on KoLmafia's internal list of what it will use DPN to remove. But, you beat me to it.

Looking at the Wiki, I see a new effect added since said internal list was made: Consumed by Fear. I'll add it.

FWIW, here is our new list:

removeWithSkillMap.put( "Disco Power Nap", removableEffects );
removableEffects.add( "Affronted Decency" );
removableEffects.add( "Apathy" );
removableEffects.add( "Confused" );
removableEffects.add( "Consumed by Fear" );
removableEffects.add( "Cunctatitis" );
removableEffects.add( "Embarrassed" );
removableEffects.add( "Easily Embarrassed" );
removableEffects.add( "Existential Torment" );
removableEffects.add( "Light Headed" );
removableEffects.add( "N-Spatial vision" );
removableEffects.add( "Prestidigysfunction" );
removableEffects.add( "Rainy Soul Miasma" );
removableEffects.add( "Sleepy" );
removableEffects.add( "Socialismydia" );
removableEffects.add( "Sunburned" );
removableEffects.add( "Tenuous Grip on Reality" );
removableEffects.add( "Tetanus" );
removableEffects.add( "The Colors..." );
removableEffects.add( "\"The Disease\"" );
removableEffects.add( "Wussiness" );
 

Bale

Minion
Actually, I'm not sure you should add that. It will automatically be acquired every time you adventure in Fear Man's Level if you don't have it. That'd be a waste of MP.

I believe it is automatically removed when you adventure elsewhere, but I'm not sure of my memory about that.
 

lostcalpolydude

Developer
Staff member
I believe it is automatically removed when you adventure elsewhere, but I'm not sure of my memory about that.

You can remove it for free by clicking on the face there. If you get those effects, then let rollover steal the couch before removing them, you're stuck with them (except for things like DPN being able to remove them, and the hot tub probably).
 

heeheehee

Developer
Staff member
Actually, I'm not sure you should add that. It will automatically be acquired every time you adventure in Fear Man's Level if you don't have it. That'd be a waste of MP.

I believe it is automatically removed when you adventure elsewhere, but I'm not sure of my memory about that.

It is not; I like to use it to test things that would otherwise require a low-level character.

(also, Unkillable Skeleton killing! Yay!)
 

Bale

Minion
You can remove it for free by clicking on the face there. If you get those effects, then let rollover steal the couch before removing them, you're stuck with them (except for things like DPN being able to remove them, and the hot tub probably).

Oh, right~! Thanks for reminding me. I knew there was a reason it stopped bothering me after I was done with it, but I was forgetting the detail. All the bad effects of that jar can be automatically removed at will by clicking on the center area.
 

Theraze

Active member
Just got a buy-bug similar to what it appeared r12385 was supposed to fix.
Restoring HP! Currently at 293 of 549 HP, 22 of 341 MP, current meat: 16996200 ... Target HP = 522.
Restoring MP! Currently at 293 of 549 HP, 22 of 341 MP, current meat: 16996200 ... Target MP = 69.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 250.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 250.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 250.
Tried it myself manually and got this:
> historical_price ancient magi-wipes

Returned: 120

> mall_price ancient magi-wipes

Returned: 120

> ash buy(1, $item[ancient magi-wipes], 120)

Searching for "ancient Magi-Wipes"...
Search complete.
Stopped purchasing ancient Magi-Wipes @ 250.
Returned: 0

> historical_price ancient magi-wipes

Returned: 250

> mall_price ancient magi-wipes

Returned: 250
So... not sure why UR fails it when it's doing it in a script. :( Something about that "Using cached search results" maybe?
 

Theraze

Active member
Question on the store limit code... does that makes it buy 2 when it only wants one item? It looks like this:
Code:
		int bought = buy(x, it, limit);
		if(bought > 0 && x != 1)
			return bought;
		return buy(1, it, limit);
if x is 1, would both buy an item when you do buy(1, it, limit) and when it passes through the if-check to the buy(1, it, limit) after. Should that maybe be if(bought > 0 || x == 1) return bought? Since if x == 1 and it failed to buy anything, you're just doing another repeat at trying to buy 1. If x != 1 and you didn't buy anything, that's when store limits might go into play...

This is unrelated to the bug in 2013 which looks like it might be a mafia bug, but I'm still trying to trace it out. That's a message from session\StoreManager.java but my brain doesn't have sufficient caffeine yet to process it fully.
 

Theraze

Active member
Interestingly, making the change I noted in 2015 does appear to fix the mafia-loop.
Code:
Restoring MP! Currently at 219 of 238 HP, 21 of 361     MP, current meat: 6428286 ... Target MP = 145.
Searching for     "ancient Magi-Wipes"...
Search complete.
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Stopped purchasing ancient     Magi-Wipes @ 250.
Using cached search results for ancient     Magi-Wipes...
Purchasing ancient Magi-Wipes (3 @ 250)...
You acquire     ancient Magi-Wipes (3)
Purchases complete.
Using 3 ancient     Magi-Wipes...
Before I made this change, I had gotten the following:
Code:
Restoring MP! Currently at 238 of 238 HP, 34 of 361     MP, current meat: 6428590 ... Target MP = 145.
Using cached     search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes     (3 @ 120)...
Stopped purchasing ancient Magi-Wipes @     250.
Using cached search results for ancient Magi-Wipes...
Purchasing     ancient Magi-Wipes (1 @ 120)...
You acquire an item: ancient Magi-Wipes
Purchases     complete.
Using 1 ancient Magi-Wipes...
You gain 59 hit points
You     gain 54 Mojo Points
Finished using 1 ancient Magi-Wipes.
Using     cached search results for ancient Magi-Wipes...
Purchasing ancient     Magi-Wipes (2 @ 120)...
Stopped purchasing ancient     Magi-Wipes @ 250.
Using cached search results for ancient     Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
You acquire     an item: ancient Magi-Wipes
Purchases complete.
Using 1 ancient     Magi-Wipes...
You gain 55 hit points
You gain 56 Mojo Points
Finished     using 1 ancient Magi-Wipes.
Using cached search results for ancient     Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
Stopped     purchasing ancient Magi-Wipes @ 250.
Using cached search results     for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (1 @ 120)...
KoLmafia     declares world peace.
I then made the change to if(bought > 0 || x ==1) and the script properly moved on the next time it needed to restore MP...
 

Bale

Minion
How are you planning to replace it? Or same functionality but ground-up rewrite?

From the ground up with same functionality. An entirely new script with an entirely original architecture. It will be smaller and easier to maintain. I expect it will run faster as well. The script also needs no special case handling code since it is designed so that all special handling goes in the data file for the restoratives making it easy for me to add new stuff.

if x is 1, would both buy an item when you do buy(1, it, limit) and when it passes through the if-check to the buy(1, it, limit) after.


Universal recovery v 3.10.16 released!


Changelog:
version 3.10.16 August 7, 2013
  • Bug fix for failed purchase if you only want one. Thanks Theraze!


Download Universal Recovery v3.10.16 here: View attachment 7850
(Universal_Recovery.ash goes in the /scripts folder)​
 

msde

New member
FYI: I've been having trouble with the script using scented massage oil to heal out of combat during ascension, and I want to save those for bosses. Thanks for the great script!
 

Theraze

Active member
Or tell mafia not to use them. UR should respect explicit allow/denials. At least, it appears to for me... it doesn't use red pixel potions or scented massage oils so that I can keep them for when I need them. :)
 
Top