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
Kyote
Novice


Joined: 13 Jan 2002
Posts: 36
Location: USA

PostPosted: Wed Feb 26, 2003 5:20 am   

New #temp problem
 
Now I'm having trouble of a different kind with temp triggers. Here's the mud output and the code:

beezlebob gives you 1 IMP token(s).

#TRIGGER {(%w) gives you 1 IMP token~(s~).} {token;#temp {ImpLuvins Tokens: (%d)} {#va playerfee %1;#sh @playerfee}} "baggame"

This creates a temp trigger just fine. But it has

#va playerfee

instead of

#va playerfee %1

How can I get it to do what I need?

Never mind. I found a way to do it.
I just use &%dplayerfee in the trigger itself. Wish I could delete this post now... *blush* Please tell me how to create a temp trigger in a specific folder though?

------------
Kyote
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Feb 26, 2003 6:33 am   
 
#TRIGGER {(%w) gives you 1 IMP token~(s~).} {token;#temp {ImpLuvins Tokens: (%d)} {#va playerfee %%1;#sh @playerfee} {baggame}} "baggame"



LightBulb
Advanced Member
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Wed Feb 26, 2003 6:36 am   
 
#TRIGGER {(%w) gives you 1 IMP token~(s~).} {token;#temp {ImpLuvins Tokens: (%d)} {#va playerfee %%1;#sh @playerfee} "baggame"} "baggame"

should also work, and put the temp trigger in the baggame class


--edit--
lol
--------

moon.icebound.net:9000
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Wed Feb 26, 2003 6:41 am   
 
It shouldn't be executing #va playerfee with no argument. What should be happening in this case is that the %1 from the first trigger is expanded throughout it and so the %1 in the temp trigger is replaced with the name of whomever gave you the token(s).

So, if anything, it should be #va playerfee beezlebob

Now, to fix this, we need to defer the expansion of %1 in the temp trigger. We do this with an additional %.

So instead of %1, we use %%1. When the main trigger executes, it expands it one level and gets %1 instead. This is then expanded when the temporary trigger is executed which is what you want.

And to create a temp trigger in a class, use the exact syntax you used for this main trigger, except use #TEMP instead of #TRIGGER.

So:
#TRIGGER {(%w) gives you 1 IMP token~(s~).} {token;#TEMP {ImpLuvins Tokens: (%d)} {#VAR playerfee %%1;#SHOW @playerfee}} "baggame"} "baggame"

Edit: this has been one of those cases of taking too long to post a reply and 2 people squeezing in before you. Sorry for any redundancies :P

 - Charbal
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