Advertisement
NanoBob

turtle column builders

Jun 20th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. lenght={ ... }
  2.  
  3. function placeCollumn()
  4.     turtle.placeUp()
  5.     turtle.placeDown()
  6.     turtle.back()
  7.     turtle.place()
  8. end
  9.  
  10. shell.run("refuel","all")
  11. turtle.select(2)
  12.  
  13. function mainProgram()
  14.     if lenght~=nil then
  15.         lenght=tonumber(lenght[1])
  16.         turtle.turnLeft()
  17.         turtle.turnLeft()
  18.         turtle.up()
  19.         for i=1,lenght do
  20.             repeat
  21.                 count=turtle.getItemCount(turtle.getSelectedSlot())
  22.                 if count<=0 then
  23.                     turtle.select(turtle.getSelectedSlot()+1)
  24.                 end
  25.             until count>0
  26.             placeCollumn()
  27.         end
  28.     end
  29. end
  30.  
  31. mainProgram()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement