karelvysinka

gps turtle

Nov 1st, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1.  print("Man I am so lost right now!")
  2.  local x, y, z = gps.locate(5)
  3.  if not x then --If gps.locate didn't work, it won't return anything. So check to see if it did.
  4.    print("Failed to get my location!")
  5.  else
  6.    print("I am at (" .. x .. ", " .. y .. ", " .. z .. ")") --This prints 'I am at (1, 2, 3)' or whatever your coordinates are
  7.  end
Add Comment
Please, Sign In to add comment