Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Health Bars...again..

Health Bars...again..

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


Posted by Dekotis   (7 posts)  Bio
Date Tue 24 Jul 2007 04:00 AM (UTC)
Message
Ok, I read all the forums on the health bars and I have tried everything I could imagine and nothing worked.
This is the 4th line of the plugin:
"^\<HP\:[*/*] Jakai\:[*/*] Stam\:[*/*] TNL\:[*] Yen\:[*]\>(.*?)$" >

and this is what My prompt looks like:
HP:[4,081/4,081] Jakai:[4,305/8,269] Stam:[1,215/1,215] TNL:[1,344,844] Yen:[3,532]

Can any1 help me out plz...
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #1 on Tue 24 Jul 2007 05:41 AM (UTC)
Message
The problem is with the commas being in there. If you're using Lua, convert them by doing this, using hp just as an example variable.

hp = string.gsub( hp, ",", "" )

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 24 Jul 2007 06:22 AM (UTC)
Message
You need a backslash before the square brackets.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dekotis   (7 posts)  Bio
Date Reply #3 on Tue 24 Jul 2007 06:11 PM (UTC)
Message
Ok, I put in the backslashes:
<!ENTITY trigger_match
"^\&lt;HP\:\[*\/*\] Jakai\:\[*\/*\] Stam\:\[*\/*\] TNL\:\[*\] Yen\:\[*\]\&gt;(.*?)$" >

and it still doesnt work...and as far as the commas, That is put in automaticly by the mud. So, if I need to put that into the code, where does it go?

Thx for the help though.
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #4 on Tue 24 Jul 2007 07:53 PM (UTC)
Message
  <!ENTITY trigger_match 
   "^HP:[([\d\,]+)\/([\d\,]+)] Jakai:[([\d\,]+)\/([\d\,]+)] Stam:[([\d\,]+)\/([\d\,]+)\(.*?)$" >

That should capture the prompt correctly. This next part may not work, since I'm quite unfamiliar with vbscript, but it should at least give a starting point. Find the part with the three DoGauge lines in a row, and replace it with this:
  DoGauge "  HP: ", Replace(wildcards (1), ",", "" ), Replace(wildcards (2), ",", "" ), "darkgreen", "maroon"
  DoGauge "  Jakai: ", Replace(wildcards (3), ",", "" ), Replace(wildcards (4), ",", "" ), "mediumblue", "mediumblue"
  DoGauge "  Stam: ", Replace(wildcards (5), ",", "" ), Replace(wildcards (6), ",", "" ), "gold", "gold"

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Dekotis   (7 posts)  Bio
Date Reply #5 on Wed 25 Jul 2007 01:42 AM (UTC)
Message
didn't work...I copied both of them into place...still nothing...sorry for all the hastle though...
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #6 on Wed 25 Jul 2007 01:56 AM (UTC)
Message
Are there any error messages? Is the info bar popping up at all? Is it partially working? Did you test to see if the trigger was being called at any point?

Giving some more information than "It didn't work" might help a bit more to track down where the problem is.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Dekotis   (7 posts)  Bio
Date Reply #7 on Wed 25 Jul 2007 02:07 AM (UTC)

Amended on Wed 25 Jul 2007 02:22 AM (UTC) by Dekotis

Message
It doesn't give me any error messages at all. The info bar is there, but its just a grey bar. It says nothing besides that...

I added the plugin to the global preferences and got no error messages, removed it from there, added it to the individual world and still nothing. So either way it's like its not even there.

ok, did something more simple.

HP:4,707/5,541 Jakai:2,120/11,223 Stam:1,795/1,795

changed:
<!ENTITY trigger_match
"^HP:(\d\,+)\/(\d\,+) Jakai:(\d\,+)\/(\d\,+) Stam:(\d\,+)\/(\d\,+)\(.*?)$" >

still got nothing..
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #8 on Wed 25 Jul 2007 02:08 AM (UTC)
Message
Try a more simple prompt for now.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #9 on Wed 25 Jul 2007 06:24 AM (UTC)

Amended on Wed 25 Jul 2007 06:25 AM (UTC) by Nick Gammon

Message
You need to read up a bit on how regular expressions work.

For one thing, trying that in a trigger gave an error (unmatched parentheses) because of this part at the end:


\(.*?)


I took out the backslash, but it still didn't match. This is because you had this:


(\d\,+)


What that matches is a single digit (\d) followed by one or more commas (\,+). So that would match something like "1,,,,,,".

You need to make a "set" like this:


([\d\,]+)


That matches the set of digits and commas, one or more times.

In fact, you don't need a backslash in front of the comma. This matched for me on your test data:


<!ENTITY trigger_match
"^HP:([\d,]+)\/([\d,]+) Jakai:([\d,]+)\/([\d,]+) Stam:([\d,]+)\/([\d,]+)(.*?)$" >

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #10 on Wed 25 Jul 2007 06:29 AM (UTC)
Message
With that as the trigger match, and the change suggested by Shaun, namely:


  DoGauge "  HP: ", Replace(wildcards (1), ",", "" ), Replace(wildcards (2), ",", "" ), "darkgreen", "maroon"
  DoGauge "  Jakai: ", Replace(wildcards (3), ",", "" ), Replace(wildcards (4), ",", "" ), "mediumblue", "mediumblue"
  DoGauge "  Stam: ", Replace(wildcards (5), ",", "" ), Replace(wildcards (6), ",", "" ), "gold", "gold"


For me, the health bars came out looking OK.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #11 on Wed 25 Jul 2007 06:32 AM (UTC)
Message
You should be able to add the plugin to the individual world, and then use Ctrl+Shift+F12 to push through a prompt (like in your example), to test it. Make sure you put newlines around the test prompt by hitting Ctrl+Enter.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Dekotis   (7 posts)  Bio
Date Reply #12 on Wed 25 Jul 2007 04:28 PM (UTC)
Message
Yes, My apologies, I haven't done programming in 3 years, and I guess I haven't got myself back in that frame of mind.
I do want to say Thanks for all the help Nick and Shaun, I sincerly do appriciate it. I got working now, btw. :D
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.


32,945 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.