SHARE
TWEET

first_relay

a guest Mar 10th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --component=require("component")
  2. local coordx=89
  3. local coordy=-94
  4. local coordz=76
  5. local identification_string="first_relay"
  6.  
  7. local wireless_modem,wired_modem
  8. for i in component.list("modem") do
  9.   local tmpmodemproxy=component.proxy(i)
  10.   if tmpmodemproxy.isWireless() then wireless_modem=tmpmodemproxy else
  11.     wired_modem=tmpmodemproxy end
  12. end
  13.  
  14. if not wireless_modem and not wired_modem then component.computer.beep(3); component.computer.stop() end
  15. wireless_modem.open(312)
  16. while true do
  17.  local ename,laddr,raddr,port,dist,message=computer.pullSignal()
  18.  if ename=="modem_message" and dist>0 and message=="gps_request" then
  19.   wired_modem.broadcast(312,"gps_response",identification_string,coordx,coordy,coordz,dist,raddr)
  20.  end
  21. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top