kd8lvt

Remote Turtle (WORKS BEST WITH ENDER MODEM)

Sep 10th, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. rednet.open("right")
  2. function slot(num)
  3.   turtle.select(num)
  4. end
  5.  
  6. while true do
  7.   id, command = rednet.receive("kdTurtle")
  8.   if command == "forward" then
  9.     turtle.forward()
  10.   elseif command == "left" then
  11.     turtle.turnLeft()
  12.   elseif command == "right" then
  13.     turtle.turnRight()
  14.   elseif command == "up" then
  15.     turtle.up()
  16.   elseif command == "down" then
  17.     turtle.down()
  18.   elseif command == "mine" then
  19.     turtle.dig()
  20.   elseif command == "mine up" then
  21.     turtle.digUp()
  22.   elseif command == "mine down" then
  23.     turtle.digDown()
  24.   elseif command == "pair" then
  25.     --Ignore
  26.   elseif command == "select1" then
  27.     turtle.select(1)
  28.   elseif command == "select2" then
  29.     turtle.select(2)
  30.   elseif command == "select3" then
  31.     turtle.select(3)
  32.   elseif command == "select4" then
  33.     turtle.select(4)
  34.   elseif command == "select5" then
  35.     turtle.select(5)
  36.   elseif command == "select6" then
  37.     turtle.select(6)
  38.   elseif command == "select7" then
  39.     turtle.select(7)
  40.   elseif command == "select8" then
  41.     turtle.select(8)
  42.   elseif command == "select9" then
  43.     turtle.select(9)
  44.   elseif command == "select10" then
  45.     turtle.select(10)
  46.   elseif command == "select11" then
  47.     turtle.select(11)
  48.   elseif command == "select12" then
  49.     turtle.select(12)
  50.   elseif command == "select13" then
  51.     turtle.select(13)
  52.   elseif command == "select14" then
  53.     turtle.select(14)
  54.   elseif command == "select15" then
  55.     turtle.select(15)
  56.   elseif command == "select16" then
  57.     turtle.select(16)
  58.   else
  59.     print("Unknown Command: "..command)
  60.   end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment