Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clearScrn()
- term.clear()
- term.setCursorPos(1,1)
- end
- function quarry()
- repeat
- local uin = true
- clearScrn()
- print("Would you like to set [N]ew or [O]ld coords:")
- local input = read()
- if input == "N" or input == "n" then
- clearScrn()
- print("Enter X coord:")
- local xq = read()
- rednet.send(48, xq)
- print("Enter Z coord:")
- local zq = read()
- rednet.send(48, zq)
- local file = fs.open("coords", "w")
- file.writeLine(xq)
- file.writeLine(zq)
- file.close()
- clearScrn()
- print("Turtle is quarrying...")
- repeat
- local id, msg = rednet.receive()
- until msg == "done"
- elseif (input == "O" or input == "o") and (fs.exists("coords") == true) then
- local file = fs.open("coords", "r")
- local xf = file.readLine()
- local zf = file.readLine()
- file.close()
- repeat
- local uin1 = true
- clearScrn()
- print("Would you like to move the quarry [F]orward, [B]ack, [L]eft, or [R]ight:")
- input = read()
- if input == "F" or input == "f" then
- zf = zf - 9
- elseif input == "B" or input == "b" then
- zf = zf + 9
- elseif input == "L" or input == "l" then
- xf = xf - 9
- elseif input == "R" or input == "r" then
- xf = xf + 9
- else
- uin1 = false
- end
- until uin1 == true
- rednet.send(48, xf)
- rednet.send(48, zf)
- file = fs.open("coords", "w")
- file.writeLine(xq)
- file.writeLine(zq)
- file.close()
- clearScrn()
- print("Turtle is quarrying...")
- repeat
- local id, msg = rednet.receive()
- until msg == "done"
- else
- uin = false
- end
- until uin == true
- end
- rednet.open("top")
- while true do
- quarry()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement