Universal Recovery Script

jokermage

New member
Do you have an archived copy of 2.6? I was using that before I updated Ubuntu with no problems. If I still have problems, then that would certainly point to Ubuntu 9.04 being the source of the problem.

EDIT: Another thought. Ubuntu can use two different java runtimes. Right now I'm running the .jar through OpenJDK. Maybe I can get more favorable results from Sun's runtime? It's as worth trying as anything else.

EDIT2: I checked the Ubuntu forums and there were a couple complaints about the implementation of OpenJDK in 9.04. So tonight I'll try URS 2.7 in r7208 using Sun Java Runtime before trying anything else.
 
Last edited:

Bale

Minion
Do you have an archived copy of 2.6? I was using that before I updated Ubuntu with no problems. If I still have problems, then that would certainly point to Ubuntu 9.04 being the source of the problem.
Here's my archive of v2.6. It's got 2.6 in the name so either rename it or else change the name of your recovery script. I like to give my archive copies different names for an obvious reason. ;)

EDIT2: I checked the Ubuntu forums and there were a couple complaints about the implementation of OpenJDK in 9.04. So tonight I'll try URS 2.7 in r7208 using Sun Java Runtime before trying anything else.
If that works out then perhaps you won't have any need for v2.6, but I'm attaching it anyway, just to be thorough.
 

Attachments

  • Universal_recovery 2.6.ash
    56.7 KB · Views: 46

jokermage

New member
v2.6 seemed to work fine, even in OpenJDK. Unless you have figured out something, I think we should just attribute this to phantasms haunting my computer.
 
Last edited:

Bale

Minion
v2.6 seemed to work fine, even in OpenJDK. Unless you have figured out something, I think we should just attribute this to phantasms haunting my computer.

But... but... check out line 958 in v2.6... it's the same as line 984 in version 2.7... Your computer is Haunted!!
 

jokermage

New member
Wonderful. v2.6 just failed while I was using r7213. It looks like the "Blame Ubuntu" theory is valid after all. If you'll excuse me, I'm going to curse the heavens now.
 

Bale

Minion
New item of the month... Oh my, oh my. I'm going to have to add that hot tub to my script as soon as mafia can support it. Heals all HP 5 times per day.

This makes hardcore easier.

Wonderful. v2.6 just failed while I was using r7213. It looks like the "Blame Ubuntu" theory is valid after all. If you'll excuse me, I'm going to curse the heavens now.
I'm sorry for the heavens getting cursed at that way, but happy I wasn't the source of your trouble. Does it work when you use the other form of java?
 

jokermage

New member
I'm going to go without the script, at least until I'm done with the set of HCO runs I'm working on. If Ubuntu updates the JRE's, I'll give it another try.
 

Rinn

Developer
I was looking through your script and I found a logic bug in the mp_gear() function:

Code:
item [8] mana_item;
        mana_item[1] = $item[plexiglass pocketwatch];
        mana_item[2] = $item[jewel-eyed wizard hat];
        mana_item[3] = $item[navel ring of navel gazing];
        mana_item[4] = $item[stainless steel solitaire];
        mana_item[5] = $item[woven baling wire bracelets];
        mana_item[5] = $item[solid baconstone earring];
        mana_item[7] = $item[baconstone bracelet];
You used index 5 twice in lieu of 6 so you're blasting over the woven baling wire bracelets with the solid baconstone earring and leaving index 6 empty.

On that note the loop that follows that array 'for i from 1 upto 7' would have to be updated if any more mana reducing items are added, it could be made generic by instead using 'foreach i in mana_item'. The same can be held true for any other for loop where you're iterating through an array or map making it so you don't have to worry about the actual contents. The only caveat is that you'll have to properly use the 0 index of an array since it's preallocated with default values (in this case $item[none]) so foreach would loop through all 8 indices, but you'll also be able to allocate smaller arrays since you're not wasting the first index.

It's not a huge deal, I just noticed you have a habit of starting arrays with an index of 1.
 
Last edited:

Bale

Minion
Thanks for catching that. Incidently I left 0 open for the Brimstone Bracelet that I'm currently handling separately. Maybe a little wasteful, but... I do have that odd habit of starting counting with 1 even though I know it is inappropriate.
 

StormCrow42

Member
The latest version of the script seems to be using up my red pixel potions on me, even though I don't have funkslinging. It even did so after I unchecked the red pixel potion box.
 

Bale

Minion
The latest version of the script seems to be using up my red pixel potions on me, even though I don't have funkslinging. It even did so after I unchecked the red pixel potion box.

Oh. Sh17! I think I just found the problem. It's a really tricky little bug and I'm going to have to think about how to fix it...

Question: Just to make sure I found the issue, does it only use them one at a time? The bug I found will only use 1 at a time. It will also use up gauze garters and filthy poultices... Troublesome little thing.

Edit: Figured out what to do, but it will take a bit.
 
Last edited:

StormCrow42

Member
Question: Just to make sure I found the issue, does it only use them one at a time? The bug I found will only use 1 at a time. It will also use up gauze garters and filthy poultices... Troublesome little thing.

As far as I've seen, it has only used one at a time. It hasn't ruined a speed run for me or anything, thanks for all your hard work on this :)
 

Bale

Minion
Universal recovery v 2.71 released!

Changelog:
version 2.71 May 2, 2009
  • Lots of bug fixing.

Here's release 2.71, it's not much tested, but it should fix that pixel potion problem along with a bunch of other bugs I've found. Lots of bug fixing. Version 2.8 will script Hot Tub use if you have VIP access! I'm just waiting for mafia to fully support it. :D
 

psly4mne

Member
In 2.7, MP recovery in HC mode loops infinitely if you don't have a KGE uniform. I don't know if that was one of the bugs you fixed, but I can't check since I have the uniform now. Otherwise, great update.
 

Bale

Minion
Wait, I know it doesn't loop infinitely without a KGE uniform, because I've already been there in HC and no loop. There must have been some other factor involved in making that happen... I've taken a look at the code and touched up a few possible problems that might have caused a loop maybe.
 

psly4mne

Member
Wait, I know it doesn't loop infinitely without a KGE uniform, because I've already been there in HC and no loop. There must have been some other factor involved in making that happen... I've taken a look at the code and touched up a few possible problems that might have caused a loop maybe.
It started working as soon as I got the uniform, so I know that was part of the cause. Could it be that my settings related to reserve purchasing are different?

I was able to duplicate the bug under 2.71 by closeting my KGE uniform, using up all my restoratives, and attempting to restore mp.

EDIT: I've found the problem. The "repeat" loop in purchase_mp loops infinitely if none of the restoration methods are available. I have Galaktik's Tonic unchecked in my settings. Line 974 should read "done=true" instead of "done=false".

Also, galaktik() doesn't properly handle the case where you don't have enough meat to restore 1 hp/mp. To fix, make the following changes:
line 769: if(doit && amount > 0)
delete line 1007
 
Last edited:

Bale

Minion
All of the above are now fixed.
Universal recovery v 2.72 released!

Changelog:
version 2.72 May 4, 2009
  • More bugfixes.
 
Top