Advertisement
augustclear

Send Location

Dec 18th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. function sendLocation(host)
  2.     x,y,z = gps.locate()
  3.     homeid = rednet.lookup("home","home")
  4.     if homeid == nil then
  5.         print("Can't find host")
  6.     else
  7.         --print("ID:" .. homeid)
  8.         message = tostring(x) .. " " .. tostring(y) .. " " .. tostring(z)
  9.         rednet.send(homeid,message,"home")
  10.     end
  11. end
  12.  
  13. sendLocation("home")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement