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 bar help - using custom prompt

Health bar help - using custom prompt

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


Posted by Stryker   (4 posts)  Bio
Date Mon 18 Sep 2006 10:54 PM (UTC)

Amended on Mon 18 Sep 2006 10:57 PM (UTC) by Stryker

Message
I'm extremely ignorant when it comes to VBscript and have been trying to alter the health_bar plugin, to no avail, to match the prompt I'm using. The prompt I'm using looks like this:
1245(1245)[100%]hitp 5097(5097)[100%]mana: 745(745)[100%]move 2115472(404526)[86%]exp 300640(85500000)gold>

How can I change the trigger match (and possibly anything else) so that it ignores all the other numbers except current and max hp/mana/move?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 18 Sep 2006 11:22 PM (UTC)
Message
The simple approach is to make a non-regular expression and just put an "*" for each part that is variable, in your case something like this:


*(*)[*%]hitp *(*)[*%]mana: *(*)[*%]move *(*)[*%]exp *(*)gold>


Then if you are putting that into the entity at the top of the plugin, change the > to >

Then, make the trigger not a regular expression by changing the line:

regexp="y"

to:

regexp="n"


Finally, the wildcard numbers will change, you count from the left, so that the hitpoints will be:


  • wildcard 1 - current
  • wildcard 2 - max
  • wildcard 3 - percent


So you would need to change these 3 lines a bit:


  DoGauge "  HP: ", wildcards (1), wildcards (2), "darkgreen", "maroon"
  DoGauge "  Mana: ", wildcards (3), wildcards (4), "mediumblue", "mediumblue"
  DoGauge "  Move: ", wildcards (5), wildcards (6), "gold", "gold"


The first line is still right but line 2 would use 4 and 5, and line 3 would use 7 and 8, like this:




  DoGauge "  HP: ", wildcards (1), wildcards (2), "darkgreen", "maroon"
  DoGauge "  Mana: ", wildcards (4), wildcards (5), "mediumblue", "mediumblue"
  DoGauge "  Move: ", wildcards (7), wildcards (8), "gold", "gold"


I haven't tried that, but it should be about right.

- Nick Gammon

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

Posted by Stryker   (4 posts)  Bio
Date Reply #2 on Tue 19 Sep 2006 12:23 AM (UTC)
Message
Thanks for the help. Tried doing what you suggested with the regular expression instead and changing the wildcard numbers. Finally got it to work when I realized I had mistakenly put a colon behind mana when making the prompt.
Top

Posted by Perrin   USA  (31 posts)  Bio
Date Reply #3 on Mon 26 Feb 2007 02:48 AM (UTC)
Message
just a quick question along the same lines how could i make this plugin match on two diffrent triggers? my battle prompt has added information that my normal prompt doesn't

aardwolf player
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #4 on Mon 26 Feb 2007 04:45 AM (UTC)
Message
You can have a second trigger which matches your battle prompt in the same way, but with the extras as wildcards that are not captured. Since you should never have your two prompts showing wildly different numbers, there is no problem with having the two triggers updating your status bars.

It is much easier to fight for one's ideals than to live up to them.
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.


19,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.