Nyyrazzilyss / NyyLIB

Mudlet client script for Torilmud
http://www.torilmud.com/phpBB3/viewtopic.php?f=4&t=27194
GNU General Public License v2.0
7 stars 4 forks source link

A rescue attempt should try the WU power first, then RESCUE #371

Open byzanthia opened 1 week ago

byzanthia commented 1 week ago

WU doesn't cause lag, but RESCUE does.

Ideally, the rescue script should use WU first so the recipient isn't lagged. However, WU has a 3m cooldown, so the script should check if WU is available first. If not, then it should revert to just RESCUE.

byzanthia commented 1 week ago

I added this to line 49 of RescueScript:

    --try to use WU (warrior) or FR (blackguard) before sending rescue, to avoid lagging recipient
    if checkMask("war") == true then
      mud:send("WU " .. xchar)
    elseif checkMask("blk") == true then
      mud:send("FR " .. xchar)
    end

That's right before your existing line that sends mud:send("RESCUE " .. xchar)

There's probably a more efficient way so it checks some kind of timer to see if WU or FR is available rather than constantly try it. And it only works for blackguards and warriors so it probably needs to be updated for hex voidwalker rescues too, but it seems to work.

Would love an updated package btw, it's been a while :)