Skip to content

Instantly share code, notes, and snippets.

@DimitarChristoff
Created February 15, 2011 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DimitarChristoff/827463 to your computer and use it in GitHub Desktop.
Save DimitarChristoff/827463 to your computer and use it in GitHub Desktop.
message somebody in quake.
#!/usr/bin/perl
use Socket;
my %server;
$server{'port'} = "27960";
$server{'host'} = (shift(@ARGV));
@message = @ARGV;
print "trying: $server{'host'}:$server{'port'}\n";
socket(SOCKET, PF_INET, SOCK_DGRAM, getprotobyname("udp"));
unless(gethostbyname($server{'host'})) {
print "unable to open $server{'host'}\n" }
connect(SOCKET, sockaddr_in($server{'port'}, inet_aton($server{'host'})));
send(SOCKET, "\xFF\xFF\xFF\xFFprint foo\n", 0);
print "\xFF\xFF\xFF\xFFprint \n@message\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment