|
olmec Beginner
Joined: 03 Mar 2009 Posts: 11
|
Posted: Tue Mar 03, 2009 7:23 am
Analyzing colors - Triggers |
Hi,
Mud i'm playing (4 Dimensions) uses colors.
Problems happen with triggers because i don't know how to use colored informations.
So, here is a quick example :
In this room, you see :
a big cat
| a big cat
| a big cat
(First line, nothing before "a big cat" - just empty spaces i think)
(second line,| has blue color)
(third line | has red color)
So i would like to attack the cat with a blue | before him but not the other ones (auto-attack blue cat)
So here are my questions :
1 How can i see the exact text sent to cmud (before being analyzed/parsed by cmud) with colors info (ex #0000FF) to determine exact colors? (different hues of blue, red,... are used according to mob levels) (and exact caracters used - i'm not sure about the "|" caracter)
2 Can you suggest me a trigger to attack the second cat (only the one who has blue |) ?
PS : in trigger, we should also count "cats" before the good one.
For example with
a big cat
| a big cat
the command sent to mud should be "kill 2.cat"
It looks like prety complex but it will be really helpful if you could "solve the case",
Thanks for your advice, |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Tue Mar 03, 2009 8:05 am |
You can use the script debugger to get the colours and things that you need.
I think you'll need a trigger off of "In this room, you see:" which resets a counter variable, and then a trigger to add one to the count every time you see "\bcat\b" (where \b is a word boundary, I think ZMud style patterns use %b maybe?)... Then the trigger for "a blue line * \bcat\b" should be trivial, using the counter to pick the appropriate cat to kill. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Tue Mar 03, 2009 8:05 am |
1. To see the exact text, the simplest way is to open the script debugger by going to Window -> Script Debugger.
2. To do the trigger what you want is an ANSI trigger. You copy the the text you want to match. Then use the Settings Editor (Ctrl+G) to create a new trigger. Make sure ANSI trigger is checked, then when you paste the text you copied it would include the appropriate ANSI color codes.
[Edit] Ninja'ed within seconds. |
|
_________________ Asati di tempari! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Mar 03, 2009 9:05 am |
It depends if your MUD is using ANSI colour or MXP colour. If it's using more than the 16 standard ANSI colours, it's probably using MXP.
If it is indeed using ANSI, then Tech's #2 is the best way to go about it. |
|
|
|
olmec Beginner
Joined: 03 Mar 2009 Posts: 11
|
Posted: Tue Mar 03, 2009 10:00 am |
Edit : -- Well after checking, mud is only using 16 colors, it just so diverse that i thought it was more than 16 (lol)
Hi, thanks :)
So, well i think i'm unfortunate - mud is using mxp (i believe)
[for example, i can click on links to go between one room and the other, and the number of colors is really big (a lot more than 16)]
When i use script debugger i don't see color code but that's really a | that's sent to cmud.
When i copy paste from screen to Settings editor, really "strange" code is happened (corresponding to colors in cmud ?)
Code: |
%e[36m|%e[1;36mThe loyal and trustworthy butler stand here ready to take your coat.%e[0m$
%e[1;36m %e[1;36mThe loyal and trustworthy butler stand here ready to take your coat.%e[0m$
|
(first butler with blue color)(second butler with no color)
but even with that copy paste, trigger is not triggered. What can i do? How can mxp me manipulated with triggers?
Thanks, olmec |
|
Last edited by olmec on Tue Mar 03, 2009 6:08 pm; edited 1 time in total |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Tue Mar 03, 2009 11:01 am |
Yeah, it looks like the debugger isn't showing MXP (Zuggggg! Feature request...)
Try using this trigger instead:
Code: |
<trigger type="MXP" priority="1380" id="138">
<pattern>color</pattern>
<value>#print %mxp</value>
</trigger> |
If they're using a simple colour tag, that should echo what colour they're using... Um, otherwise... maybe have a look in the MXP tab of the preferences, and see if any custom elements or entities have been saved. |
|
|
|
olmec Beginner
Joined: 03 Mar 2009 Posts: 11
|
Posted: Tue Mar 03, 2009 12:47 pm |
Is there a way to be sure MXP is used ? i've looked at help files but they don't mention it, and trigger you've given me gamma_ray does not trigger :) so i suppose ansi chars are sent : here is color list i found in help files
Code: |
Below are the colour codes for 4 Dimensions:
red is: {cr
Red is: {cR
blue is: {cb
Blue is: {cB
yellow is: {cy
Yellow is: {cY
magenta is: {cm
Magenta is: {cM
green is: {cg
Green is: {cG
white is: {cw
White is: {cW
cyan is: {cc
Cyan is: {cC
grey is {cL
black is {cl
blinking is: {cf
underlined is: {cu
ending the color is: {cx |
and they're talking a lot about ansi but not mxp (*shrug*)
I must say script debugger is showing "strange" codes :
Code: |
0.0005 | a 4Dimensi ||The 4 Dimensions receptionist is here, behind the counter.
0.0003 | a 4Dimensi ||[T] The healer stands here with a warm smile on her face.
0.0005 | a 4Dimensi |...she glows with a bright light!
0.0004 | h 4Dimensi |<ESC>[1;36m...she glows with a bright light!<ESC>[0m
0.0005 | a 4Dimensi | The score board stands here.
0.0003 | a 4Dimensi |
0.0063 | a 4Dimensi ]2722H 358M 841V (100) 27,756,660TNL>
0.0001 | h 4Dimensi ]<ESC>[32m2722<ESC>[37mH <ESC>[36m358<ESC>[37mM <ESC>[33m841<ESC>[37mV <ESC>[1;37m(100) <ESC>[1;36m27,756,660<ESC>[0;33mTNL<ESC>[0S><ESC>[0m
|
Is there a way to translate %e[31m|%e[0m (blue bar) in a trigger? (it comes from copy pasting directly of screen)
I think it's telling us hey look at me i'm blue (while [32m2722 is telling "hey i'm green")
I don't think i can do it with %ansi (because 2reds, 2 greens, 2 magentas...)
PS: i've uploaded an image of color list,
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Mar 03, 2009 4:08 pm |
So, wait. Is the MUD only using 16 colours, or isn't it? That screenshot there has 16.
|
|
|
|
olmec Beginner
Joined: 03 Mar 2009 Posts: 11
|
|
Last edited by olmec on Tue Mar 03, 2009 7:08 pm; edited 2 times in total |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Mar 03, 2009 5:39 pm |
Heh. You said earlier it was a lot more than 16. :p
Those "strange codes" you're seeing IS the ansi code (if you're talking about the [1;36m bit. And the %e[31m is the ansi trigger pattern. It will ONLY match that specific color. Just food for thought. I'd post more, but at work right now. Just know this is the correct behaviour for CMUD (as well as zMUD).
Charneus |
|
|
|
|
|