Advertisement
Guest User

inspect

a guest
Oct 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. function Pick()
  2.  
  3.   local success, data = turtle.inspect()
  4.  
  5.   if success then
  6.     print("Block name: ", data.name)
  7.     if (tonumber(data.metadata) == 7) then
  8.       turtle.dig()      
  9.     end
  10.   end
  11. end
  12. function turnAround()
  13.   local success, data = turtle.inspectDown()
  14.   if success then
  15.     if (data.name == "minecraft:ice") then
  16.       turtle.turnLeft()
  17.       turtle.turnLeft()
  18.     end
  19.   end
  20. end
  21. while (true) do
  22.  turtle.forward()
  23.  turnAround()
  24.  turtle.turnLeft()
  25.  Pick()
  26.  turtle.turnRight()
  27.  turtle.turnRight()
  28.  Pick()
  29.  turtle.turnLeft()
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement