Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
smoaken
Newbie


Joined: 31 Dec 2005
Posts: 1

PostPosted: 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!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net