Quipex

Disk/mem/redworks/programs/circuits/Timer

Apr 23rd, 2012
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. --1
  2. --1
  3. --1
  4. input = {}
  5. output = {}
  6. extra = {}
  7. input[1] = "front"
  8. output[1] = "back"
  9. extra[1] = "The delay of pulse."
  10.  
  11.  
  12. -- Simple Timer
  13. -- Created by: FuzzyPurp
  14.  
  15. local rRunning = true
  16. term.clear()
  17. term.setCursorPos(1,2)
  18. print("Timer is now running with a " .. extra[1] .. " sec. delay.")
  19. print("\nInput(s): " .. input[1] .. ".")
  20. print("Output(s): " .. output[1] .. ".")
  21. print("\nHold Control+R to reboot.")
  22. print("Hold Control+T to terminate.")
  23.  
  24.  
  25. while rRunning do
  26. sleep(extra[1] - 0.1)
  27. if rs.getInput(input[1]) then
  28. else
  29. rs.setOutput(output[1], true)
  30. sleep(0.1)
  31. rs.setOutput(output[1], false)
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment