This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Exerro's profile picture

running a timer in the background

Started by Exerro, 25 June 2012 - 05:56 PM
Exerro #1
Posted 25 June 2012 - 07:56 PM
I'm trying to make a game where you do something and it starts a timer then you can go and do other things but the timer still runs in the background but idk how to do it…any help???
kazagistar #2
Posted 25 June 2012 - 07:59 PM
The wiki is your friend: http://computercraft.info/wiki/index.php?title=OS_%28API%29
Exerro #3
Posted 25 June 2012 - 08:05 PM
but would os.startTimer(840) work in the background…I'm not on my pc so I can't check
MysticT #4
Posted 25 June 2012 - 08:40 PM
Yes, it will run in the background, and when it times out it fires a "timer" event.
Exerro #5
Posted 25 June 2012 - 09:14 PM
Yes, it will run in the background, and when it times out it fires a "timer" event.
how can you use/detect the timer event after it times out
kazagistar #6
Posted 25 June 2012 - 09:25 PM
Its all there on that wiki page. os.pullEvent("timer")