Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- local tArgs = { ... }
- -- local length = tonumber(tArgs[1])
- -- local width = tonumber(tArgs[2])
- local length = 63
- local width = 63
- local function refuel()
- if turtle.getFuelLevel() == 0 then
- local prev = turtle.getSelectedSlot()
- turtle.select(1)
- if not turtle.refuel(1) then
- print('Need more fuel')
- while not turtle.refuel(1) do
- sleep(1)
- end
- end
- turtle.select(prev)
- end
- end
- local function advance()
- if turtle.getSelectedSlot() == 16 then
- print('Need more materials')
- local empty = true
- while empty do
- for n=2, 16, 1 do
- if turtle.getItemCount(n) > 1 then
- turtle.select(n)
- return
- end
- end
- sleep(3)
- end
- else
- turtle.select(turtle.getSelectedSlot() + 1)
- end
- end
- local function placeBlock()
- turtle.placeUp()
- turtle.forward()
- end
- local function turnAround(i)
- if i%2 == 1 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- turtle.select(2)
- for i = 1, length - 1, 1 do
- for j = 1, width - 1, 1 do
- refuel()
- while turtle.getItemCount() < 1 do
- advance()
- end
- placeBlock()
- end
- turtle.placeUp()
- turnAround(i)
- end
Add Comment
Please, Sign In to add comment