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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Mar 22, 2008 2:27 am   

Advice needed on a trigger to avoid an infinite loop
 
I'm trying to pattern match when I'm hit with an attack line I've not seen before, so I do this:

^(.*\b(?:@target_full)\b.*)$

So if I see the @target_full anywhere in the line it will match and I know I've seen an unrecorded attack. I'd like to do a sub on the line so it looks nicer but if I try to sub/say/show or anything that uses the name again the trigger will go into an infinite loop where it matches then prints out the name again and matches again. I tried selecting, "stop further processing" which I thought would have solved it, but it didn't.

Any advice?
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sat Mar 22, 2008 2:33 am   
 
Try calling an alias from the trigger, the first thing the alias does is disable said trigger. That means, though, you need an activating alias also.
_________________
Sic itur ad astra.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sat Mar 22, 2008 6:15 am   
 
Well I think I got it. Subbing works, I don't know why I was not seeing that earlier.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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