Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Enter name for location") -- prompts the user for input
- local c = io.read() -- stores the user input in a var
- local cl = string.lower(c) -- converts the stored input to lower case (for search reasons)
- local cx, cy, cz, ch = tgps.getturtlepos() -- get current position using previous function
- local pos = {cl,cx,cy,cz} -- makes a table
- local cpos = textutils.serialize( pos ) -- turnes the table into a string
- local file = fs.open("gpsc.txt" , "a") -- opens a file in append mode
- file.writeLine(cpos) -- writes the string to the file
- file.close() -- closes the file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement