Microstar301

CCCCM2

Feb 18th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. --run
  2. --TURTLE CONTROL v0.6 Made by Banzai_Bill
  3. --Do not distribute!
  4. rednet.send(18,"ON?")
  5. x,y,z=rednet.receive(2)
  6. if x==18 and y=="ON" then
  7.  
  8. else
  9. term.clear()
  10. term.setCursorPos(2,6)
  11. term.setTextColor(colors.red)
  12. print("ERROR: TURTLE NOT FOUND!")
  13. term.setCursorPos(2,8)
  14. print("MAKE SURE THAT THE TURTLE")
  15. term.setCursorPos(2,9)
  16. print("IS TURNED ON!")
  17. sleep(5)
  18. os.shutdown()
  19. end
  20.  
  21. while true do
  22. e,k,x,y=os.pullEvent("mouse_click")
  23.  
  24. if x==5 and y==2 then
  25. rednet.send(18,"UP")
  26. sleep(1)
  27. end
  28.  
  29. if x==23 and y==2 then
  30. rednet.send(18,"DOWN")
  31. sleep(1)
  32. end
  33.  
  34. if x==15 and y==3 then
  35. rednet.send(18,"FW")
  36. sleep(1)
  37. end
  38.  
  39. if x==10 and y==6 then
  40. rednet.send(18,"LEFT")
  41. sleep(1)
  42. end
  43.  
  44. if x==20 and y==6 then
  45. rednet.send(18,"RIGHT")
  46. sleep(1)
  47. end
  48.  
  49. if x==15 and y==9 then
  50. rednet.send(18,"BACK")
  51. sleep(1)
  52. end
  53.  
  54. if x==23 and y==11 then
  55. rednet.send(18,"BREAK")
  56. sleep(1)
  57. end
  58.  
  59. if x==5 and y==11 then
  60. rednet.send(18,"PLACE")
  61. sleep(1)
  62. end
  63.  
  64. if x==3 and y==9 or x==4 and y==9 or x==5 and y==9 then
  65. rednet.send(18,"SHUTDOWN")
  66. term.clear()
  67. term.setCursorPos(1,5)
  68. term.setTextColor(colors.lightBlue)
  69. print("+--------------------------+")
  70. print("|       SHUTDOWN...        |")
  71. print("+--------------------------+")
  72. sleep(3)
  73. term.setTextColor(colors.white)
  74. os.shutdown()
  75. end
  76.  
  77. end
Advertisement
Add Comment
Please, Sign In to add comment