hitpoint rep to chat

Posted by Anssett on Mon 18 Aug 2003 08:18 AM — 3 posts, 14,127 views.

USA #0
ok, so one of the things i do with my chat script is report my current hps, so people that i'm playing in zones and stuff can see what my hps are without having to glance, etc...
the only problem i'm running into is, using setvariable, the hp variable isn't being set until the next line of input goes through. i'm wondering if there's some method of forcing the update.

on another note, is there any really quality material on regexps? it's been ages since i've written one, and i'd like to refamiliarize myself :P

::my code::


'this sub is used to set hp and mana variables for reporting purposes
sub statSet(inHP,inMN)
dim strHP,strMN
strHP=inHP
strMN=inMN
world.SetVariable "currHP",strHP
world.SetVariable "currMN",strMN
end sub


::sample line of input and the associated trigger::


[DH]<955hp 170m 610mv 100br>


<trigger
   enabled="y"
   match="*&lt;*hp *m *mv *br&gt; "
   send_to="10"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  <send>/statSet &quot;%2&quot;,&quot;%3&quot;</send>
  </trigger>
Greece #1
You can either read that thread about matching triggers before waiting for a newline to come in, which is a bit sloppy if i remember correctly, or you could add a newline at the end of your prompt. Most servers can do that.
Greece #2
Also, if you want to read on regexp, look at the MUClient \docs folder, there's a great document there :)