Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Where am I?
- lnum = 0
- x = 100
- y = 64
- z = 20
- look = 0
- function getCords()
- if peripheral.find("modem") == false then
- printError("No modem attatched")
- error()
- end
- shell.run("clear")
- term.write("Current Position is...")
- term.write(" "..x.." "..y.." "..z)
- print()
- end
- function getLocation()
- if fs.exists("locations") == false then
- print("No locations file. Would you like to create one? (y/n)")
- input = read()
- if input == "y" then
- locFile = fs.open("locations","w")
- locFile.write("<Location Format: The Z Cordinate: (Next Line) Name of location> DELETE THIS TEXT")
- locFile.close()
- shell.run("clear")
- print("Locations File Created!")
- error()
- elseif input == "n" then
- print("Okay!")
- error()
- end
- elseif fs.exists("locations") == true then
- location = z
- end
- files = fs.open("locations","r")
- repeat
- line = files.readLine()
- if line == z then
- linenum = linenum + 1
- print("You are at "..files.readLine())
- else
- files.readLine()
- end
- until line == nil
- print("No location found")
- end
- getCords()
- getLocation()
Advertisement
Add Comment
Please, Sign In to add comment