Skip to content

Instantly share code, notes, and snippets.

@Haspaker
Created July 13, 2014 20:44
Show Gist options
  • Save Haspaker/2d2dbd1546a3bdb368e8 to your computer and use it in GitHub Desktop.
Save Haspaker/2d2dbd1546a3bdb368e8 to your computer and use it in GitHub Desktop.
on ^*:TEXT:pgauigh*:#IRCwars: {
sockclose test
sockopen test appspot.com 80
set %nick $+(<,$nick(#,$nick).pnick,>)
set %method decode
set %msg $replace($1-, $chr(32), $chr(37) $+ 20, $chr(35),$chr(37) $+ 23)
haltdef
}
on *:INPUT:#IRCwars: {
if ($left($1,1) != /) {
sockclose test
sockopen test appspot.com 80
set %nick $+(<,%nick(#,%nick).pnick,>)
set %method encode
set %msg $replace($1-, $chr(32), $chr(37) $+ 20, $chr(35),$chr(37) $+ 23)
echo # $+(<,$nick(#,$nick).pnick,>) $1-
haltdef
}
}
on *:sockopen:test: {
sockwrite -n $sockname GET /? $+ %method $+ = $+ %msg HTTP/1.0
sockwrite -n $sockname Host: mrdvpfr.appspot.com
sockwrite -n $sockname
}
on *:sockread:test: {
var %x
sockread %x
while ($sockbr) {
if (__Result:__ isin %x) {
if (%method == decode) {
echo #IRCwars %nick $remove(%x, __Result:__)
}
if (%method == encode) {
.msg #IRCwars $remove(%x, __Result:__)
}
}
sockread -f %x
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment