Advertisement
Guest User

scan

a guest
Apr 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. function checkSlot()
  2.   if turtle.getItemCount(curSlot) == 0 then
  3.     if curSlot ~= 15 then
  4.       curSlot = curSlot + 1
  5.       turtle.select(curSlot)
  6.       checkSlot()
  7.     elseif curSlot == 15 then
  8.       --[[
  9.       curSlot = 1
  10.       turtle.select(curSlot)
  11.       print("Out of blocks press enter")
  12.       read()
  13.       --]]
  14.       turtle.select(16)
  15.       turtle.placeUp()
  16.       for i = 1, 15 do
  17.         turtle.select(i)
  18.         turtle.suckUp()
  19.       end
  20.       turtle.select(16)
  21.       turtle.digUp()
  22.       curSlot = 1
  23.       turtle.select(curSlot)
  24.     end
  25.   end
  26. end
  27.  
  28. len = 0
  29. curSlot = 1
  30.  
  31. turtle.select(curSlot)
  32.  
  33. while turtle.forward() do
  34.   len = len + 1
  35. end
  36.  
  37. print("Wall is "..len.." in length")
  38.  
  39. turtle.up()
  40. turtle.turnLeft()
  41. turtle.turnLeft()
  42.  
  43. while true do
  44.   for i = 1,len do
  45.     checkSlot()
  46.     turtle.placeDown()
  47.     turtle.forward()
  48.   end
  49.   checkSlot()
  50.   turtle.placeDown()
  51.   turtle.up()
  52.   turtle.turnLeft()
  53.   turtle.turnLeft()
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement