|
Belariad Newbie
Joined: 04 Feb 2007 Posts: 9
|
Posted: Sun Feb 04, 2007 5:05 am
Help updating my #ECHO triggers |
I have some triggers that send all chat messages to a separate window usually named "Chat"
I used to use do the following:
#TRIGGER {%w gossips, '(*)} {#ECHO {Chat} {(%1) gossips, '(%2)}
I also added in custom colorization but that's long and not applicable to the problem. Now the #ECHO command in cmud no longer allows a target window to send the echo to. I've been looking for some sort of alternative but haven't found anything that really works very well.
I tried using the #CAPTURE command but that captures the entire line, and sometimes chat messages are displayed after the mud prompt, and I dont want the prompt to echo with the chat message.
Any ideas? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Feb 04, 2007 5:17 am |
You're looking for :.
Windowname:command
will change focus to that window and execute and
:Windowname:command
will execute without changing focus. So you'll want:
Chat:#say {%1 gossips '%2}
or
:Chat:#say {%1 gossips '%2}
There's no need for brackets round your %n references.
EDIT: VV Or #window, but I hate using commands that can also create things if I make a mistake =/ VV
EDIT2: Actually, there seems to be a bug here that's preventing ":win:#echo something" from working. win:command still works. |
|
Last edited by Fang Xianfu on Mon Feb 05, 2007 9:25 pm; edited 4 times in total |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Sun Feb 04, 2007 5:17 am |
#WINDOW windowname {formatted text}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Belariad Newbie
Joined: 04 Feb 2007 Posts: 9
|
Posted: Mon Feb 05, 2007 8:40 am |
thanks guys, if i have any problems i'll report them back here to see if we can work it all out. thanks again!
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 8:43 am |
I just noticed something else that might not work properly - your %w wildcard isn't captured (it needs to be inside brackets for it to be captured to a %n variable). Could make the #echo display the wrong thing.
|
|
|
|
Tex Beginner
Joined: 16 Nov 2006 Posts: 21
|
Posted: Mon Feb 05, 2007 3:35 pm |
Why not use #capture?
#TRIGGER {%w gossips, '*} {#cap Chat}
edit:
if it always stars on a new line i would also put a carrot in the trigger
#TRIGGER {^%w gossips, '*} {#cap Chat} |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 05, 2007 3:47 pm |
As he said it does not always start on a new line and he does not want the prompt to be placed in the other window.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 9:25 pm |
Edited my script above, should work fine now.
|
|
|
|
Belariad Newbie
Joined: 04 Feb 2007 Posts: 9
|
Posted: Tue Feb 06, 2007 7:28 am |
This is the setup that I've found works best.
#Trigger {%w gossips, '(*)} {:Chat:#say {%ansi(green)%1 gossips, '%2}}
Thanks Fang Xianfu for the direction |
|
|
|
|
|