Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jul 06, 2009 5:14 pm |
The problem is that the #ALARM command is creating a script that will run some time later. The value of the script is not evaluated and executed until when the alarm fires. And when that happens, the $area local variable is no longer defined. What you want is something like this:
Code: |
#EXEC %concat("#alarm +%eval(%1*60) {gt ",$area," repopping in less than 1 min.}") |
That will force the $area local variable to be expanded when the alarm is created instead of when the alarm fires.
Or, honestly, this is a case where you should probably just be using a normal variable and not a local variable. The speed improvement from the local variable will get negated by the use of #EXEC. You should just do:
Code: |
area = @misc.CurrentArea
gt @area will repop in %1 Mins or so.
#say @area
#alarm +%eval(%1*60) {gt @area repopping in less than 1 min.} |
Since this uses a session variable, then @area will always be properly defined. You can check the "Use Default" option for the @area variable if you don't want to save it across sessions to speed it up a bit. |
|