 |
ohmford Newbie
Joined: 23 Mar 2004 Posts: 3 Location: USA
|
Posted: Tue Mar 23, 2004 6:46 am
Upgrade to 7x broke triggers |
I have run a few searches and was unable to come up with anything. So maybe someone can assist. These triggers use to work I have used them for many many years.
Example:
(Output on my screen)
John says, 'heal'
(My actions)
Checks to see if I am sitting/resting if so stands up. If not goes on to next command. Casts heal on John if John is a member of my budlist.
Code:
Pattern: ^([a..z,A..Z]) says, 'heal'
Value:
#var temp %lower( %1)
#if %ismember( @temp, @budlist) {cast 'heal' %1}
I have messed around and changed the Pattern to (*) says, 'heal' and it seems to work. But I would still like to know what changed or how I could do this better? |
|
|
 |
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Tue Mar 23, 2004 8:08 am |
Try this pattern instead: ^([a-zA-Z]) says, 'heal'
I don't know where you got your .. from, Pascal? |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Mar 23, 2004 8:43 am |
Better yet, just use the list in the pattern.
Pattern: ^({@budlist}) says, 'heal'
Value: cast 'heal' %1
You could also just replace a range containing all the upper- and lower-case letters with %w, the alphabetic wildcard.
EDIT: Fixed typo in pattern. Thanks for pointing it out, Pega, although it might help others more if you actually stated what the mistake was. |
|
|
 |
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Tue Mar 23, 2004 8:57 am |
quote: Pattern: ^(@budlist) says, 'heal'
Edited by - LightBulb on 03/23/2004 01:44:30
Pattern: ^({@budlist}) says, 'heal'  |
|
|
 |
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Tue Mar 23, 2004 9:55 am |
quote: Originally posted by LightBulb
Better yet, just use the list in the pattern.
Pattern: ^({@budlist}) says, 'heal'
Value: cast 'heal' %1
You could also just replace a range containing all the upper- and lower-case letters with %w, the alphabetic wildcard.
EDIT: Fixed typo in pattern. Thanks for pointing it out, Pega, although it might help others more if you actually stated what the mistake was.
Alright.
{val1|val2|val3|...} match any of the specified strings - taken from Pattern Matching in the help file
The variable list @budlist would look something like John|Tom|Bub, using braces around @budlist in the trigger pattern would essentially match in the pattern, any one of a single item in the list.  |
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Tue Mar 23, 2004 3:42 pm |
And completly off base here but for future refrence wouldnt (%w) do the same things as ([a-zA-Z])
Maybe a reread of the Pattern Matching help file is in order :P |
|
|
 |
ohmford Newbie
Joined: 23 Mar 2004 Posts: 3 Location: USA
|
Posted: Mon Mar 29, 2004 7:17 pm |
Thanks for the help/suggestions. As for the %w command I just like the A-Z a-z command better :>
I think I am going to go with the
Pattern: ^({@budlist}) says, 'heal'
Value: cast 'heal' %1
How can I get the code to check and see if I am sitting and if so stand before casting? |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Mar 29, 2004 8:16 pm |
You would have to store this in another variable. For example, the variable @sitting could contain a 1 if you are sitting and 0 otherwise. The trigger would then check the value of this variable:
#IF (@sitting) {stand}
This #IF would go just before casting the spell. Also, notice that zMUD recognizes any non-zero value as true, so @sitting = 1 is not needed if the above convention is followed.
Now you need a way to make this variable contain the correct value. For this, you can create aliases of the commands you use to sit and stand. Example:
#ALIAS sit {~sit;#VAR sitting 1}
#ALIAS stand {~stand;#VAR sitting 0} |
|
|
 |
ohmford Newbie
Joined: 23 Mar 2004 Posts: 3 Location: USA
|
Posted: Wed Mar 31, 2004 4:10 pm |
Thanks once again! I will code it this weekend and test.
|
|
|
 |
|
|