Page 239 of 239 FirstFirst ... 139 189 229 237 238 239
Results 2,381 to 2,381 of 2381

Thread: Universal Recovery Script

  1. #2381
    Senior Member
    Join Date
    Oct 2017


    I believe I have found the issue. The function mall_quant determines the number of mall items needed to restore. It returns a floating point (unlike the function used for looking at inventory inside ronin which returns an integer).

    So, if you are trying to heal 50 HP (an amount that is passed to the mall_quant function), the item bullpup tent which restores 1000 HP will return 50/1000 = 0.05 bull pup tent quantity needed to restore 50 HP.

    The function is used in 3 places. In meat_to_mp function where it is rounded up via ceil.
    In the function to actually use the item where it is rounded up
    And in the function that determines the best mall item "best_mall" which fails to round it up

    So in the above scenario where bullpup tent costs 1900, "best_mall" will, for determining which item is best, internally calculate that the cost to heal 50 HP using a quantity of bullpup tents as = 1900 * 0.05 = 95 meat
    However, the cost to restore is not 95 meat because you cannot consume a fraction of an item, it is 1900. This item should not be the chosen result of the best_mall function. And costs should not be calculated based on fractions of an item. The function was obviously designed with multi using items that heal much much less.

    Because it does get rounded up for MP restoring, and skills are used by default when possible, this is only an issue if someone is playing in casual, aftercore, or after ronin, and has 0 known healing skills. As such, it was not really noticed until I started a brand new multi that tried to use this script from day 1 of the account existing.

    I am currently trying to decide exactly how to fix it while ensuring I don't break anything else. I am honestly not sure what the point is in having mall_quant return a floating point instead of having it automatically ceil inside the function itself. It gets ceil in every usage except one... in which case it should have been ceil and the fact it isn't is the cause of this bug...

    Incidentally, it is quite lucky I had my multi stuck in a super long glover HC ascension (I was trying to see the worst glover one can have... HC with 0 skills permed)
    I am going to have to make sure NOT to perm a healing skill, and ascend into softcore in order to test possible fixes for this issue

    Also, because the way the logic works this is very much an edge case, not a common issue like I thought. And not exactly easy to test since perming a healing skill is one of the first thing people often do. edit: its only an edge case for HP recovery, it actually does affect the MP recovery functionality too.

    Also, it will take days (and an annoying inefficient detour, I need to not perm a healing skill, and ascend into casual or get into aftercore without buying a healing skill in run) before my multi is even set up such that I can even start testing fixes. So I will get back to this when I have it set up.
    Last edited by taltamir; 09-17-2018 at 10:15 PM.

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