Page 240 of 241 FirstFirst ... 140 190 230 238 239 240 241 LastLast
Results 2,391 to 2,400 of 2408

Thread: Universal Recovery Script

  1. #2391
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,477

    Default

    It is recommended that users uninstall the OBE Universal Recovery
    Originally Posted by fronobulax View Post
    and then install the new.

    Code:
    svn checkout https://svn.code.sf.net/p/kolmafiascripts/mafiarecovery/code/
    But please, make your life easier and use the Scripts Menu the day after you update to r19385.
    Well, thank you.
    Originally Posted by Veracity View Post

  2. #2392
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,084

    Default

    Hello Frono: some thoughts on updates to the script if you're interested.

    Kingdom of Exploathing
    - Doc Galaktik's isn't an available location and the script tries to purchase anti-anti-antidotes
    - Medicinal Herb's medicinal herbs can't be purchased as the guild isn't unlockable

    Most of the Doc's or guild restores are switchable in the relay GUI but the antidote isn't one of them.

    I made the following change to lines 1572 - 1573

    Code:
    	if ($strings[Zombie,Dark Gyffte,Kingdom of Exploathing] contains my_path()) return true;	 // Paths where anti-anti-antidote isn't useful
    Bale preferred to use booleans but that would have meant more involved changes.

  3. #2393
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,477

    Default

    Hello Frono: some thoughts on updates to the script if you're interested.

    Kingdom of Exploathing
    - Doc Galaktik's isn't an available location and the script tries to purchase anti-anti-antidotes
    - Medicinal Herb's medicinal herbs can't be purchased as the guild isn't unlockable

    Most of the Doc's or guild restores are switchable in the relay GUI but the antidote isn't one of them.

    I made the following change to lines 1572 - 1573

    Code:
    	if ($strings[Zombie,Dark Gyffte,Kingdom of Exploathing] contains my_path()) return true;	 // Paths where anti-anti-antidote isn't useful
    Bale preferred to use booleans but that would have meant more involved changes.
    Originally Posted by Magus_Prime View Post
    Thanks. Could you give me more context? The complete file and I can diff or maybe before and after that shows enough context that I can see lines that do not change? Maybe I'm just brain dead but I don't think I have the right place.
    Well, thank you.
    Originally Posted by Veracity View Post

  4. #2394
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,084

    Default

    I don't have diff on this computer but I can supply more context. Change:

    Code:
    // This will cure poisoning. It will only fail if the character does not possess an antidote, or can't afford to buy one.
    // It will also attempt to keep a few spare anti-anti-antidotes in inventory, for emergency in-combat use.
    boolean unpoison() {
    	if(zombie)		 // Zombie Masters don't stay poisoned and cannot purchase antidotes.
    		return true;
    
    	// Am I poisoned?
    	boolean poisoned() {

    to

    Code:
    // This will cure poisoning. It will only fail if the character does not possess an antidote, or can't afford to buy one.
    // It will also attempt to keep a few spare anti-anti-antidotes in inventory, for emergency in-combat use.
    boolean unpoison() {
    	if ($strings[Zombie,Dark Gyffte,Kingdom of Exploathing] contains my_path()) return true;	 // Paths where anti-anti-antidote isn't useful
    	
    	// Am I poisoned?
    	boolean poisoned() {
    If I were more energetic I would have created booleans for Dark Gyffe and Kingdom of Exploathing and then gone through the entire script modifying the logic to include those checks where appropriate. If I were even more energetic I would have grouped the booleans into a general set of cases and refactored the script recovery logic so that it would be simpler to add exception cases in the future.
    Last edited by Magus_Prime; 08-17-2019 at 01:55 PM.

  5. #2395
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,477

    Default

    Thanks. The one liner seemed to work and has been committed.

  6. #2396
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,084

    Default

    UR checks the value of chateau_Available to determine availability of the Chateau but doesn't seem to check whether it is in standard or not. As a result UR keeps trying to use the Chateau to rest, and failing, when in a standard run.

    I don't have a one line fix for this one.

  7. #2397
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,477

    Default

    UR checks the value of chateau_Available to determine availability of the Chateau but doesn't seem to check whether it is in standard or not. As a result UR keeps trying to use the Chateau to rest, and failing, when in a standard run.

    I don't have a one line fix for this one.
    Originally Posted by Magus_Prime View Post
    :-(

    Is a workaround to manually set chateau_Available? Is this a KoLmafia bug because it is set to true even when it should not be?
    Well, thank you.
    Originally Posted by Veracity View Post

  8. #2398
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,119

    Default

    How does it check "is Chateau available"?

    Presumably it could also check "is_unrestricted( $item[ Chateau Mantegna room key ] )"

  9. #2399
    Senior Member
    Join Date
    Feb 2010
    Posts
    1,084

    Default

    At present the logic is:

    Code:
    int camp_hp = numeric_modifier("Base Resting HP") * (numeric_modifier("Resting HP Percent")+100) / 100 + numeric_modifier("Bonus Resting HP");
    int camp_mp = numeric_modifier("Base Resting MP") * (numeric_modifier("Resting MP Percent")+100) / 100 + numeric_modifier("Bonus Resting MP");
    int chateau_hp = 250; // Range is 200-300
    int chateau_mp = 125; // Range is 100-150
    Code:
    int rest_hp() {
    	if(get_property("chateauAvailable") == "false")
    		return camp_hp;
    	if(my_level() < 13)
    		return chateau_hp;
    	return max(camp_hp, chateau_hp);
    }
    int rest_mp() {
    	if(get_property("chateauAvailable") == "false")
    		return camp_mp;
    	if(my_level() < 13)
    		return chateau_mp;
    	return max(camp_mp, chateau_mp);
    }
    
    boolean rest() {
    	if(get_property("chateauAvailable") == "false" || (my_level() >= 13 && camp_mp > chateau_mp) )
    		return cli_execute("rest");
    	visit_url("place.php?whichplace=chateau&action=chateau_restbox");
    	return true;
    }
    If I type this in the gCLI:
    Code:
    prefref chateauAvailable
    I get "TRUE" as the value.

    I think "TRUE" is correct because I do have the chateau when out of standard. Inserting logic to check "is_unrestricted" is probably the way to go.

    In a perfect world we should probably add handling for the new campground item of the month as well.
    Last edited by Magus_Prime; 08-20-2019 at 04:55 PM.

  10. #2400
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,477

    Default

    I looked at mafia and it is pretty clear that mafia makes a distinction between availability and usability. So the solution looks to be to add the is_unrestricted check. I will try and do that later today.

Similar Threads

  1. Anecdote - Recovery Script not firing between auto-adventures?
    By fronobulax in forum Community Support
    Replies: 1
    Last Post: 02-20-2015, 07:36 PM
  2. Replies: 0
    Last Post: 09-21-2013, 05:50 PM
  3. what are all the ways mafia can consult a script? like recovery, breakfast
    By forgot my password in forum Scripting Discussion
    Replies: 5
    Last Post: 06-11-2009, 09:05 PM
  4. Recovery Script for Hardcore
    By Bale in forum Buff Upkeep Scripts
    Replies: 84
    Last Post: 03-04-2009, 08:17 AM
  5. Very New, Need a MP Recovery Script
    By Willie0248 in forum Scripting Discussion
    Replies: 2
    Last Post: 04-15-2006, 09:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •