Guest User

fill

a guest
Jun 10th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. local tArgs = {...}
  2.  
  3. -- edit this line to adjust the height
  4. local height = 33
  5.  
  6. function Place()
  7.   start = turtle.getSelectedSlot()
  8.   local data = turtle.getItemDetail()
  9.   if data == nil then
  10.     start = start + 1
  11.     turtle.select(start)
  12.     turtle.placeDown()
  13.   elseif data.name ~= "minecraft:cobblestone" then
  14.     start = start + 1
  15.     turtle.select(start)
  16.     turtle.placeDown()
  17.   else
  18.     turtle.placeDown()  
  19.   end
  20. end
  21.  
  22. function goDown()
  23.     for i=1, height do
  24.        if turtle.detectDown() then
  25.          turtle.digDown()
  26.          turtle.down()
  27.        else
  28.          turtle.down()
  29.        end
  30.     end
  31. end
  32.  
  33. function goUp()
  34.     for i=1, height do
  35.        if turtle.detectUp() then
  36.          turtle.digUp()
  37.          turtle.up()
  38.          Place()
  39.        else
  40.          turtle.up()
  41.          Place()
  42.        end
  43.     end
  44. end
  45.  
  46. function goForward()
  47.   if turtle.detect() then
  48.     turtle.dig()
  49.     turtle.forward()
  50.   else
  51.     turtle.forward()
  52.   end
  53. end
  54.  
  55. function rowCount()
  56.     for i=1, tonumber(tArgs[1]) do
  57.       goForward()
  58.       goDown()
  59.       goUp()
  60.     end
  61. end
  62. rowCount()
  63. turtle.select(1)
Advertisement
Add Comment
Please, Sign In to add comment