|
zeiuszeppo Novice
Joined: 22 Nov 2001 Posts: 48 Location: Italy
|
Posted: Fri Apr 12, 2002 9:14 pm
color of a var |
how can I retrieve the color of trigger
var ? ie %1?
or- how can I trigger a pattern matching only
if colored yellow? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Apr 12, 2002 11:49 pm |
quote:
how can I retrieve the color of trigger
var ? ie %1?
or- how can I trigger a pattern matching only
if colored yellow?
Well, variables don't store the color of their data (hey, that might be something to look into...we have ansi triggers, why not ansi variables?), so that option is out.
But, have no fear, because we still have options--
1)
a)if you already know (or can access a chart detailing) the ansi color codes, then skip to part b. Now that we have the experienced folk out of the way, here's what you need to do. Go to Preferences, then click on General and finally on Emulation. Uncheck the Emulate Control Codes option (either that or the Ansi Color option, not sure which will work) and click the OK button.
b)Next, make the line you want to trigger on appear. Capture that whole line (yep, even the garbage) and put that in your trigger pattern. Also make sure to check the Ansi Trigger checkbox found under the Options tab. You might need to use quote characters to make it work right, and you might have to change the ansi escape character to the zmud equivalent.
c)finally, turn back on the ansi coloring, save the trigger, and begin testing it.
2)if you already know what the color will be or if you are using a manual color system (to colorize an uncolorized MUD), you can forego the above method and simply insert the ansi code or the %ansi() function into the variable. This will obviously cause problems of varying degrees when you try to use this variable with commands such as #PICK.
li'l shmoe of Dragon's Gate MUD |
|
|
|
zeiuszeppo Novice
Joined: 22 Nov 2001 Posts: 48 Location: Italy
|
Posted: Sat Apr 13, 2002 12:02 am |
Sorry, I didnt understand ...maybe my bad
english :(
I'll explain better the problem.
I want to trigger only the lines colored
yellow, non gray, red, purple...only the
yellow ones.
ie:
pattern: (*)$
value: some commands executed only if pattern
color is yellow.
The problem is tha the pattern could non start from the first char of a line, and
I cant use the function %color :( |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Apr 13, 2002 6:11 am |
How about something similar from here:
quote:
Posted - 11/14/2001 : 01:54:48
--------------------------------------------------------------------------------
Have you ever tried using:
#TRIGGER {(%e)[1;34m[(%e)[1;33m(*)} {PutActionHere}
Or even:
#TRIGGER {%e[1;34m[%e[1;33m*} {#CAPTURE Clan}
Acaila
Ton Diening |
|
|
|
zeiuszeppo Novice
Joined: 22 Nov 2001 Posts: 48 Location: Italy
|
Posted: Sat Apr 13, 2002 9:26 am |
Hum, look here, I used this pattern
(turning ANSI TRIGGER on)
pattern: %e[1;33m(*)$
but the trigger doesnt fire
changing mattern to
[1;33m(*)$
It fires every line I receive putting in %1
zmud code!
Where is the problem? :( |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 13, 2002 7:40 pm |
quote:
Hum, look here, I used this pattern
(turning ANSI TRIGGER on)
pattern: %e[1;33m(*)$
but the trigger doesnt fire
changing mattern to
[1;33m(*)$
It fires every line I receive putting in %1
zmud code!
Where is the problem? :(
Probably in the special characters used in the ANSI codes. You need to quote the [ and the ; at least, but I'm not sure if you need to quote the escape character (which zmud uses %e or $e for, whichever is the one that works)
li'l shmoe of Dragon's Gate MUD |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Apr 13, 2002 11:13 pm |
Actually, you don't need to use the ~ in the ansi portion of ansi triggers (I don't know why but you don't). You do need the %e (it's the predefined variable for the escape character). Yellow is 1;33 (1;34 is high blue). So, for your yellow lines you need:
#TR {%e[1;33m(*)$} {#var yellowline {%stripansi(%1)} {} {ansi}
I put the stripansi function to remove any additional ansi coding, since it would contain ;'s.
LightBulb
Vague questions get vague answers |
|
|
|
zeiuszeppo Novice
Joined: 22 Nov 2001 Posts: 48 Location: Italy
|
Posted: Mon Apr 15, 2002 10:13 am |
ok, now it fires sometimes, but...
It doesn't fire on che commands
I write or the trigger commands. Thats no
good. I want to trigger really them...and
as you know commands are yellow.
Any tip for me? |
|
|
|
|
|