uepyon

digwall.lua

Jun 29th, 2023 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. args = {...}
  2. local depth = tonumber(args[1])
  3. local width = tonumber(args[2])
  4. local coals = math.floor(depth * width / 80)
  5.  
  6. if turtle.getFuelLevel() < (depth + width) * 2 then
  7.   turtle.select(1)
  8.   turtle.refuel(coals + 1)
  9. end
  10. local fuel = turtle.getFuelLevel()
  11. print("fuel:"..tostring(fuel))
  12.  
  13. local function DigLine(n)
  14.   for i=1, tonumber(n) do
  15.     if turtle.detectDown() then
  16.       print("dig")
  17.       turtle.digDown()
  18.     else
  19.       print("skip")
  20.     end
  21.     turtle.forward()
  22.   end
  23. end
  24.  
  25. turtle.forward()
  26. DigLine(depth)
  27. turtle.turnRight()
  28. DigLine(width)
  29. turtle.turnRight()
  30. DigLine(depth)
  31. turtle.turnRight()
  32. DigLine(width)
  33. turtle.turnRight()
  34. turtle.back()
Tags: ccTweaked
Advertisement
Add Comment
Please, Sign In to add comment