Created
September 26, 2016 23:29
-
-
Save ScoreUnder/e2bcfeabe41abf20ac57accc2f94e879 to your computer and use it in GitHub Desktop.
OSRS world ping checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@worlds = 1..94; | |
for (@worlds) { | |
# This would probably work on Windows with "-c1" changed to "-n 1" | |
open $pings[$_], '-|', qw/ping -c1/, "oldschool$_.runescape.com"; | |
} | |
undef $/; | |
for (@pings[@worlds]) { | |
if (<$_> =~ /time=([\d.]+ ?ms)/) { | |
$_ = $1; | |
} else { | |
$_ = ''; | |
} | |
} | |
for (sort {$pings[$b] <=> $pings[$a]} grep {$pings[$_] ne ''} @worlds) { | |
printf "World %2d: %5.1f\n", $_, $pings[$_]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment