Bug - Won't Fix Current MP does not update before execution of post-adventure script

ereinion

Member
It seems that my current mp is not updated before my post-adventure script runs, unless I am misunderstanding something really obvious. It does, however, update somewhere after that point, so not really a huge issue. I dunno if it may actually be a feature be a feature because there may be events that restores mp after that point? Nevertheless, I would really appreciate it if this update happened a bit earlier, it would make my mp-management a little bit easier :)
Code:
void manaburn() {
    float mp_target = to_float(get_property("mpAutoRecoveryTarget"));
    print("my_mp: " + my_mp() + " - my_maxmp: " + my_maxmp() +  " - 0.8*my_maxmp: " + 0.8*my_maxmp());
    print(to_boolean(my_mp() >= 0.8*my_maxmp()));
    print(to_boolean(mp_target < 0.8));
    if (my_mp() >= 0.8*my_maxmp() && mp_target < 0.8) {
        print("Test");
        if (my_path() == "Avatar of Boris" && my_hp() < 0.9*my_maxhp()) {
            print(min(to_int((my_maxhp()-my_hp())/1.5), to_int(my_mp() - my_maxmp()*mp_target)), "blue");
            use_skill(min(to_int((my_maxhp()-my_hp())/1.5), to_int(my_mp() - my_maxmp()*mp_target)), $skill[Laugh it Off]);
        }
        cli_execute("burn " + to_int(my_mp() - my_maxmp()*mp_target));
    }
}
 

Veracity

Developer
Staff member
Are you automating or running in the relay browser? Ignoring for the moment that we should be tracking your MP usage, we will update your current MP from either a charpane refresh - suggested by KoL and done by the browser some time after t receives the response - or an api.php refresh - if KoL suggests a charpane refresh and we are automating.

I expect that the spi.php refresh happens before the after adventure script runs, but if you are running in the Relay Browser, the charpane refresh comes after it runs.

I don't think there's anything we can do about that; we will not do a redundant api.php request when we know that the browser will be requesting the charpane, and I think it would be incorrect to delay running the after adventure script until the browser eventually refreshes the charpane.

Now lets return to the "we should be tracking your MP usage". What did you do with your MP during the adventure that left us unsure of how much your current MP was?
 

ereinion

Member
Yeah, I am running in the relay browser.

Stuff that happened which influenced my MP:
  • Regen from equipment and passive skills (chef's hat, staff of the headmaster's victuals, thor's pliers and inner sauce): 12-17 mp
  • MP spent on skills (weaksauce, saucegeyser): -32 mp
  • Regen from weaksauce/saucegeyser: 36 mp
  • Oh, and I used the CSA fire-starting kit to give mp/hp regen earlier today
And I am pretty sure that was it. No idea which part of that mafia failed to catch, the discrepancy of 26 mp from what was reported by the script doesn't really match any of those values very well...

Just in case it matters, I had a combat macro set to auto-attack, so I didn't take any manual actions during combat.
 

Veracity

Developer
Staff member
OK. We cannot track variable MP regen except by letting KoL tell us what happened via the charpane or api.

As I said, if you automate, the after adventure script runs after the call to api.php, so all will be cool, but in the Relay Browser, the browser's charpane refresh is asynchronous; it could happen before, during, or after we start the after adventure script.

I suspect that this Bug Report gets a Won't Fix.
 
Top