|
Ren Beginner
Joined: 04 Apr 2003 Posts: 27
|
Posted: Fri May 30, 2003 9:36 am
command input trigger |
I have two necklaces. One amber, one silver.
When I type 'remove amber necklace' or 'remove silver necklace', I want a trigger which will automatically execute 'put amber necklace in belt pouch' or 'put silver necklace in belt pouch', respectively.
I messed about with a 'command input' trigger like this:
Pattern: remove (*) necklace
Value: put %1 necklace in belt pouch
It caused Zmud to crash. ;) What am I doing wrong?
- Ren |
|
|
|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Fri May 30, 2003 10:40 am |
you don't need a trigger for that
especially not a "(*)" one .. it's to slow
try to solve it with an alias. |
|
|
|
Ren Beginner
Joined: 04 Apr 2003 Posts: 27
|
Posted: Fri May 30, 2003 11:05 am |
I could use an alias, but I don't want to have to remember different ones for every different necklace I have.
> especially not a "(*)" one .. it's to slow
What do you mean by (*) being slow? What would be a fast substitute? This is interesting. I didn't know there were parsing speed differences. Please elaborate? :)
Thanks.
- Ren |
|
|
|
mrdark Novice
Joined: 25 May 2003 Posts: 37
|
Posted: Fri May 30, 2003 11:56 am |
you need a lot of computing to parse patterns with placeholders like (*) .. try to avoid placeholders if possible.
also try to specify your pattern as exact as possible .e.g in your case replace (*) with (%w) "%w matches any number of alpha characters (a-z) (a word)"
you're right, you can't do it with an alias .. sorry for that disinformation
but this on-input-trigger works fine:
#ONINPUT {remove (%w) necklace} {remove %1 necklace;put %1 necklace in belt pouch} "" {notrig}
the same one as pattern/value/options
pattern:
remove (%w) necklace
value:
remove %1 necklace;put %1 necklace in belt pouch
options
Trigger on Trigger = NO
!!! IMPORTANT !!! uncheck the "trigger on trigger" check box @"trigger options" or zmud will crash like you said .. because of endless trigger loop. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri May 30, 2003 5:13 pm |
This is fairly easy if you do it for everything.
#AL remove {~remove %-1;put %-1 in belt pouch}
Limiting it to necklaces makes it more difficult.
#AL remove {#IF (%ends( "%-1", " necklace")) {~remove %-1;put %-1 in belt pouch} {~remove %-1}}
LightBulb
Advanced Member |
|
|
|
|
|