Advertisement
AwesomeArab

Fill a Hole [Turtle]

May 29th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. length = 64
  2. width = 64
  3. left = false
  4. slot = 1
  5.  
  6. function chestCheck()
  7.   if slot == 16 then
  8.     turtle.placeUp()
  9.     for i = 1, 15 do
  10.       turtle.select(i)
  11.       turtle.suckUp()
  12.     end
  13.     turtle.digUp()
  14.     slot = 1
  15.   else
  16.     slot = slot + 1
  17.   end
  18. end
  19.  
  20. function slotCheck()
  21.   if turtle.getItemCount() == 0 then
  22.     chestCheck()
  23.     turtle.select(slot)
  24.   end
  25. end
  26.  
  27. function drop()
  28.   while not turtle.detectDown() do
  29.     slotCheck()
  30.     turtle.placeDown()
  31.   end
  32. end
  33.  
  34. l = 1
  35. w = 1
  36. while w <= width do
  37.   w = w + 1
  38.   while l <= length do
  39.     l = l + 1
  40.     drop()
  41.     turtle.forward()
  42.   end
  43.   l = 1
  44.   if left do
  45.     turtle.turnLeft()
  46.     turtle.forward()
  47.     turtle.turnLeft()
  48.   else
  49.     turtle.turnRight()
  50.     turtle.forward()
  51.     turtle.turnRight()
  52.   end
  53.   left = not left
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement