Advertisement
MavricMC

Miner phone app

May 30th, 2021 (edited)
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. --PHONE APP--
  2.  
  3. local SERVER_PORT = 0
  4. local PHONE_PORT = 20
  5.  
  6. modem = peripheral.wrap("back")
  7. local cords = {}
  8.  
  9. if (#arg == 3) then
  10.     cords[4] = tonumber(arg[1])
  11.     cords[5] = tonumber(arg[2])
  12.     cords[6] = tonumber(arg[3])
  13. else
  14.     error("NO SIZE GIVEN")
  15. end
  16.  
  17. cords[1], cords[2], cords[3] = gps.locate()
  18. cords[1] = math.floor(cords[1])
  19. cords[2] = math.floor(cords[2])
  20. cords[3] = math.floor(cords[3])
  21. print("Targetting", cords[1], cords[2], cords[3])
  22. modem.transmit(SERVER_PORT, PHONE_PORT, cords)
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement