Advertisement
jared314

build floor

Oct 1st, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. floorSize = 100
  2.  
  3. currentSlot = 2
  4.  
  5.  
  6. function PlaceTorch()
  7.     turtle.select(1)
  8.     turtle.turnRight()
  9.     turtle.turnRight()
  10.    
  11.     turtle.place()
  12.    
  13.     turtle.turnRight()
  14.     turtle.turnRight()
  15.     turtle.select(currentSlot)
  16. end
  17.  
  18. function CheckSlotLevel()
  19.     if (turtle.getItemCount() <= 0) then
  20.         currentSlot = currentSlot + 1
  21.         turtle.select(currentSlot)
  22.     end
  23. end
  24.  
  25. function BuildRow(torch)
  26.     for i=0,floorSize,1 do
  27.         CheckSlotLevel()
  28.         turtle.placeDown()    
  29.         if (torch and (i%5==0)) then
  30.             PlaceTorch()
  31.         end
  32.     end
  33. end
  34.  
  35. function Build()
  36.     BuildRow(false)
  37.     for i=0,floorSize,1 do
  38.         torch = i%5==0
  39.         BuildRow(torch)
  40.     end
  41. end
  42.  
  43. turtle.select(currentSlot)
  44. Build()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement