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

Gammon Software Solutions 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?
(New message)
Subject: Altering Nick Gammons "Improved Health Bar" plugin to work with Midkemia Online
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 24 May 2011 07:58 AM (UTC)  quote  ]
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

Posted by Kaimarae   (34 posts)  [Biography] bio
Date Tue 24 May 2011 04:49 AM (UTC)  quote  ]
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 Kaimarae   (34 posts)  [Biography] bio
Date Mon 23 May 2011 01:50 PM (UTC)  quote  ]
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 KaVir   Germany  (114 posts)  [Biography] bio
Date Mon 23 May 2011 12:13 PM (UTC)  quote  ]
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 Mon 23 May 2011 06:32 AM (UTC)  quote  ]
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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 23 May 2011 06:26 AM (UTC)  quote  ]
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 Mon 23 May 2011 06:21 AM (UTC)  quote  ]
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

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.


1,371 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]