11 posts
Posted 10 November 2012 - 11:12 AM
I want to use a computer to start a redstone clock, that means I need the pulse to last for far less than a second. would I use: "sleep( .25 );" or something to do less than a second?
818 posts
Posted 10 November 2012 - 11:33 AM
yeah. a note is that if you have less then 0.05 seconds delay you will lose pulses
808 posts
Posted 10 November 2012 - 01:53 PM
The Minecraft world updates 20 times a second. This implies "ticks" which are each 1/20 seconds long where the world updates. So you're computer can turn the signal on for one of those ticks, and turn it off in the other.
rs.setOutput("side", true)
sleep(1/20) -- make the redstone remain on for a whole tick
rs.setOutput("side", false)
sleep(1/20) -- make sure nothing changes the redstone for the next tick so that you ensure it remains off.
Also, people often say a redstone tick is 0.1 seconds. This is only because it takes two world ticks to generate the pulse. One on, one off. And 1/20 + 1/20 = 0.1
389 posts
Location
Norway
Posted 10 November 2012 - 03:49 PM
Programs is for released code only, moved to ask a pro.
11 posts
Posted 11 November 2012 - 03:56 AM
thank you very much, everything is working great. :unsure:/>/>