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
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sat Jan 09, 2010 3:46 pm   

Trigger assistance please
 
I'm having troubles with this trigger, for the life of me it's just eluding me. This trigger was created by someone else, but they're no longer around to ask questions. Could anyone help me please?

Cmud Pro 3.10a
Windows 7

when someone tells me something, it looks like this.

Person tells you: Hi, this is a test.

The trigger also matches
You tell Person: Hi, this is a test.
and
You LT (Person)
LT: Hi, this is a test.
I am not interested in these.


the trigger pattern looks like this.

^(?:>\s|)(You tell \w+|\w+(?<!YOURPET) tells you|\w+ LTs \(.+\)|You LT \(.+\))\:?(.*)$$(.*)$$

and the trigger is as follows.

:Tells:#SAYPROMPT {%cr%ansi( bold, blue)""%ansi( bold, magenta)"["%1"]: "%ansi( bold, grey)%2}


What I'm trying to do, is make it so that if a specific person tells me something, it's ignored, doesn't get sent to the tells window. I've tried many #if commands, and tried making the variable @yourpet as Noname, but it just doesn't work. Or, what it's done is simply blocked out the name, and given me the body of the tell, without a carrier return.

Please, any suggestions would be appreciated.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jan 09, 2010 7:08 pm   
 
First, don't use #SAYPROMPT. In fact, don't use #SAY, #ECHO, or #SHOW. These produce output that triggers can match on, which is obviously not what you were wanting and could also lead to infinite loops. Use #PRINT instead.

Second, unless you are not interested at all in the trigger pattern, it can be helpful to also include examples of the text you want to have the trigger fire on. This can better allow people to point out what you're doing wrong or what can be improved upon.

Third, if you don't want the trigger to match on any LT lines, just remove everything between the | symbols that involves the LT.

Fourth, if you want to incorporate ignore functionality, you will need to change how your pattern grabs the line (currently, %1 is some variation of "You tell someone"):

#trigger {^(%w) {tell|tells} (%w): (*)} {stuff}

From there, you just use an #IF to determine if the person is ignored or not (stuff):

#if (%ismember(%1,@ignored) = 0) {#execwin Tells {#print %concat(%ansi(bold,blue),%1,%ansi(bold,magenta)," [to ",%2,"]:",%ansi(bold,grey),%3)}} {#gagspace}
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sat Jan 09, 2010 7:24 pm   
 
Sorry, I wasn't entirely clear in my last post. You pretty much nailed what I wanted, except the part where I said "I'm not interested in these" Should of said "I don't need to change any of these"

This is an example of the text I'm trying to completely ignore with this trigger.

Tibban tells you:
You are not fighting anything right now master.



Tibban tells you:
Here are your fifteen most recent kills master



I used your trigger, and created an ignored list, but it's not filtering it.

I tried #var ignored {Tibban}
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jan 09, 2010 7:57 pm   
 
are all your tells like that? Like, if I found you and randomly told you something it would show on two lines like that? The trigger pattern I put up would only work on one line, and since there's nothing on the line after the colon then it probably wouldn't match.

If all the tell speech is on a separate line than the X tells Y: portion, is it hardwrapped in a multiline format or is it sent in one line so that CMud can do the wrapping? If it is multiline format from the game, what's the line after the last line in the tell?
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sat Jan 09, 2010 8:01 pm   
 
No, only this specific annoyance is formatted like that, and the LT's. Regular tells are normally single lines (unless of course they're really long tells.)

Code:

Forgiven tells you: this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.  this is for testing line wraps.  this is for testing
        line wraps.


edit well.. unfortunately it doesnt' format properly in the forum. The actual tell has 2 tabs for each line after the first.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Jan 09, 2010 8:37 pm   
 
Ok. Are you wanting to hide Tibban/LT tells or just simply not do anything with them (ie, they're going to stay in your main window and you're not triggering on them for any reason)? If you don't want to do anything with them, then we just need to add in a second state to the trigger to handle the line wrapping:
Code:

#trigger "tRegularTells" {^(%w) {tell|tells} (%w): (*)$} {
  Tellspeech = %3
  #gagspace
}
#condition {(*)} {
  #if (%begins(%1,"        ")) {
    //this is still part of the tell
    Tellspeech = %concat(@Tellspeech,%1)
    #gagspace
  } {
    //check for ignored
    #if (%ismember(%t1,@Ignored) = 0) {
      //this is a tell that should go to the Tells window
      #execwin Tells {#print %concat(%t1," [to ",%t2,"]: ",@tellspeech)}
    }
    #state tRegularTells 0
  }
} {manual}


If you want to do stuff to the other types of tells, it's probably better to handle them in a separate trigger.
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sat Jan 09, 2010 10:26 pm   
 
Wow, I'm not sure what you did, but using that trigger, every line of text that I receive, tries to crash CMud.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jan 10, 2010 1:02 am   
 
hmm, not sure either. Public versus beta bugs issue?
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Sun Jan 10, 2010 1:09 am   
 
Unsure, but I appreciate the effort. Thank you!
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