Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Please place 1 fence in slot 1 and the fuel in slot 16")
- write("How Big?")
- local size = read()
- print("I will now make a "..size.." x "..size.."quarry")
- rednet.open("right")
- rednet.broadcast("ready")
- local id, test = rednet.receive()
- function fuel()
- if turtle.getFuelLevel() < amount then
- turtle.select(16)
- if turtle.refuel() then
- print("Refueling...")
- fuel()
- else
- print("No fuel in slot 16")
- sleep(5)
- fuel()
- end
- else
- print("I have enough fuel")
- end
- end
- function check()
- if slot==16 then
- if remaining > 0 then
- print("I do not have enough fences")
- sleep(5)
- turtle.select(2)
- slot = 2
- check()
- else
- print("I have enough fences")
- end
- else
- if turtle.compareTo(1) then
- items = turtle.getItemCount(slot)
- remaining = remaining-items
- print("check")
- else
- print("nope")
- end
- slot = slot+1
- turtle.select(slot)
- check()
- end
- end
- function right()
- if turtle.compareTo(1) then
- turtle.placeDown()
- else
- slot = slot + 1
- turtle.select(slot)
- right()
- end
- end
- function move()
- if turtle.detectDown then
- turtle.digDown()
- end
- right()
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- while run == 1 do
- amount = size * 4
- fuel()
- slot = 2
- remaining = amount
- turtle.select(2)
- check()
- slot = 2
- turtle.select(2)
- for i = 1, 4, 1 do
- for d = 2, size, 1 do
- move()
- end
- turtle.turnLeft()
- end
- print("Done")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement