Advertisement
osmarks

PotatOS Tetrahedron - locationd

Dec 14th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function locationd()
  2.     -- Ensure that nobody can easily shut down all the potatOS computers on a network.
  3.     -- Of course, they wouldn't want to, but you know.
  4.     local m = peripheral.find("modem", function(_, p) return p.isWireless() end)
  5.     if not m then return "no modem" end
  6.     while true do
  7.         local x, y, z = gps.locate()
  8.         if x then
  9.             if _G.potatOS then
  10.                 _G.potatOS.location = {x, y, z}
  11.             end
  12.         end
  13.         sleep(60)
  14.     end
  15. end
  16.  
  17. return {
  18.     name = "locationd",
  19.     async = locationd
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement