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
Ren
Beginner


Joined: 04 Apr 2003
Posts: 27

PostPosted: 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
Reply with quote
mrdark
Novice


Joined: 25 May 2003
Posts: 37

PostPosted: 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.
Reply with quote
Ren
Beginner


Joined: 04 Apr 2003
Posts: 27

PostPosted: 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
Reply with quote
mrdark
Novice


Joined: 25 May 2003
Posts: 37

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
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