Guest User

startup

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