Theraze
Active member
I've been manually setting the verbosity by editing the script like so:
That way I know it's running with the verbosity, and once I replace the script with a new version, I don't need to change my properties again. Running with that one:
Edit: It can obviously find the skills when manually prodded...
Spliced in a bit more logging, specifically this:
Yep. Worked fine as long as it was using bite. But then...
Maybe a mafia bug?
And... hackfix that works:
Replaces the use_skill in cast().
Code:
#int Verbosity = get_property("baleUr_Verbosity").default_int(1);
int Verbosity = 3;
It's obviously this version, since it posts the version number on top. It's also obviously using Verbosity 3, since we see the "Trying to fullheal" message, which only shows at Verbosity 3.> ashq restore_hp(0)
Calling Universal Recovery 3.10.5.2 for type=HP, amount=0
Restoring HP! Currently at 35 of 303 HP, 16 of 16 MP, current meat: 53265 ... Target HP = 288.
Trying to fullheal
Try to heal HP from inventory.
Trying to fullheal
Try to heal HP with skills.
Last attempt to purchase HP with meat.
Recovery target reduced to healing trigger (196)to conserve meat.
Did not fully restore HP for some reason.
> inv brain
crappy brain (84)
good brain (8)
hunter brain
Edit: It can obviously find the skills when manually prodded...
> ash import <Universal_Recovery.ash> populate_skills(100); find_cheapest_skill(100);
Returned: Bite Minion
level => 1
traincost => 0
class => Zombie Master
libram => false
passive => false
buff => false
combat => false
song => false
permable => false
dailylimit => -1
timescast => 109
> ash import <Universal_Recovery.ash> populate_skills(288); find_cheapest_skill(288);
Returned: Devour Minions
level => 6
traincost => 0
class => Zombie Master
libram => false
passive => false
buff => false
combat => true
song => false
permable => false
dailylimit => -1
timescast => 1
Spliced in a bit more logging, specifically this:
Code:
if(Verbosity > 2) print("Need "+(skills[cheap_skill].mp * q)+" MP to cast that skill.");
if(mp_heal(skills[cheap_skill].mp * q))
old = old - 1; // mp restoration may have restored hp. Do another iteration and recalc
}
if(Verbosity > 2) print("Need "+(skills[cheap_skill].mp * q)+" MP to cast "+cheap_skill+" "+q+" times.");
switch {
case my_hp() >= target: // Success!
Not sure why it's failing to cast Devour Minions... on 11441. I can manually cast it, like so:> ash restore_hp(0)
Calling Universal Recovery 3.10.5.2 for type=HP, amount=0
Restoring HP! Currently at 35 of 303 HP, 16 of 16 MP, current meat: 53265 ... Target HP = 288.
Trying to fullheal
Try to heal HP from inventory.
Trying to fullheal
Try to heal HP with skills.
Need 4 MP to cast Devour Minions 1 times.
Need 4 MP to cast Devour Minions 1 times.
Last attempt to purchase HP with meat.
Recovery target reduced to healing trigger (196)to conserve meat.
Did not fully restore HP for some reason.
Returned: true
After manually casting devour, restoration worked again...> cast devour minion
Casting Devour Minions 1 times...
Installing default certificate validation...
Validating login server (www.kingdomofloathing.com)...
726 players online.
Sending login request...
Synchronizing moon data...
You gain 151 hit points
Devour Minions was successfully cast.
Looks like the problem happens when UR needs to use devour? Guess I'll let it run a bit more and see if I get back to fail-state. Since it's fully healed now...> ash restore_hp(0)
Calling Universal Recovery 3.10.5.2 for type=HP, amount=0
Restoring HP! Currently at 186 of 303 HP, 12 of 12 MP, current meat: 53265 ... Target HP = 288.
Trying to fullheal
_meatperhp => 0.26666666666666666
Casting Bite Minion 1 times...
You gain 30 hit points
Bite Minion was successfully cast.
Try to heal HP from inventory.
Trying to fullheal
Try to heal HP with skills.
Casting Bite Minion 2 times...
You gain 60 hit points
Bite Minion was successfully cast.
Need 2 MP to cast Bite Minion 2 times.
baleUr_HPtrouble => false
Returned: true
Yep. Worked fine as long as it was using bite. But then...
> ash restore_hp(0)
Calling Universal Recovery 3.10.5.2 for type=HP, amount=0
Restoring HP! Currently at 42 of 303 HP, 16 of 16 MP, current meat: 53784 ... Target HP = 288.
Trying to fullheal
Try to heal HP from inventory.
Trying to fullheal
Try to heal HP with skills.
Need 4 MP to cast Devour Minions 1 times.
Need 4 MP to cast Devour Minions 1 times.
Last attempt to purchase HP with meat.
Recovery target reduced to healing trigger (196)to conserve meat.
Did not fully restore HP for some reason.
Returned: true
Maybe a mafia bug?
> my_hp
Returned: 42
> ash use_skill(1, $skill[devour minion])
Returned: true
> my_hp
Returned: 42
And... hackfix that works:
Code:
return cli_execute("cast "+q+" "+it);
Last edited: