|
fhqwhgad Novice
Joined: 07 Feb 2005 Posts: 38
|
Posted: Sat Dec 15, 2007 5:22 pm
manipulating captured text |
I got a #cap on tells to my chatwindow, but i'd like to manipulate the string it sends to the chat window. How do i do that? As it is now, it just writes my triggered line to my chatwindow.
What i would like is to add text to it, and change the colours of certain parts of it. I have no idea how to do it though, as it seems like #cap just writes the line to the window, without me having any influence on it. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 15, 2007 6:26 pm |
You can output text to a specific window using the #window command - so instead of using #cap on the text, manipulate it and use #win to send it. For example, instead of:
#trig {%w says,"} {#cap says}
do
#trig {(%w)( says,"*)} {#win says %ansi(yellow)%1%ansi(green)%2} |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Dec 15, 2007 6:32 pm |
You can do this in two ways.
You can continue to use #CAP and then create triggers in your child window to manipulate how you want. This is what you use if you want to change colours since #window reset's the color info.
A simple perhaps more efficient solution would be to use the #WINDOW command. So you'd end up with something like this.
Code: |
#TRIGGER {^(* tells you *)^} {:tell:#COLOR red;#WINDOW tell %line;#GAG} |
[Edit] Or you can follow master ninja Fang's approach. |
|
_________________ Asati di tempari! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 15, 2007 6:50 pm |
;)
I had forgotten about #gag, though - #win doesn't remove text from the window that fired the trigger, so you need to do that yourself with #gag. |
|
|
|
fhqwhgad Novice
Joined: 07 Feb 2005 Posts: 38
|
Posted: Sat Dec 15, 2007 6:53 pm |
#Window is the way then. But if i assign a colour to the first part of my line, how do i tell it to change the remaining to whatever colour the mud sends?
The string is "Someone tells you 'whatever'"
I want "Someone tells you" to be one colour, the rest should be whatever colour the mud sends it in. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Dec 15, 2007 6:57 pm |
A more difficult problem. You'll probably want to use an ANSI trigger where you capture whatever colour the line is and then put your own ANSI code (not using ANSI) back in later.
|
|
|
|
fhqwhgad Novice
Joined: 07 Feb 2005 Posts: 38
|
Posted: Sat Dec 15, 2007 7:36 pm |
Fang Xianfu wrote: |
A more difficult problem. You'll probably want to use an ANSI trigger where you capture whatever colour the line is and then put your own ANSI code (not using ANSI) back in later. |
I think this is getting abit too heavy for me, maybe i should just stick with #cap.
Is it possible to add a %time() infront of the captured text? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sat Dec 15, 2007 7:44 pm |
It is possible but why do it? Cmud [2.18] has timestamps built right into the window now.
Go to the window preferences for your capture window and in the session section on the scrollback tab and check show timestamps. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
fhqwhgad Novice
Joined: 07 Feb 2005 Posts: 38
|
Posted: Sat Dec 15, 2007 8:01 pm |
Arminas wrote: |
It is possible but why do it? Cmud [2.18] has timestamps built right into the window now.
Go to the window preferences for your capture window and in the session section on the scrollback tab and check show timestamps. |
Ooooh thank you! That certainly made things alot easier. |
|
|
|
kiraile Newbie
Joined: 31 Jan 2003 Posts: 4 Location: Germany
|
Posted: Fri Dec 21, 2007 7:24 pm |
i am normaly useless at things like this but i think you want #cw
#trig {someone tells you} {#cw red;#cap tells}
i use it to just colour the "some tells you" the rest is mud default. |
|
|
|
|
|