Advertisement
kovakovi2000

_PICKUPER

Feb 13th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. function IsChest()
  2.     success, data = turtle.inspect()
  3.     if not success then
  4.         return false
  5.     end
  6.     if data.name == "minecraft:chest" then
  7.         return true
  8.     end
  9.     return false
  10. end
  11.  
  12. function dropoff()
  13.     for n=1,16 do
  14.         local nCount = turtle.getItemCount(n)
  15.         if nCount > 0 then
  16.             turtle.select(n)          
  17.             turtle.drop()
  18.         end
  19.     end
  20. end
  21.  
  22. while true do
  23.     if turtle.forward() then
  24.         if turtle.detectDown() then
  25.             turtle.digDown()
  26.         end
  27.     else
  28.         if IsChest() then
  29.             dropoff()
  30.         end
  31.         turtle.turnLeft()
  32.     end
  33. end
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement