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
coamenel
Newbie


Joined: 31 Aug 2005
Posts: 7

PostPosted: Fri Jan 13, 2006 2:29 pm   

#loopdb and trigger creation
 
Hi,

I'm trying to use #loopdb to create a trigger, but i'm having problems expanding the %key in my #trigger statement.

what i have now is:
[code]
#loopdb @prices {#TRIGGER {^~"%w~"(%d)%s%key} {#additem %key %%1 _nodef}}
[/code}

Which gives me a trigger like this:
[code]
Pattern:
^~"%w~"(%d)%s%key
Value:
{#additem %key %%1
[/code]

I've tried all the expansion method's i could possibly think of (like <>, {}, (), [] and the %expand() function). But none of those helped me out. Is making a trigger like this not possible at all?

Any help is much appreciated!
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Jan 13, 2006 7:01 pm   
 
I'm not sure of your exact goal here, but could you just make triggers that reference the data record variable directly? If the keys are only one word, it should work to do something like this instead:

#TRIGGER {^~"%w~"(%d)%s@prices.keyname} {#additem keyname %1 _nodef}

I know it doesn't help you with the #loopdb problem. If the @prices keys are fairly static, this could be a different way to try it.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jan 14, 2006 12:29 am   
 
This is a somewhat complex problem. First is that you can use a record variable within a trigger pattern. The trigger will fire for key matches,
Code:
{#TRIGGER {^~"%w~"(%d)%s{@prices}}
The second issue is with the expansion, that you mention is a problem. The main way to bypass the defined expansions for various command is with #EXECUTE and %concat. So far I don't see enough in your question to say that this is the best way to go.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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