MatthewGB

Floorer

Feb 27th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. width = 10
  2. length = 10
  3. function place2(side)
  4.     if turtle.getItemCount(turtle.getSelectedSlot()) == 0 then
  5.         turtle.select(turtle.getSelectedSlot()+1)
  6.     end
  7.     if side == "f" then
  8.         turtle.place()
  9.     elseif side == "u" then
  10.         turtle.placeUp()
  11.     else
  12.         turtle.placeDown()
  13.     end
  14. end
  15. function forward()
  16.     if turtle.getFuelLevel() == 0 then
  17.         curslot = turtle.getSelectedSlot()
  18.         turtle.select(15)
  19.         turtle.refuel()
  20.         turtle.select(curslot)
  21.     end
  22.     while not turtle.forward() do
  23.         turtle.dig()
  24.     end
  25. end
  26. i = 0
  27. ii = 0
  28. while ii < length do
  29.     turtle.turnRight()
  30.     i = 0
  31.     while i < width do
  32.         print("At gen no "..ii.." building part "..i.." with "..turtle.getFuelLevel().."/"..turtle.getFuelLimit().." fuel left")
  33.         place2()
  34.         forward()
  35.         i = i + 1
  36.     end
  37.     place2()
  38.     i = 0
  39.     turtle.turnRight()
  40.     turtle.turnRight()
  41.     while i < width do
  42.         turtle.forward()
  43.         i = i + 1
  44.     end
  45.     turtle.turnRight()
  46.     forward()
  47.     ii = ii + 1
  48. end
Advertisement
Add Comment
Please, Sign In to add comment