Advertisement
zurbo

cc_gps_WIP

Dec 17th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. rednet.open("back")
  2.  
  3. lecteur=fs.open("disk/coord","r")
  4. local x,y,z = tonumber(lecteur.readLine()),tonumber(lecteur.readLine()),tonumber(lecteur.readLine())
  5. local nServed = 0
  6.  
  7. while true do
  8.   sender,message,distance = rednet.receive()
  9.  
  10.   if message == "PING" then
  11.     rednet.send(sender, textutils.serialize({x,y,z}))
  12.     nServed = nServed + 1
  13.    
  14.     if nServed > 1 then
  15.       local x,y = term.getCursorPos()
  16.       term.setCursorPos(1,y-1)
  17.     end
  18.    
  19.     print( nServed.." GPS Requests served" )
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement