5 posts
Posted 02 September 2012 - 04:59 PM
I'm new at computer craft and i've been looking everywhere for Youtube videos on how to make a timer (like every 0.2 seconds it turns on a redstone signal) but I just can't seem to find any. I would appreciate it if someone could help me out :D/>/>
992 posts
Posted 02 September 2012 - 05:10 PM
This should do it
local side = "back" -- this is the side
local pause = 0.2 -- this is 0.2 seconds
while true do
sleep(pause)
rs.setOutput(side,true)
sleep(pause)
rs.setOutput(side,false)
end
1688 posts
Location
'MURICA
Posted 02 September 2012 - 05:11 PM
You could just use a while loop with a sleep:
while true do
rs.setOutput('back', true)
sleep(0.2)
rs.setOutput('back', false)
sleep(0.2)
end
There's also the "redpulse" program.
EDIT: I really hate ninjas.
62 posts
Location
Behind you
Posted 02 September 2012 - 05:13 PM
Change "sleep(pause)" to "sleep(pause / 2)"
As far as I know, sleep(1) is a 2 second delay.
992 posts
Posted 02 September 2012 - 05:18 PM
Change "sleep(pause)" to "sleep(pause / 2)"
As far as I know, sleep(1) is a 2 second delay.
No it is one second to quote the help for sleep()
sleep makes the computer idle for a specific number of seconds.
ex:
"sleep 10" puts the computer to sleep for 10 seconds
5 posts
Posted 02 September 2012 - 11:31 PM
Thank you i would never be able to do this but i'm ready to learn :D/>/>
5 posts
Posted 03 September 2012 - 12:03 AM
so would i type lua and then copy and paste this down? =3
5 posts
Posted 03 September 2012 - 03:53 AM
how would u use redpulse to make it infanite?
318 posts
Location
Somewhere on the planet called earth
Posted 03 September 2012 - 04:46 PM
so would i type lua and then copy and paste this down? =3
To store a program do
edit test –Test is program name
–in there put the code
ctrl s then ctrl e.
Now type: test –And it should run