bindre12

Custom Command Turtles (Logger)

Dec 10th, 2012
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. -- Logger
  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 == "3Forward" then
  13.   turtle.forward()
  14.  end
  15.  if mgs == "3Back" then
  16.   turtle.back()
  17.  end
  18.  if mgs == "3TurnLeft" then
  19.   turtle.turnLeft()
  20.  end
  21.  if mgs == "3TurnRight" then
  22.   turtle.turnRight()
  23.  end
  24.  if mgs == "3Up" then
  25.   turtle.up()
  26.  end
  27.  if mgs == "3Down" then
  28.   turtle.down()
  29.  end
  30.  if mgs == "3Dig" then
  31.   turtle.dig()
  32.  end
  33.  if mgs == "3DigUp" then
  34.   turtle.digUp()
  35.  end
  36.  if mgs == "3DigDown" then
  37.   turtle.digDown()
  38.  end
  39.  if mgs == "3Place" then
  40.   turtle.place()
  41.  end
  42.  if mgs == "3PlaceDown" then
  43.   turtle.placeDown()
  44.  end
  45.  if mgs == "3PlaceUp" then
  46.   turtle.placeUp()
  47.  end
  48.  if mgs == "3Drop" then
  49.   for n=1,16 do
  50.    unloaded = unloaded + turtle.getItemCount(n)
  51.    turtle.select(n)
  52.    turtle.drop()
  53.   end
  54.   collected = 0
  55.   turtle.select(1)
  56.  end
  57.  if mgs == "3Cut" then
  58.   turtle.dig()
  59.   turtle.forward()
  60.   while turtle.detectUp() do
  61.    turtle.digUp()
  62.    turtle.up()
  63.   end
  64.   while not turtle.detectDown() do
  65.    turtle.down()
  66.   end
  67.   rednet.broadcast("LDone")
  68.  end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment