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
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Tue Sep 23, 2003 4:53 am   

ANSI based Triggers
 
how would I go about making the pattern for this type of trigger. Like, I'm trying to do this for my channel capture script so that everytime I see "gossip" it doesn't capture any text into a seperate window like it does currently. I'd just want the trigger to fire off when someone actually uses the gossip channel where the word gossip shows up in bright blue with the message being in a dim cyan.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Sep 23, 2003 5:21 am   
 
#trigger {%w gossips (*)} {#PCOL cyan %x1}

or change it to what ever color.
Also Find your old GOSSIP trigger and delete it.
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Fri Sep 26, 2003 4:14 pm   
 
well, my current channel capture trigger looks like this:

Pattern: %w {O.O.C.|gossips|gossip|tell|tells you|sings|sing|quote|quotes|apprentice|asks|answers|ask|answer|tells the group|says,|oocs,|say,|ooc,}

value: #T+ Capture

So like yea, I guess I'll have to rewrite my current capture script with individual triggers for every channel...
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Fri Sep 26, 2003 4:22 pm   
 
Inaddition to that, I don't want the gossip message to change or anything when its outputted to my Channels window. I just want the trigger to fire off only when the gossip channel is used. That trigger you posted would just do what my current trigger does, which is copy whatever text is surrounding the word gossip and then output it in a different color in my Channels window.

From what I gather, the pattern CAN/SHOULD contain the color code from the mud in order to make the trigger ANSI specific. But I can't seem to figure out how to do that properly.... Also... I'm not quite sure what options I'd have to select for the trigger to be ANSI specific and what not. Do I need to adjust any settings on Zmud in order to get the triggers to work properly?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Sep 26, 2003 11:28 pm   
 
You could probably just anchor this.
Pattern:
^%w {O.O.C.|gossips|gossip|tell|tells you|sings|sing|quote|quotes|apprentice|asks|answers|ask|answer|tells the group|says,|oocs,|say,|ooc,}

To get the color code from the MUD, first highlight the desired text in the MUD. Next, click the Triggers button to open the editor and click New (or select an existing trigger). Go to the Options tab and check ANSI Trigger. Come back to the Pattern tab and paste the text into the pattern using CTRL-V. Edit the pattern as needed, fill in the Value, and Save.
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Tue Sep 30, 2003 5:15 pm   
 
When I copy the colored text, would the color syntax show up when I pasted the text into the pattern for the trigger? Or would I simply see the message from the mud in plain text in the pattern line?
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Wed Oct 01, 2003 10:29 pm   
 
Okay, what you're tellin me to do isn't working.... I dunno if its a bug with this version of Zmud or what, cause I am not using 6.62. I am, however, using version 6.16 and the ansi option isn't working. Am I missing an option under preferences that I need to have clicked? I haven't a clue as to what the problem is.... When I copy the colored text into the value, the text remains colored in the value box for a brief moment before converting into black text. So I know it is copying the color over, but the ansi color code isn't being copied into the pattern box. All I see is the message from the mud without any special characters and whatnot. I checked the helpfile and it also said that all I had to do was select ANSI under the options for the trigger and then copy and paste the text, but it isn't working. I don't know what to do to fix this. I've asked several friends of mine who just don't know what to tell me because it works for them, though they use 6.62. So is this a bug with 6.16?
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Thu Oct 02, 2003 2:05 am   
 
Okay, ignore the last post as I just upgraded to 6.62. Now that I've upgraded, I have a different problem. The text with the color code copies just fine into the pattern now and what not. But for some reason, the trigger isn't working properly with the current set of triggers I have setup to copy the text into another window.

Here's what I've done thus far:

(original trigger)
Pattern: ^(*) {O.O.C.|gossips|gossip|tell|tells you|sings|sing|quote|quotes|apprentice|asks|answers|ask|answer|tells the group|says,|oocs,|say,|ooc,}

Value: #T+ Capture

(The above trigger was used to activate the Capture Class)

Capture Class Triggers (class is set to be disabled until enabled by the trigger)

Pattern: *
Value: #Capture Channels;#GAG

(This trigger is used to copy everything from the main window and output it to the Channels Window as well as gag anything copied over in the Main Window)

Pattern: HP:%d/%d
Value: #Class Capture 0

(The pattern of the trigger is located in my prompt and is used to disable the class in order to keep any unnecessary text from being copied into the channels window after the message has been received)

The ORIGINAL set of triggers above WORK as they should, the problem is that words like apprentice and sings show up on a room description or mob and thus it copies the text between those words and the prompt into my channels window, hence the need to make them match to color as well as text.

(New ANSI based trigger for O.O.C.)

Pattern: %w %e[1;31mO%e[0m.%e[1;37mO%e[0m.%e[1;34mC%e[0m.
Value: #T+ Capture

After creating this trigger, I deactivated the original one to see what would happen. As you can see, this trigger would also activate the Capture class, but for some reason, the triggers within that class do NOT function correctly. What happens is, when I use the channel or receive a message from that channel, the message is still displayed in the main window while my PROMPT gets gagged in the main window and displayed in the Channels window.

Now when I edit the following trigger:

Pattern: *
Value: #Capture -1 Channels

You notice the -1 which was NOT in the original set of triggers. I had to add this in order to get it to copy the channel into the child window. BUT.... What happens is, it copies the channel but still displays it in the main window AND... gags my prompt in BOTH windows. I can't seem to get it to gag the channel from the main window and keep my prompt in both. I'm not exactly sure where I went wrong here, the original trigger WORKS like I said, it just works alittle too well.... And when I try to setup an ANSI based trigger using the same value as the first, it doesn't work. Any of this making sense? Input would greatly be appreciated.
Reply with quote
Backu
Novice


Joined: 24 Feb 2003
Posts: 36
Location: USA

PostPosted: Thu Oct 02, 2003 3:48 am   
 
Okay, thinking I read this correctly.. on the MAIN Screen, when someone uses Gossip, you want "(%A) gossips" in one color, and the rest in another, right? Well, it would be a pretty simple trigger, and all this %ansi stuff is rather irrelevant.

Simply put, check the help file for #COLOR, #CW and COLORNAME.

Lemme know if this helps.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Oct 02, 2003 3:52 am   
 
It appears that the triggers in Capture don't become active until the line AFTER the line which enables the class. This is because triggers are normally processed in order of creation. It's easily handled by just including the desired commands in the original trigger.

For a color-matching trigger
Pattern: %w %e[1;31mO%e[0m.%e[1;37mO%e[0m.%e[1;34mC%e[0m.
Value: #T+ Capture;#CAP Channels;#GAG

There's no point in using ^ (match beginning of line) if you immediately follow it with * (match any number of characters including spaces). I suggested ^ followed by %w (match ONE word, letters only).

CLASS Capture
Pattern:
*
Value:
#CAP Channels
#GAG

Pattern:
HP:%d/%d
Value:
#T- Capture
#UNGAG
Options:
Newline
Prompt

This may capture the occasional line when you get a prompt immediately followed by other text. However, it will also display that line in the main window.

Top Class (None)
Pattern:
^%w {O.O.C.|gossips|gossip|tell|tells you|sings|sing|quote|quotes|apprentice|asks|answers|ask|answer|tells the group|says,|oocs,|say,|ooc,}
Value:
#T+ Capture
#CAP Channels
#GAG

NOTE to Backu: No, he's not trying to color lines in the main window. He's trying to move his communications to another window entirely.
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Thu Oct 02, 2003 4:14 am   
 
Thanks again for the input guys, I'll check it out. I REALLY appreciate it. :)
Reply with quote
Mud_Automater
Beginner


Joined: 25 Aug 2003
Posts: 26

PostPosted: Thu Oct 02, 2003 9:51 pm   
 
Well, I took into account what you said about Zmud processing triggers in the order at which they were created. So all I really needed to do was just recreate the Capture class scripts and that fixed my problem. Thanks again for your input guys, and keep posting, this place is great for finding help with triggers. :)
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