  | 
	
	
	
		Dugoth Beginner
 
  Joined: 18 Feb 2004 Posts: 10
 
  | 
		
		  
			
			   Posted: Thu Apr 01, 2004 9:28 am   
  Trigger Trouble with Text   | 
			 
			
				Okay, brief overview. What I've been trying to do is set up a trigger system which will #GAG certain types of text (in this case, system log which shows connections, disconnections, etc) from my main window and #CAPTURE them to an editor window. The trick is doing this seamlessly so that I don't notice any change or scrolling in my main window or loose anything I don't want specifically gone. This means #GAGing any blank lines before and after the syslog command, the subsequent prompt, and variations on the prompt specific to the MUD. For the most part the system I have is working great, it #GAGs what I want, #CAPTUREs what I want and is unnoticible in the main window. The problem is, it will -occasionally- #GAG something I don't want, for instance if I enter a command just as a syslog line comes up it sometimes #GAGs the result of that command (say I talked to someone...I don't see the result of it on the MUD...it happens fine and they see it, but I lose it in my main output window). As well if the MUD sends something to my output window very closely timed with a syslog #GAG it will sometimes #GAG that as well (these seem to happen only when the line which shouldn't be #GAGged is the line directly before the syslog output line). That sums up the problem more or less, what I'm wondering is whether it's a problem with my trigger system, or if it's just a result of zMUD delaying slightly in processing the commands so that something extra slips in the gaps and get's accidently #GAGged. Incidently, if you don't mind the rare problem, the system could probably be readily modified to work on most any uniquely identifiably variant.
 
 
Trigger system:
 
Trigger Class Channels (Always Enabled)- 
 
   Trigger 1 - Pattern: ^~[ {^Exit|Page }*{^~[GUILD~: ~<none~>}~]$
 
   //it excludes certain patterns I don't want gagged
 
               Command: #IF (%line2 =~ "^$") {
 
                           #CAP Syslog
 
                           #GAG -1
 
                           #GAG
 
                           #T+ SpamBlock
 
                           } {
 
                           #CAP Syslog
 
                           #GAG
 
                           #T+ SpamBlock
 
                           } 
 
 
Trigger Class SpamBlock (Default Disabled)- 
 
   Trigger 1 - Pattern: ^$
 
   // supposed to #GAG any extraneous blank lines
 
               Command: #GAG
 
   Trigger 2 - Pattern: ^Unauth: %d$
 
   // to #GAG an occasional line, not always present
 
               Command: #GAG
 
   Trigger 3 - Pattern: ^i%d ~<*
 
   // to #GAG a variant prompt
 
               Commands: #GAG
 
                         #T- SpamBlock
 
   Trigger 4 - Pattern: ^~<*
 
   // to #GAG the standard prompt
 
               Commands: #GAG
 
                         #T- SpamBlock
 
   Trigger 5 - Pattern: ^~[ Page *~]$
 
   // to #GAG the pageing prompt when browsing an document
 
               Commands: #GAG
 
                         #T- SpamBlock | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		LightBulb MASTER
 
  Joined: 28 Nov 2000 Posts: 4817 Location: USA
  | 
		
		  
			
			   Posted: Thu Apr 01, 2004 5:44 pm      | 
			 
			
				#GAG -1. Don't use it if the line before may sometimes be something you want to see.
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Dugoth Beginner
 
  Joined: 18 Feb 2004 Posts: 10
 
  | 
		
		  
			
			   Posted: Thu Apr 01, 2004 9:35 pm      | 
			 
			
				That's what the If statement is supposed to make sure of...-should- only gag the last line if it's empty (blank)
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Vijilante SubAdmin
  
  Joined: 18 Nov 2001 Posts: 5187
 
  | 
		
		  
			
			   Posted: Thu Apr 01, 2004 11:29 pm      | 
			 
			
				Do you have multiple triggers that operate on the same line as those you wish to #GAG?  The blank line trigger in your SpamBlock class wouldn't be a problem, but others might.  If you do you should try changing the order of the triggers, try using #PRIORITY if the triggers have looping commands, and perhaps even use #GAG 0 instead of #GAG.
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		LightBulb MASTER
 
  Joined: 28 Nov 2000 Posts: 4817 Location: USA
  | 
		
		  
			
			   Posted: Fri Apr 02, 2004 4:14 am      | 
			 
			
				The problem is probably related to your use of %line2. This is a system variable which updates automatically as each line is received from the MUD. When text is coming in fast, it may update before your trigger gets processed.
 
 
You should change your trigger so that it doesn't depend on variables which aren't specific to the trigger and which you don't control. A trigger for the sole purpose of gagging a preceding blank line would probably work better.
 
#TR {^$}
 
#COND {^~[ {^Exit|Page }*{^~[GUILD~: ~<none~>}~]$} {#GAG -1} {Within|Param=1} | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Dugoth Beginner
 
  Joined: 18 Feb 2004 Posts: 10
 
  | 
		
		  
			
			   Posted: Fri Apr 02, 2004 4:18 am      | 
			 
			
				no other relevant triggers then the ones I listed...none at all really on that character ;) I'll try that suggestion LightBulb, thanks, though it'll take a bit of revision :) Hopefully that one will do it
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Dugoth Beginner
 
  Joined: 18 Feb 2004 Posts: 10
 
  | 
		
		  
			
			   Posted: Fri Apr 02, 2004 4:35 am      | 
			 
			
				Hmm....that's not going to work unfortunately it seems LightBulb. It gives me a Parse Error on every blank line on the #COND {^~[ {^Exit|Page }*{^~[GUILD~: ~<none~>}~]$} {#GAG -1} {Within|Param=1} command. I'm in version 7.04
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		| 
		
		 | 
	
	
		 |