MatthewGB

CC Internet Client

Dec 7th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. print("NetClient 1.0")
  2. print("Your ID: "..os.getComputerID())
  3. rednet.open("back")
  4. rednet.broadcast("getiprouter"..os.getComputerID())
  5. id, routerid = rednet.receive(10)
  6. if routerid  == "" then
  7.  print("You must be connected to a router to use NetClient")
  8. else
  9.  print("Your router ID: "..routerid)
  10. end
  11. ip = os.getComputerID().."."..routerid
  12. print("Your IP address: "..ip)
  13. done = false
  14. while done == false do
  15.  write("Broadcast: ")
  16.  msg = read()
  17.  rednet.broadcast(msg)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment