Best way to make a health bar without a every tick prompt?

Posted by MythicalPlatypus on Tue 29 May 2018 06:33 PM — 2 posts, 11,470 views.

#0
So this isn't exclusively for a health bar but is there any way of tracking health when the game doesn't display HP every refresh (Like aardwolf does).

The only way of checking your own health is by typing "he"
Which displays

Mana:         0 / 0
Vitality:     158 / 159
Status:       Healthy

and the only way of checking others health is typing gr and it displays

Your group currently consists of:
  Guran                          (F) [HE:100% ST:Ready]
  Jinx                           (F) [HE: 98% ST:Ready]
  Platy                          (F) [HE:100% ST:Ready]
  Meeps                          (F) [HE:100% ST:Ready]
  Magica                         (F) [HE:100% ST:Ready]
  Lodie                          (L) [HE:100% ST:Ready]


Would you have to have the script type it in, hide it somehow and then capture the values from it and display it elsewhere?

Thanks for any input!
Australia Forum Administrator #1
Often games let you configure your prompt to display that stuff, but if you can't, yes you could make a timer or alias that sends the appropriate command, and then activates a trigger (or three) that capture the results, omitting them from output. Once you have all three lines the trigger that receives the third line could deactivate all three triggers so you can "manually" get your health at other times.

There is an example health bar plugin here:

http://www.gammon.com.au/forum/?id=9270

The capturing part would need to be different, obviously, but the bulk could be the same.

If you use a timer, don't overdo it, which could slow both you and the server down. Once every 10 or 20 seconds should be plenty.

Another possibility would be to keep a running total, and amend it based on other messages, for example if you get a message about losing 20 HP then you could subtract 20 from your known HP amount.