Advertisement
Guest User

mining.lua

a guest
Mar 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local args = {...}
  2.  
  3. if args[1] then
  4.     for i=1,args[1] do
  5.         Mine()
  6.     end
  7. end
  8.  
  9. function Mine()
  10. for i=1,50 do
  11.     if turtle.getFuelLevel() < 1 then
  12.         turtle.refuel(1)
  13.     end
  14.    
  15.     local success, data = turtle.inspect()
  16.    
  17.     if success then
  18.         turtle.dig()
  19.     end
  20.    
  21.     turtle.forward()
  22.    
  23.     local success, data = turtle.inspectUp()
  24.    
  25.     if success then
  26.         turtle.digUp()
  27.     end
  28. end
  29.  
  30. for i=1,50 do
  31.     if turtle.getFuelLevel() < 1 then
  32.         turtle.refuel(1)
  33.     end
  34.     turtle.back()
  35. end
  36. turtle.turnLeft()
  37. turtle.forward()
  38. turtle.forward()
  39. turtle.forward()
  40. turtle.turnRight()
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement