Advertisement
D35Per4d0

Wool Master

May 28th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. function Shave()
  2.     while true do
  3.         rednet.broadcast("Shave")
  4.         os.sleep(5)
  5.     end
  6. end
  7.  
  8. function Interrupt()
  9.     while true do
  10.         event, param = os.pullEvent("key")
  11.         if param == 16 then
  12.             rednet.broadcast("Quit")
  13.             print("Aborted")
  14.             break
  15.         end
  16.     end
  17. end
  18.  
  19.  
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. print("What side is your modem on?")
  23. local modem = read()
  24. rednet.open(modem)
  25.  
  26. term.clear()
  27. term.setCursorPos(1,1)
  28. textutils.slowPrint("Turtle Control Initiated.")
  29. print ("Press 'Q' to stop program.")
  30.  
  31. parallel.waitForAny(Shave, Interrupt)
  32. rednet.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement