|
Agroamar Beginner
Joined: 09 Feb 2002 Posts: 10 Location: USA
|
Posted: Sat Feb 09, 2002 3:47 pm
Need help with Simple Alarm/trigger |
Alright, this seems pretty simple, and yes it works... except I cant get the trigger to echo the text i want when the variable equals stop... so here it is:
#VAR move {n|e|s|w|stop}
#VAR moves 0
#ALIAS go {#EXEC %item(@move, @moves)}
#ALARM *1 {#IF (@move=stop,#ECHO DONE!,go;#ADD moves 1)}
I have tried a few different things, but it just wont work, Any help would be greatly appreciated. Thanks. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Feb 09, 2002 4:47 pm |
#ALARM *1 {#IF (@move=stop) {#ECHO DONE!,go;#ADD moves 1}}
LightBulb
All scripts untested unless otherwise noted |
|
|
|
Kru Beginner
Joined: 14 Nov 2001 Posts: 28
|
Posted: Sat Feb 09, 2002 5:03 pm |
The #IF command works with brackets. You have your if set up like the %if function, which is slightly different.
You want this.
#ALARM *1 {#IF (@move=stop){#ECHO DONE!}{go;#ADD moves 1}} |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Feb 09, 2002 5:57 pm |
Also, @move will never equal "stop" because it's value is set at first to "n|e|s|w|stop" but it is never changed afterwards, so there is not reason why it should ever equal "stop"
However, %item(@move, @moves) will be equal to "stop" once @moves equals 5, but then you will receive the message "Done!" every second. Also, the first element of a list is not 0, but 1. I suggest revising the logic here.
Kjata |
|
|
|
|
|
|
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
|
|