|
smoaken Newbie
Joined: 31 Dec 2005 Posts: 1
|
Posted: Sat Dec 31, 2005 6:52 pm
Trigger prob with "#" char |
Howdy,
My first post. Recently bought zmud (yeah!) and am now trying to make triggers. I am a healer on zombiemud and as such i want to let the party know what spells im casting and how long before the spell fires, herein lies the problem. When i cast a "heal" spell the mud output is
Heal: ####
Heal: ###
Heal: ##
Heal: #
you cast the spell
Where the number of number signs is how long it takes to cast the spell. Im sure you can already see my problem. Here is my trigger so far. Ive made many changes and cant remember all of them, but i can almost get this to work.
^Stun resistance: (%x)$
#gag
#COLOR red
#var numbsign {%1}
#sh Stun resistance: %replace( @numbsign, "#", "X")
Any help will be appreciated. Every trig that i "kinda" got to work made a terminal loop.
Thanks in advance! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Dec 31, 2005 7:09 pm |
The loop is created by the fact that triggers are by default set to be Trigger on Trigger (the long and short of this is that any output a trigger creates can be triggered on, including by itself) and by you using the #SHOW command to display a matching trigger pattern.
#trigger {^Stun resistance: ([~#])$} {Spells.stunresist = %len(%1);say I can cast 'Stun resistance' in @Spells.stunresist whatever timeframe the symbols equate to} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Sun Jan 01, 2006 9:03 pm |
Um. I'm not sure exactly what output you're trying to achieve, but the way I'd go about it would be...
Code: |
#REGEX {^Heal: (#+)$} {#show {%len( %1) ticks remaining until healing goes off.}} |
Which will, whenever you get a line which looks like
Heal: ###
with however many pound signs, show you "3 ticks remaining until healing goes off."... or however many pound signs there are. Obviously it's a pretty quick change to get that to echo to your group or what have you. |
|
|
|
|
|