How to modify Improved health bar plugin for this prompt

Posted by Warshed on Sun 22 May 2011 11:11 PM — 3 posts, 14,327 views.

#0

$HP:153/153 MP:33/33 FTG:54/54 PSI:0/0 DEL:0 POS:stand GP:0 SP:0



The actual plugin code looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="Health_Bar_Miniwindow"
   author="Nick Gammon"
   id="48062dcd6b968c590df50f32"
   language="Lua"
   purpose="Shows stats in a mini window"
   date_written="2009-02-24 13:30"
   requires="4.40"
   version="1.0"
   save_state="y"
   >
<description trim="y">
<![CDATA[
Install this plugin to show an info bar with HP, Mana, 
and Movement points shown as a bar.

The window can be dragged to a new location with the mouse.
]]>
</description>

</plugin>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="^\&lt;(\d+)\s*\/(\d+)\s*hp (\d+)\s*\/(\d+)\s*mp (\d+)\s*\/(\d+)\s*ftg "
   regexp="y"
   script="do_prompt"
   sequence="100"
  >
  </trigger>
</triggers>




Thank you.
Amended on Mon 23 May 2011 02:46 AM by Nick Gammon
#1
Sorry the first line above was the prompt.
Australia Forum Administrator #2
Your basic strategy is to paste in your prompt, and then change numbers that might vary to be "(\d+)" which is "one or more digits, captured". So something like this:


^\$HP:(\d+)/(\d+) MP:(\d+)/(\d+) FTG:(\d+)/(\d+)