|
a_priebe47 Newbie
Joined: 04 Aug 2003 Posts: 7 Location: Canada
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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. |
|
|
|
a_priebe47 Newbie
Joined: 04 Aug 2003 Posts: 7 Location: Canada
|
Posted: Mon Aug 04, 2003 4:10 am |
Thanks, I'll look into it.
|
|
|
|
a_priebe47 Newbie
Joined: 04 Aug 2003 Posts: 7 Location: Canada
|
Posted: Mon Aug 04, 2003 6:04 am |
Alright, here's my progress thus far. Here's the pattern:
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. |
|
|
|
jurz Novice
Joined: 22 Feb 2002 Posts: 48 Location: Latvia
|
Posted: 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 |
|
|
|
|
|