bindre12

Custom Command Turtles (Basic)

Dec 10th, 2012
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. -- Basic
  2.  
  3. local unloaded = 0
  4. local collected = 0
  5. sleep(1)
  6. rednet.open("right")
  7. while true do
  8.  term.clear()
  9.  term.setCursorPos(1, 1)
  10.  print("Ready to Receve Commands")
  11.  local id, mgs, dis = rednet.receive()
  12.  if mgs == "5Forward" then
  13.   turtle.forward()
  14.  end
  15.  if mgs == "5Back" then
  16.   turtle.back()
  17.  end
  18.  if mgs == "5TurnLeft" then
  19.   turtle.turnLeft()
  20.  end
  21.  if mgs == "5TurnRight" then
  22.   turtle.turnRight()
  23.  end
  24.  if mgs == "5Up" then
  25.   turtle.up()
  26.  end
  27.  if mgs == "5Down" then
  28.   turtle.down()
  29.  end
  30.  if mgs == "5Place" then
  31.   turtle.place()
  32.  end
  33.  if mgs == "5PlaceDown" then
  34.   turtle.placeDown()
  35.  end
  36.  if mgs == "5PlaceUp" then
  37.   turtle.placeUp()
  38.  end
  39.  if mgs == "5Suck" then
  40.   turtle.suck()
  41.  end
  42.  if mgs == "5Drop" then
  43.   for n=1,16 do
  44.    unloaded = unloaded + turtle.getItemCount(n)
  45.    turtle.select(n)
  46.    turtle.drop()
  47.   end
  48.   collected = 0
  49.   turtle.select(1)
  50.  end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment