Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getOwner()
- if fs.exists("owner.info") == false then
- repeat
- term.clear()
- term.setCursorPos(1,1)
- io.write("Please Enter Owner Name: ")
- input = io.read()
- ownerFile = fs.open("owner.info","w")
- ownerFile.write(input)
- ownerFile.close()
- print("Owner Set To "..input)
- print("Is that correct? (y/n)")
- answ = io.read()
- if answ == "y" then
- print("Okay!")
- elseif answ == "n" then
- ownerFile = fs.open("owner.info","w")
- ownerFile.write("")
- ownerFile.close()
- end
- until answ == "y"
- else
- ownerFile = fs.open("owner.info","r")
- line = ownerFile.readLine()
- ownerFile.close()
- return line
- end
- end
- function getPos()
- x, y, z = gps.locate()
- term.write(x.." ")
- term.write(y.." ")
- term.write(z.." ")
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Turtle Info")
- print("-----------")
- print("Name: "..os.getComputerLabel())
- print("ID Number: "..os.getComputerID())
- print("Fuel Level: "..turtle.getFuelLevel())
- print("Owner: "..getOwner())
- term.write("Position: ")
- term.write(getPos())
Advertisement
Add Comment
Please, Sign In to add comment