Health bar help - using custom prompt

Posted by Stryker on Mon 18 Sep 2006 10:54 PM — 5 posts, 20,936 views.

#0
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?
Amended on Mon 18 Sep 2006 10:57 PM by Stryker
Australia Forum Administrator #1
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.
#2
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.
USA #3
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
USA #4
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.