Advertisement
Guest User

fillSquare.lua

a guest
Apr 4th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. turtle.select(2)
  2. while (not turtle.detectDown()) do
  3.     if (turtle.getFuelLevel() < 10) then
  4.         local last = turtle.getSelectedSlot()
  5.         turtle.select(1)
  6.         turtle.refuel(1)
  7.         turtle.select(last)
  8.     end
  9.    
  10.     if (turtle.getItemCount() == 0) then
  11.         turtle.select(turtle.getSelectedSlot()+1)
  12.     end
  13.     turtle.placeDown()
  14.     turtle.forward()
  15.    
  16.     if (turtle.detectDown()) then
  17.         turtle.turnLeft()
  18.         turtle.forward()
  19.         turtle.turnLeft()
  20.         turtle.forward()
  21.     elseif (turtle.detect()) then
  22.         turtle.placeDown()
  23.         turtle.turnRight()
  24.         turtle.forward()
  25.         turtle.turnRight()        
  26.     end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement