Guest User

test

a guest
Dec 8th, 2014
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. network = require("network")
  2. event = require("event")
  3. computer = require("computer")
  4. send_payload = "mothertrucking"
  5.  
  6. toping = {"EnderRemote", "EnderOne", "EnderTwo", "EnderThree", "Super", "SuperTablet"}
  7. pingids = {}
  8.  
  9. for index,host in pairs(toping) do
  10. pid = network.icmp.ping(host, send_payload)
  11. pingids[pid] = {host=host, time=computer.uptime()}
  12. end
  13.  
  14. while true do
  15. e, addr, id, payload = event.pull("ping_reply")
  16. name = pingids[id].host
  17. time = pingids[id].time
  18. time = computer.uptime()-time
  19.  
  20. print(name.." ["..addr.."]".. "  "..time)
  21. if payload ~= send_payload then print("Warning, Payload bad: "..payload) end
  22.  
  23. end
Advertisement
Add Comment
Please, Sign In to add comment