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
umdbandit
Wanderer


Joined: 31 Oct 2004
Posts: 94

PostPosted: Wed Sep 21, 2005 5:12 am   

how do i not expand variables
 
so i have an alias called renewalarm which does the following

#ALARM +30 {
3drink keg
#IF @ep<70 {renewalarm}
#IF @ep>70 {house2in}
}

what i want it to do, is make a 30 second alarm that resets itself if the ep hasnt reached 70, and run house2in if the ep has reached 70

what its doing though, is creating the alarm, but its expanding the @ep variable. in the alarm, I want @ep to stay as @ep, not as 23 or 43 or 20 or whatever number it is at the time. From what i've read on the help files, this SHOULD work, and to expand it, I should use %exec. That being said, its not working, and its expanding them without me doing anythign. So any advice or tips or solutions would be great


-umdbandit
_________________
Rufus- Winner of Stuff
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Wed Sep 21, 2005 9:06 am   Re: how do i not expand variables
 
Off the top of my head with no zMud at my disposal right now. The Help file doesn't show it in the Syntax for #IF, but the expression needs to be in parentheses (). This is shown in the Examples for #IF. IIRC, without the () the brackets {} cause the @VAR to be parsed to its value.

#ALARM +30 {
3drink keg
#IF (@ep<70) {renewalarm}
#IF (@ep>70) {house2in}
}
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
umdbandit
Wanderer


Joined: 31 Oct 2004
Posts: 94

PostPosted: Wed Sep 21, 2005 9:04 pm   perfect
 
It works perfect now.


Thanks a million, Slaem.

Btw, the #IF will function fine as part of a trigger or alias or whatever, even without the perentheses. Its when I used a trigger or alias to create a new trigger or alias with the #IF statement that it bugged up. At any rate, problem solved and thanks a lot :)


-umdbandit
_________________
Rufus- Winner of Stuff
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Thu Sep 22, 2005 3:16 am   
 
Since only one of the two #IFs can result in true, you could simplify the alarm like this:
Code:
#ALARM +30 {
3drink keg
#IF (@ep<70) {renewalarm} {house2in}
}
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