How to read this line and set in variable

Posted by Valentim on Wed 22 Jul 2015 04:39 PM — 2 posts, 12,131 views.

#0
how to read this line and set value in a variable

Line: <100,000/150,000Hp 35,000/38,000Mp>

line has "," not "." how will I do this trigger?
Australia Forum Administrator #1
Remove the commas with scripting.


<triggers>
  <trigger
   enabled="y"
   match="&lt;*/*Hp */*Mp&gt;*"
   send_to="12"
   sequence="100"
  >
  <send>
SetVariable ("hp",    string.gsub ("%1", ",", ""))
SetVariable ("hpmax", string.gsub ("%2", ",", ""))
SetVariable ("mp",    string.gsub ("%3", ",", ""))
SetVariable ("mpmax", string.gsub ("%4", ",", ""))
</send>
  </trigger>
</triggers>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.