Skip to content

Instantly share code, notes, and snippets.

@ScoreUnder
Created September 26, 2016 23:29
Show Gist options
  • Save ScoreUnder/e2bcfeabe41abf20ac57accc2f94e879 to your computer and use it in GitHub Desktop.
Save ScoreUnder/e2bcfeabe41abf20ac57accc2f94e879 to your computer and use it in GitHub Desktop.
OSRS world ping checker
@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