|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sun Mar 01, 2015 6:31 am
Naming #ALARMS. |
Last question of the day!
I use alarms to reset the values in certain variables. Is there a way to name #ALARMS so I can check to see how long is left on them?
eg:
Code: |
#ALARM 900 {gates = open} |
Using that alarm as an example, I want to be able to check how long until the gates open? (I know I can type the #ALARM command to bring up all my #ALARMs, but that is a long list, I want to be able to isolate them). |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sun Mar 01, 2015 6:39 am |
I've read that I can give them an ID using:
Code: |
#ALARM "gates" 900 {gates = open}
|
But see no way of calling that up to see how long is remaining. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sun Mar 01, 2015 2:19 pm |
Use the %alarm function.
|
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Sun Mar 01, 2015 10:47 pm |
Sweet, that returns the result in milliseconds, so I made this little script to convert it into real time (forgive my poor maths).
Code: |
#ALARM "tester" 1000 {}
#MATH alarmmins (%alarm(tester)/1000)/60
#MATH alarmsecs (%alarm(tester)/1000)
#IF (@alarmmins < 1) {#SHOW Seconds until alarm: @alarmsecs} {#SHOW Minutes until alarm: @alarmmins}
|
Works nicely, thanks for the help. |
|
|
|
Scarn Apprentice
Joined: 24 Jul 2005 Posts: 137
|
Posted: Mon Mar 02, 2015 6:14 pm |
Is there a way to delete an alarm from the command line?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Mon Mar 02, 2015 10:39 pm |
you can use the #UNTRIGGER command
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|