 |
umdbandit Wanderer
Joined: 31 Oct 2004 Posts: 94
|
Posted: 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 |
|
|
 |
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: 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}
} |
|
|
 |
umdbandit Wanderer
Joined: 31 Oct 2004 Posts: 94
|
Posted: 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 |
|
|
 |
Vorax Apprentice

Joined: 29 Jun 2001 Posts: 198 Location: USA
|
Posted: 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}
} |
|
|
|
 |
|
|