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
Fate
Newbie


Joined: 30 Jan 2002
Posts: 9
Location: Canada

PostPosted: Wed Jan 30, 2002 10:37 pm   

Basic Trigger Help
 
Ok.. just need a little help. I'm starting to use triggers and don't have extensive experience in making them. I can make basic triggers to send multiple lines to the mud and whatnot. I use a lot of variables in aliases and would like to integrate them into my triggers.
For starters (well, this will be the only one at the moment.)

Line to trigger to:
"<target> slaps you across the face"

How do I make it so that the trigger recognizes <target> and so that I can set it to "slap" this person back.

I know this question is abreeze for most of you, but hey, I gotta start somewhere.

~Fate
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Jan 30, 2002 11:39 pm   
 
Great stuff on intro here:
Getting Started


Basic triggers here:
Introduction to Triggers

How to pattern match your triggers:
expressions and wildcard characters



TonDiening
Uses 6.16
Reply with quote
Fate
Newbie


Joined: 30 Jan 2002
Posts: 9
Location: Canada

PostPosted: Thu Jan 31, 2002 1:03 am   
 
ah, thanks

~Fate
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 31, 2002 3:25 am   
 
quote:

ah, thanks

~Fate



You presumably know what a variable looks like in code (commonly like @variablename, though it can appear as &variablename in certain situations).

If you simply want to use a variable in a trigger pattern WITHOUT altering the contents, simply insert the @variablename syntax in the position where needed:

@target just slapped you

If you want to capture the person into the target variable, you can use wildcards/special characters which will then be assigned to system variables you can in turn assign to your own variables, like so:

#trigger {(%w) slaps you} {#VAR target %1}

or you can use the reference character (&) to capture the value straight from the trigger pattern without having to later assign it to a variable, like so:

#trigger {&target just slapped you.} {}

li'l shmoe of Dragon's Gate MUD
Reply with quote
Fate
Newbie


Joined: 30 Jan 2002
Posts: 9
Location: Canada

PostPosted: Thu Jan 31, 2002 4:08 am   
 
Yeah, I scoped out the link to the trigger and variable helps. They answered my question. I basically knew what I had to do, I just didn't know what the code was.

Example {(%W) slaps you......
I just didn't know whate character to use..
%w, %a, %s, %x and whatnot.

Thanks again. Can count on me to come up with more questions soon =P
Peace


~Fate
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