Gammon Forum
Entire forum
MUSHclient
General
Best way to make a health bar without a every tick prompt?
Best way to make a health bar without a every tick prompt?
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| MythicalPlatypus
(3 posts) bio
|
Date
| Tue 29 May 2018 06:33 PM (UTC) |
Message
| 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! | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #1 on Tue 29 May 2018 09:31 PM (UTC) Amended on Tue 29 May 2018 09:32 PM (UTC) by Nick Gammon
|
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
7,589 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.