Advertisement
Guest User

test

a guest
Mar 3rd, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. rednet.open("right")
  2.  
  3. local function panel()
  4.  
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print("Remote Control Turtle v2.0")
  8. term.setCursorPos(1,5)
  9. print("When you first install the Remote Control GUI on the REMOTE, make sure you terminate and set the turtle ID in config.")
  10. term.setCursorPos(1,10)
  11. print("This turtle's ID is: "..os.getComputerID())
  12. term.setCursorPos(1,12)
  13. print("Press any key to terminate the program")
  14.  
  15. end
  16.  
  17. local function handle()
  18.  
  19.  
  20.  
  21.  id, msg = rednet.receive()
  22.  
  23.  if msg == "forward" then
  24.   turtle.forward()
  25.  end
  26.  
  27.  if msg == "back" then
  28.   turtle.back()
  29.  end
  30.  
  31.  if msg == "up" then
  32.   turtle.up()
  33.  end
  34.  
  35.  if msg == "down" then
  36.   turtle.down()
  37.  end
  38.  
  39.  if msg == "right" then
  40.   turtle.turnRight()
  41.  end
  42.  
  43.  if msg == "left" then
  44.   turtle.turnLeft()
  45.  end
  46.  
  47.  if msg == "uturn" then
  48.   turtle.turnRight()
  49.   turtle.turnRight()
  50.  end
  51.  
  52.  if msg == "dig" then
  53.   turtle.dig()
  54.  end
  55.  
  56.  if msg == "digdown" then
  57.   turtle.digDown()
  58.  end
  59.  
  60.  if msg == "digup" then
  61.   turtle.digUp()
  62.  end
  63.  
  64.  if msg == "place" then
  65.   turtle.place()
  66.  end
  67.  
  68.  if msg == "placedown" then
  69.   turtle.placeDown()
  70.  end
  71.  
  72.  if msg == "placeup" then
  73.   turtle.placeUp()
  74.  end
  75.  
  76.  if msg == "rsfront" then
  77.   rs.setOutput("front",true)
  78.  end
  79.  
  80.  if msg == "inv1" then
  81.   turtle.select(1)
  82.  end
  83.  
  84.  if msg == "inv2" then
  85.   turtle.select(2)
  86.  end
  87.  
  88.  if msg == "inv3" then
  89.   turtle.select(3)
  90.  end
  91.  
  92.  if msg == "inv4" then
  93.   turtle.select(4)
  94.  end
  95.  
  96.  if msg == "inv5" then
  97.   turtle.select(5)
  98.  end
  99.  
  100.  if msg == "inv6" then
  101.   turtle.select(6)
  102.  end
  103.  
  104.  if msg == "inv7" then
  105.   turtle.select(7)
  106.  end
  107.  
  108.  if msg == "inv8" then
  109.   turtle.select(8)
  110.  end
  111.  
  112.  if msg == "inv9" then
  113.   turtle.select(9)
  114.  end
  115.  
  116.  if msg == "inv10" then
  117.   turtle.select(10)
  118.  end
  119.  
  120.  if msg == "inv11" then
  121.   turtle.select(11)
  122.  end
  123.  
  124.  if msg == "inv12" then
  125.   turtle.select(12)
  126.  end
  127.  
  128.  if msg == "inv13" then
  129.   turtle.select(13)
  130.  end
  131.  
  132.  if msg == "inv14" then
  133.   turtle.select(14)
  134.  end
  135.  
  136.  if msg == "inv15" then
  137.   turtle.select(15)
  138.  end
  139.  
  140.  if msg == "inv16" then
  141.   turtle.select(16)
  142.  end
  143.  end
  144.  local function br()
  145.  os.pullEvent("char")
  146.  local br = true
  147.  end
  148.  while true do
  149.  panel()
  150.  parallel.waitForAny(handle,br)
  151.  if br then
  152.   term.clear()
  153.   term.setCursorPos(1,1)
  154.   print("Thank you for using ninja's program!")
  155.   break
  156.  end
  157.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement