Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --15x65
- local arg = ...
- local lw = {15, 64}
- local itlw = {0, 0}
- local blockDetected = false
- local offRow = false
- if arg == "scan" then
- local file = fs.open("data.txt", "r")
- itlw[1] = tonumber(file.readLine() or 0)
- itlw[2] = tonumber(file.readLine() or 0)
- file.close()
- end
- turtle.select(1)
- for i = itlw[1], lw[2] do
- for j = itlw[2], lw[1] do
- if turtle.getItemCount() == 0 then
- if turtle.getSelectedSlot() == 16 then
- local cFile = fs.open("data.txt", "w")
- cFile.writeLine(tostring(j))
- cFile.writeLine(tostring(i))
- cFile.close()
- os.reboot()
- end
- turtle.select(turtle.getSelectedSlot() + 1)
- else
- turtle.forward()
- turtle.placeDown()
- end
- end
- if offRow and turtle.getSelectedSlot() ~= 16 then
- turtle.turnLeft()
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- offRow = false
- elseif not offRow and turtle.getSelectedSlot() ~= 16 then
- turtle.turnRight()
- turtle.forward()
- turtle.placeDown()
- turtle.turnRight()
- offRow = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement