Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created by Gunnar Jessee/GNOOR1S
- -- 7/5/22
- local tArgs = {...}
- if #tArgs < 2 then
- print("use 'floor [length] [width]")
- return
- end
- local direction = {left = "left", right = "right"}
- local length = tArgs[1]
- local width = tArgs[2]
- local currentDirection = direction.right
- local selectedSlot = 1
- function fuel()
- if turtle.getFuelLevel() < 10 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(selectedSlot)
- end
- end
- function turn()
- if currentDirection == direction.right then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- currentDirection = direction.left
- elseif currentDirection == direction.left then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- currentDirection = direction.right
- end
- end
- function checkInv()
- if turtle.getItemCount(selectedSlot) < 1 then
- selectedSlot = selectedSlot + 1
- turtle.select(selectedSlot)
- if selectedSlot == 16 then
- selectedSlot = 1
- turtle.select(selectedSlot)
- checkInv()
- end
- checkInv()
- end
- end
- function run()
- for x = 1, width do
- for z = 1, length do
- fuel()
- checkInv()
- turtle.placeDown()
- turtle.forward()
- end
- turtle.back()
- turn()
- end
- end
- run()
Add Comment
Please, Sign In to add comment