Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- this program goes from right to left
- -- usage "filler [width](right to left) [height](forward direction)
- local tArgs = {...}
- local width = tArgs[1]
- local height = tArgs[2]
- function fuel()
- if turtle.getFuelLevel() < 10 then
- local slot = turtle.getSelectedSlot()
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(slot)
- end
- if turtle.getFuelLevel() < 9 then
- print("Please insert fuel into turtle, bottom rt")
- repeat
- sleep(.5)
- until turtle.getItemCount(16) > 0
- end
- end
- function check()
- local slot = turtle.getSelectedSlot()
- if slot == 15 then
- -- wait for materials function
- repeat
- sleep(.5)
- until turtle.getItemCount(1) > 1
- turtle.select(1)
- end
- if turtle.getItemCount(slot) < 1 then
- turtle.select(slot + 1)
- end
- end
- function run()
- for x = 1, width do
- for y = 1, height do
- fuel()
- check()
- turtle.placeDown()
- while not turtle.forward() do turtle.dig() end
- end
- if x % 2 > 0 then
- check()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- else
- check()
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- end
- end
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement