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
Belariad
Newbie


Joined: 04 Feb 2007
Posts: 9

PostPosted: 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?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Feb 04, 2007 5:17 am   
 
#WINDOW windowname {formatted text}
_________________
Discord: Shalimarwildcat
Reply with quote
Belariad
Newbie


Joined: 04 Feb 2007
Posts: 9

PostPosted: 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!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Tex
Beginner


Joined: 16 Nov 2006
Posts: 21

PostPosted: 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}
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Feb 05, 2007 9:25 pm   
 
Edited my script above, should work fine now.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Belariad
Newbie


Joined: 04 Feb 2007
Posts: 9

PostPosted: 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
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