[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Altering Nick Gammons "Improved Health Bar" plugin to work with Midkemia Online
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Altering Nick Gammons "Improved Health Bar" plugin to work with Midkemia Online

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Kaimarae   (34 posts)  [Biography] bio
Date Mon 23 May 2011 06:21 AM (UTC)
Message
Hey there.

My mission currently is to get Nick's health bar plugin to work for my prompt, which is:

935h, 236e, 1033m xb A:50% -


and I'm matching it with this:

^(\d+)h, (\d+)e, (\d+)m x?b?.*$


I sort of understand how it all works. My issue is my prompt doesn't give me a current/max display. Just the current. I already have a variable that tracks my max hp (for use in a info bar display). I'm sure it's possible, but I don't know how to get the plugin to use my MaxHealth variable instead of the local max_hp.

For the sake of clarity, this is an extract from the .xml I'm currently using, cut down to size for the post (I took out the bits I could see regarding the Move variables and gauge as I don't have movement points):


function do_prompt (name, line, wildcards)

  local hp, max_hp = tonumber (wildcards [1]), tonumber (wildcards [2])
  local mana, max_mana = tonumber (wildcards [3]), tonumber (wildcards [4])
    
  local hp_percent = hp / max_hp
  local mana_percent = mana / max_mana


Instead of max_hp taking it's value from a wildcard I want it to either replace it or get it to get it's value from an existing variable.

Currently, when I enable it, it just says
Quote:
Trigger function "do_prompt" not found or had a previous error.


Thanks in advance guys :]
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 23 May 2011 06:26 AM (UTC)
Message
I don't know why you got the error without seeing more of it, but to get the maxmima just change it to something like:


  local hp, max_hp = tonumber (wildcards [1]), 
                     tonumber (GetVariable ("MaxHealth"))


Ditto for the other one(s).

Then of course wildcard 3 becomes wildcard 2 (because you don't have the maximum).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Kaimarae   (34 posts)  [Biography] bio
Date Reply #2 on Mon 23 May 2011 06:32 AM (UTC)
Message
Altered that. No idea if it works as I'm still getting the error.

This is the whole of the .xml:

http://pastebin.com/xSejVybc
[Go to top] top

Posted by KaVir   Germany  (117 posts)  [Biography] bio
Date Reply #3 on Mon 23 May 2011 12:13 PM (UTC)
Message
Doesn't Midkemia Online support GMCP? That should be cleaner and easier than capturing the data from the prompt.
[Go to top] top

Posted by Kaimarae   (34 posts)  [Biography] bio
Date Reply #4 on Mon 23 May 2011 01:50 PM (UTC)
Message
Yes, it does and I have a GMCP plugin installed, but currently I'm still figuring things out. After I have it up and running I'll look at better ways to go about it.
[Go to top] top

Posted by Kaimarae   (34 posts)  [Biography] bio
Date Reply #5 on Tue 24 May 2011 04:49 AM (UTC)
Message
I'm still getting the

Quote:
Trigger function "do_prompt" not found or had a previous error.


error whenever I try and use it. Really want to fix it, but I have no idea what's going on. :/
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 24 May 2011 07:58 AM (UTC)
Message
Do you see any error message? What are they? Which version of MUSHclient are you using?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


5,849 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] 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.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]