2017-03-23 12:10:09 +11:00
|
|
|
-- I, 20kdc, release this into the public domain.
|
|
|
|
-- No warranty is provided, implied or otherwise.
|
2017-03-23 10:05:31 +11:00
|
|
|
local occure = require("occure")
|
|
|
|
local computer = require("computer")
|
|
|
|
local event = require("event")
|
|
|
|
|
|
|
|
local args = {...}
|
|
|
|
local startTime = computer.uptime()
|
|
|
|
local completed = 0
|
|
|
|
for _, v in ipairs(args) do
|
|
|
|
occure.output(v, 0, "", false, function ()
|
|
|
|
print("Ping response from " .. v .. " @ " .. (computer.uptime() - startTime))
|
|
|
|
completed = completed + 1
|
|
|
|
end, function ()
|
|
|
|
print("Gave up trying to ping " .. v)
|
|
|
|
completed = completed + 1
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
while completed < #args do
|
|
|
|
event.pull(5)
|
|
|
|
end
|