Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Gage
Beginner


Joined: 07 Jan 2003
Posts: 23

PostPosted: 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?
Reply with quote
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Gage
Beginner


Joined: 07 Jan 2003
Posts: 23

PostPosted: 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!
Reply with quote
Lain
Novice


Joined: 26 Oct 2001
Posts: 38

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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