mackpack

Untitled

Apr 24th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. -- you can change the input/output redstone sides to:
  2. -- top,bottom,left,right,front,back
  3. local tArgs = {...}
  4. pulseLength = tArgs[1] -- In ticks
  5. clockSpeed = tArgs[2] -- In ticks, remember 20 ticks a second
  6.  
  7. while true do
  8.     while not rs.getInput("bottom") do -- Remove "not" if you want to enable the clock when supplying a signal
  9.         rs.setOutput("top", true)
  10.         sleep(pulseLength / 20)
  11.         rs.setOutput("top", false)
  12.         sleep((clockSpeed - pulseLength) / 20)
  13.     end
  14.     event = os.pullEvent("redstone")
  15. end
Advertisement
Add Comment
Please, Sign In to add comment