ksbd

Spawner Server

Jun 9th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. --Constants:
  2.  
  3. local redNetSide = "left"
  4. local redInSide = "top"
  5. local compID1 = 4
  6.  
  7. --Variables:
  8.  
  9.  
  10.  
  11. --Functions:
  12.  
  13. function netClose()
  14. rednet.close(redNetSide)
  15. end
  16.  
  17. function netOpen()
  18. netClose()
  19. rednet.open(redNetSide)
  20. end
  21.  
  22. function sendAllOn()
  23. rednet.send(compID1, "On")
  24. end
  25.  
  26. function sendAllOff()
  27. rednet.send(compID1, "Off")
  28. end
  29.  
  30.  
  31. --MAIN PROGRAM:
  32.  
  33. netOpen()
  34.  
  35. while true do
  36. if redstone.getInput(redInSide) then
  37. sendAllOn()
  38. print("Turning On")
  39. else
  40. sendAllOff()
  41. print("Turning Off")
  42. end
  43. sleep(10)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment