Posted 15 August 2014 - 02:28 PM
Hello, I hope I can get some help here, because I think I don't understand that event thing…
So, my code is
I want to start a timer, waiting 30 minutes.
Then it emits a redstone signal to forward.
At this point, I want it to sleep (but not sleep()),
till I press a button, which emits another redstone signal on the left.
And then, the timer should start again.
And… I don't really understand that "break".
Greetings
So, my code is
local myTimer = os.startTimer(5)
while true do
local event,timerID = os.pullEvent("timer")
if timerID == myTimer then
rs.setOutput("front", true)
end
break
end
end
local event, redstone = os.pullEvent()
if redstone == rs.getInput("left") then
rs.setOutput("front", false)
end
I want to start a timer, waiting 30 minutes.
Then it emits a redstone signal to forward.
At this point, I want it to sleep (but not sleep()),
till I press a button, which emits another redstone signal on the left.
And then, the timer should start again.
And… I don't really understand that "break".
Greetings