Advertisement
Guest User

straight

a guest
Nov 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. local args = {...}
  2.  
  3. local x = tonumber(args[1])
  4.  
  5. local function checkFuel()
  6.     while turtle.getFuelLevel() < 10 do
  7.         turtle.select(1)
  8.         if turtle.getItemCount(1) < 1 then
  9.             print "Add fuel to slot 1."
  10.             while turtle.getItemCount(1) < 1 do
  11.             end
  12.         end
  13.     turtle.refuel(1)
  14.   end
  15. end
  16.  
  17. local function digForward()
  18.   checkFuel()
  19.   turtle.dig()
  20.   turtle.forward()
  21. end
  22.  
  23. local function digUpDown()
  24.     turtle.digUp()
  25.     turtle.digDown()
  26. end
  27.  
  28. local function placeBlock()
  29.     turtle.select(2)
  30.     if turtle.getItemCount(2) < 1 then
  31.         print "Please place more blocks in slot 2."
  32.         while turtle.getItemCount(2) < 1 do
  33.         end
  34.     end
  35.     turtle.placeDown()
  36. end
  37.  
  38. local function startup()
  39.     print "Please place fuel in slot 1."
  40.     print "Please place block in slot 2."
  41.     print "Press any key when setup is compele."
  42.     read()
  43. end
  44.  
  45. startup()
  46. for i=1, x do
  47.     digForward()
  48.     digUpDown()
  49.     placeBlock()
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement