 |
kilion Newbie
Joined: 31 Jan 2002 Posts: 5
|
Posted: Tue Feb 19, 2002 10:52 pm
spell trigger |
i wanna cast a spell if a group member tells me the right spellname.. e.g...
Superman tells the group 'fly'
cast 'fly' Superman
therefore, i created a trig that looks like this...
Trigger: %1 tells the group ~'(%sp)~'
Action:
#IF (%sp=fly) {cast fly %1}
#IF (%sp=infra) {cast infra %1}
#IF (%sp=refresh) {cast refresh %1}
However, it doesn't work.. what's wrong with that? |
|
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Feb 19, 2002 11:17 pm |
Avoid using %1..%99 in trigger patterns,
use %w for words (see help expressions
I believe for other matching things).
Anything you match in your pattern and
you want to reference you need to put
() brackets around it. The
first thing in () will be %1, the second will
be %2, etc.
IFF people asking you are only one word
then you can use (%w) to capture their
names.
IFF spells are only one word then you
can also use (%w) to capture it.
Trigger: (%w) tells the group ~'(%w)~'
Action:
#IF (%2 =~ "fly") {cast fly %1}
..
TonDiening
Beta Upgrading to 6.26
Appended 18:56
Lightbulb has an uncany way to state it simply :) |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Feb 20, 2002 12:30 am |
What's wrong with it is that zMUD doesn't have a "%sp" wildcard.
LightBulb
All scripts untested unless otherwise noted |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Wed Feb 20, 2002 5:46 am |
A slightly faster or slower depending on how look at it solution.
#VAR GroupSpells {fly|invis|detect invis|detect hidden|sanctuary|infra|refresh}
#TR {(%w) tells the group ~'({@GroupSpells})~'$} {cast '"%2"' "%1"}
Then you can just add to the list, and it validates both the spell and preforms all the messy ifs for you. |
|
|
|
 |
|
|
|