Guest User

digwall.lua

a guest
Jun 29th, 2023
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. if turtle.getFuelLevel() == 0 then
  2.   turtle.select(1)
  3.   turtle.refuel(4)
  4. end
  5. local fuel = turtle.getFuelLevel()
  6. print("fuel:"..tostring(fuel))
  7.  
  8. local function DigLine(n)
  9.   for i=1, tonumber(n) do
  10.     if turtle.detectDown() then
  11.       print("dig")
  12.       turtle.digDown()
  13.     else
  14.       print("skip")
  15.     end
  16.     turtle.forward()
  17.   end
  18. end
  19.  
  20. turtle.forward()
  21. DigLine(8)
  22. turtle.turnRight()
  23. DigLine(8)
  24. turtle.turnRight()
  25. DigLine(8)
  26. turtle.turnRight()
  27. DigLine(8)
  28. turtle.turnRight()
  29. turtle.back()
  30.  
Advertisement
Add Comment
Please, Sign In to add comment