|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Wed May 14, 2003 8:08 pm
Trigger on Colors |
I am attempting to write a trigger that detects if someone is in the room with me. The only indication that the mud gives that this is a real person and not another object or monster is that they are colored differently then anything else in the mud.
Is there a way to find out what color zmud thinks the persons color is?
Also are there any examples of this being done? |
|
|
|
horks Apprentice
Joined: 20 Jul 2001 Posts: 127 Location: USA
|
Posted: Wed May 14, 2003 10:19 pm |
Copy an example of someone being in the room. Make sure it's colored properly. Use the editor to create a new trigger, and before you paste your example, switch over to the options tab, and click 'ANSI Trigger'. Switch back over to the pattern tab, and paste your example. Then just edit the example so that you have (%*) instead of "Person standing here." or whatever your example said.
You don't have to do a copy, but when you do (and also switch the trigger to an ANSI trigger) you'll paste not just the text you copied, but also the proper esc charater for that ansi color.
When you paste, it should look something like this:
%e[1;32mPerson standing here.
or whatever it says in your example text.
so it should be something like:
#TRIGGER {%e[1;32m(%*)} {#SHOW person standing here.}
Father Horks
The only problem with computer security, is when you think it exists. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed May 14, 2003 11:00 pm |
Don't use %*. This is a known security weakness in zMUD. * will provide sufficient matching in almost all cases.
If the color affects the entire line, you can just use the Line Color option.
As always, sample text would get you much more specific answers.
The biggest problem with computer security is people who recommend exploitable weaknesses
LightBulb
Advanced Member |
|
|
|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Thu May 15, 2003 12:37 am |
That works perfectly, thank you.
Second question...
I'm using this to detect if people are in the same room as me to turn off a class of triggers, however, if I do the following all it does is delay when the triggers in the class fire. I would like it if they would not fire at all.
Pattern:
%e[1;32m*$
Action:
#T- "DO STUFF"
#SH TURNED OFF!
#WAIT 5000
#T+ "DO STUFF"
#SH TURNED ON! |
|
|
|
Lain Novice
Joined: 26 Oct 2001 Posts: 38
|
Posted: Thu May 15, 2003 1:04 am |
If you want to turn off the triggers then turn them back on after a delay try using the #ALARM command,
#TR {%e[1;32m(*)$} {#T- "DO STUFF";#SH TURNED OFF!;#ALARM +5 {#T+ "DO STUFF";#SH TURNED ON!}}
Although it looks like the triggers in "DO STUFF" are firing before the folder is turned off then all you are doing is delaying them with the #WAIT command.
Lain |
|
|
|
|
|