Universal Recovery Script

zarqon

Well-known member
I'm asking this here since it's somewhat related -- also I figure the people most likely to know are reading this. :)

Is there a way to detect that an item is an out-of-combat HP/MP restorer? I've had plans for a while to make BatBrain ignore HP/MP profit from out-of-combat restorative items, since that profit is just as easily achieved out of combat. I'd rather not take the hit loading UR's recovery map. The other possibility I've been considering is a keyword flag for these items in BatBrain's data file, but if there's an easier way to get that information it would be helpful.

Technically, for people using UR, no out-of-combat item should be seen as actually profitable, since UR sets the _meatper properties after using the best valued item, but I've found that's not always the case; and when it's not, it looks a little silly for SS to start recommending MMJ or somesuch as a stasis action.
 

lostcalpolydude

Developer
Staff member
Are there items that give HP/MP in combat, are usable out of combat, and don't give HP/MP outside of combat? I can't think of any, which means you could simply check to see if the item is usable (I think that's a separate proxy field from combat, but I can't check for sure right now).
 

Magus_Prime

Well-known member
This has happened to me twice now. When Zarqon's BestBetweenBattle script fires and calls UR. As a restorative UR decides to use a blue potion from the Gamer Pro dungeon this has happened:

Code:
Restoring MP! Currently at 254 of 254 HP, 91 of 526 MP, current meat: 6035 ... Target MP = 263.
Using 3 blue potion...
Finished using 3 blue potion.
Using 3 magical mystery juice...
You gain 79 Mana Points
Finished using 3 magical mystery juice.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...
Finished using 2 blue potion.
Using 2 blue potion...

This is just a snippet. It just looped in the gCLI until I hit <ESC>. It seems to happen early in an ascension when the character is light on restoratives. I have 5 blue potions in inventory but none are used during the looping. Closeting the potions works around the issue.

Any thoughts?
 
Last edited:

zarqon

Well-known member
To follow up on my previous question, I ran into a few more problems with lost's otherwise lovely suggestion (such as MMJ not being "usable"). However, I discovered ASH's item_type() gives me the info I need:

> ash foreach i in $items[] if (i.combat && contains_text(item_type(i),"restore")) print(i+" ("+item_type(i)+")")

Doc Galaktik's Pungent Unguent (hp restore)
Doc Galaktik's Ailment Ointment (hp restore)
Doc Galaktik's Restorative Balm (hp restore)
Doc Galaktik's Homeopathic Elixir (hp restore)
Knob Goblin seltzer (mp restore)
Knob Goblin superseltzer (mp restore)
Dyspepsi-Cola (mp restore)
Mountain Stream soda (mp restore)
red pixel potion (hp restore)
blue pixel potion (mp restore)
green pixel potion (hp+mp restore)
cast (hp restore)
magical mystery juice (mp restore)
forest tears (hp restore)
Cloaca-Cola (mp restore)
unrefined Mountain Stream syrup (mp restore)
bottle of Monsieur Bubble (mp restore)
filthy poultice (hp restore)
gauze garter (hp restore)
New Cloaca-Cola (mp restore)
palm-frond fan (hp+mp restore)
high-pressure seltzer bottle (mp restore)
cartoon heart (hp restore)
gold star (mp restore)
red potion (hp restore)
blue potion (mp restore)
extra-strength red potion (hp restore)
fancy blue potion (mp restore)
Returned: void

That looks just right to me.
 

Magus_Prime

Well-known member
Some fuzzy matching warnings from UR:

Code:
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 580)
Changing "slime tube" to "The Slime Tube" would get rid of this message (Universal_recovery.ash, line 835)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 886)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 911)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 968)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 1126)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 1171)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 1207)
Changing "Knob Shaft (mining)" to "The Knob Shaft (Mining)" would get rid of this message (Universal_recovery.ash, line 1457)
Changing "Form of...Bird" to "Form of...Bird!" would get rid of this message (Universal_recovery.ash, line 1473)
 

Bale

Minion
Universal recovery v 3.10.12 released!


Changelog:
version 3.10.12 July 25, 2013
  • Fuzzy Matching fix


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

Bale

Minion
My "bigger plans" are coming along nicely. Here's a section of the data file:

Code:
Wint-O-Fresh mint	item	0	0	4	5	
Wolfman Nardz	item	0	0	250	300	
your own black heart	item	maxhp	maxhp	maxmp	maxmp	

beer-scented teddy bear	item	0	0	17.5	20	pref:questM10Azazel=="finished"
comfy pillow	item	25	30	0	0	pref:questM10Azazel=="finished"

heart of dark chocolate	item	45	50	0	0	pref:_darkChocolateHeart
Platinum Yendorian Express Card	item	0	0	maxmp	maxmp	pref:expressCardUsed
Oscus's neverending soda	item	0	0	250	300	pref:oscusSodaUsed

pseudo New Cloaca-Cola	pseudoitem	0	0	150	160	item#2449*6
pseudo palm-frond fan	pseudoitem	40	45	40	45	item#2605*0.5
pseudo really thick bandage	pseudoitem	110	120	0	0	item#2634*0.5
Neat, eh? The data file actually provides all the special case information. Some of that was a little tricky to work out.

The script is nearly ready for me to actually try using it soon.
 

Razorsoup

Member
I've had this happen a couple times now:
Code:
Restoring MP! Currently at 1412 of 1412 HP, 269 of 540 MP, current meat: 355764 ... Target MP = 486.
Searching for "ancient Magi-Wipes"...
Search complete.
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Searching for "ancient Magi-Wipes"...
Search complete.
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...
Purchasing ancient Magi-Wipes (4 @ 120)...
Stopped purchasing ancient Magi-Wipes @ 245.
Using cached search results for ancient Magi-Wipes...

There is a store selling ancient Magi-Wipes for 120 limited to 8. When I try to manually buy 4 from this store, I get the following message:
You may only buy 8 of this item per day from this store. You have already purchased 5 in the last 24 hours.
If I manually purchase the three available magi-wipes, UR starts to work correctly again.

Also, the issue with blue potions posted about by Magus_Prime still happens to me every once in a while.
 
Last edited:

rlbond86

Member
I'm having an issue:

Restoring HP! Currently at 306 of 948 HP, 638 of 1131 MP, current meat: 2704700 ... Target HP = 759.
Using 2 extra-strength red potion...
Finished using 2 extra-strength red potion.
Using 5 red potion...
Finished using 5 red potion.
Using 8 cartoon heart...
Finished using 8 cartoon heart.
Using 2 extra-strength red potion...
Finished using 2 extra-strength red potion.
Using 5 red potion...
Finished using 5 red potion.
Using 8 cartoon heart...
Finished using 8 cartoon heart.
Using 2 extra-strength red potion...
Finished using 2 extra-strength red potion.
Using 5 red potion...
Finished using 5 red potion.
Using 8 cartoon heart...

It keeps going on like this until I click "stop now".
 

Bale

Minion
A few questions.

rlbond86, are you using BestBetweenBattle? Are those potions actually being expended? Does closeting the potions make the problem go away?


rlbond86 & Magus_Prime, did you set UR to "Prefer using inventory instead of mall, regardless of value"?
 

Magus_Prime

Well-known member
I do not have that UR setting active.
I do have "never abort automation" set in UR.
I am using Zarqon's BestBetweenBattle script.
The items "looping" are not consumed.
Closeting the item or items "fixes" the problem.
 

Razorsoup

Member
Don't know if this matters for the blue potion issue but blue potions are not multi-usable. And this seems like it may be more a mafia problem than a UR problem. From my gCLI:

Using 1 blue potion works fine. Using 5 does nothing.
> use 1 blue potion

Using 1 blue potion...
You gain 55 Mana Points
You acquire an effect: Healthy Blue Glow (duration: 20 Adventures)
Finished using 1 blue potion.

> use 5 blue potion

Using 5 blue potion...
Finished using 5 blue potion.
 
Top