So I've been improving at LUA slowly and unsteadily. My recent achievement was learning how to write messages on monitors (yay!); Proud of being a newb, I'm looking into a countdown timer that loops after a small amount of time has passed. From what I understood, the sleep() function helps with that.
Now; I've browsed these forums but can't seem to find a code that makes sense to me. (They either have some output signal, lock doors or do other stuff) What I'm looking for is a timer that counts down from X amount of seconds; To pause a minute, then to start counting again with no further help needed. It just repeats itself over and over on a screen, not outputting anything, nor triggering. Just constantly repeating the message.
The idea is to sync it with the Railroad (Railcraft thing) I've been building, so that when the timer reaches 0 the train is actually on the station. Then it waits a minute, and when the train goes off it starts counting down again.
So:
Timer counts down from 3 minutes.
Reaches 0.
Waits for the train to leave again. ~Minute or so. (sleep function?)
When it's left, the counter starts at 3 again and counts down.
I'm trying to avoid hooking it up to redstone and sensors and rather time it myself with a watch as that seems much easier. xD
I'm sorry if it's been asked before, or if it's somewhere on the wiki. Either a helping hand with searching is appreciated, or insight into the code I'm looking for. =) Thanks in advance; Alternative ideas welcome if that's easier.