rendered paste bodyAlias Socket {
Sockopen Socket irc.kingskrown.com 6667
}
On *:Sockopen:Socket:{
Sockwrite -nt $Sockname User Socket × × :Socket
Sockwrite -nt $Sockname Nick $Me
.Debug -n Socket.ini
}
On *:Sockread:Socket:{
Sockread %Socket
Tokenize 32 %Socket
If ($1 == Ping) {
Sockwrite -nt $Sockname Pong $Gettok($2,1,58)
}
Elseif ($2 == Privmsg) {
If ($Gettok($4,2,1) == Ping) && ($5) {
Sockwrite -nt $Sockname Notice $Gettok($Gettok($1,1,33),1,58) $4 $5
}
If ($Gettok($1,2,64) == 127.0.0.1) {
If ($Gettok($4,2,1) == Raw) {
Sockwrite -nt $Sockname $($5-,2)
}
Elseif ($Gettok($4,2,1) == Udp) {
Var %Sockudp = $Gettok($Gettok($5,2,58),1,44)
While (%Sockudp <= $Remove($Gettok($5,2,44),$Chr(1))) {
Sockudp -n Sockudp. $+ %Sockudp $Gettok($5,1,58) %Sockudp
Inc %Sockudp = 1
}
}
}
}
Elseif ($2 == 001) {
Sockwrite -nt $Sockname Join $Chr(35)
}
Elseif ($2 == 433) {
Sockwrite -nt $Sockname Nick Socket $+ $Regsubex($Str(-,5),/-/g,$r(1,9))
}
Unset %Socket
}
On *:Sockclose:Socket:{
Sockclose $Sockname
Socket
}