Advertisement
blacke00

gpsc

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