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


Joined: 04 Aug 2003
Posts: 7
Location: Canada

PostPosted: Mon Aug 04, 2003 3:44 am   

Trigger Problem
 
Alright, say I have a trigger that casts a variety of spells on the person who says the keyword:
Code:

#TRIGGER {help} {<cast spells>}


I was wondering how I would get the trigger to know who to cast which spell on. For instance, cast 'dragon wit' <person>. If anyone could help me with this script I'd appreciate it alot. Thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Aug 04, 2003 4:08 am   
 
why not trigger on the WHOLE say line?

Jeff says, "help"
#trigger {(%w) says, ~"help~"} {}

To find out what the %w and other wildcards mean, crack open the help file and look under Pattern Matching.
Reply with quote
a_priebe47
Newbie


Joined: 04 Aug 2003
Posts: 7
Location: Canada

PostPosted: Mon Aug 04, 2003 4:10 am   
 
Thanks, I'll look into it.
Reply with quote
a_priebe47
Newbie


Joined: 04 Aug 2003
Posts: 7
Location: Canada

PostPosted: Mon Aug 04, 2003 6:04 am   
 
Alright, here's my progress thus far. Here's the pattern:
Code:

(%w) says ~'help~'

And here's the values:
Code:

c 'ogre might' (%w) , c 'trollish vigor' (%w) ,
c 'dragon wit' (%w) , c slink (%w) , c 'elven beauty' (%w) , c shield (%w)

Now once the person says help, it prints all the spells to be cast to the screen but it doesn't cast them.(For obvious reasons that you all know that I don't :D) Any help would be great. Thanks.
Reply with quote
jurz
Novice


Joined: 22 Feb 2002
Posts: 48
Location: Latvia

PostPosted: Tue Aug 05, 2003 4:34 pm   
 
Do it like this

#TRIGGER {(%w) says: help} {smile %1;maim %1;hide %1}

%1 will be the name of the person saying help
on some muds you might have to write in lower case
so that would be

#TRIGGER {(%w) says: help} {smile %lower(%1);maim %lower(%1);hide %lower(%1)}


-Jurz
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