Automatically creates and maintains multiple socket connections to multiple IRC servers. The script should be added to to create more automated commands. Currently it returns PING replies from the server to maintain the connection and automatically joins a channel on connection.
Requires good knowledge of raw commands and decent knowledge of scripting in general.
Typing into a connection will send raw commands.
/writeall - Can be used to send raw commands to all connections.
/ircconnect [N] - Opens N new connections (N optional).
alias ircconnect {
sockopen irc irc.quakenet.org 6667
if ($1 isnum 2-) {
var %i = $int($1) - 1
while (%i) {
.timer 1 %i sockopen irc irc.quakenet.org 6667
dec %i
}
}
}
on *:SOCKOPEN:irc:{
var %i = $calc($sock(irc*,0))
sockrename irc irc $+ %i
window -e @irc $+ %i
echo @irc $+ %i $sockname : Connected to server.
sockwrite -n irc $+ %i NICK DaveohTest $+ %i $+ $crlf $+ USER ident "" "irc.quakenet.org" :Daveoh
echo @irc $+ %i -> NICK DaveohTest $+ %i
echo @irc $+ %i -> USER ident "" "irc.quakenet.org" :Daveoh
}
on *:SOCKREAD:irc*:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
tokenize 32 %temp
if (%temp == $null) %temp = -
echo @ $+ $sockname <- %temp
if (PING == $1 && $2) {
;PING reply
sockwrite -n $sockname PONG $2
echo @ $+ $sockname -> PONG $2
}
elseif (001 == $2) {
;successfully connected to server
sockwrite -n $sockname JOIN #Daveoh
echo @ $+ $sockname -> JOIN #Daveoh
}
goto nextread
}
on *:SOCKCLOSE:irc*:{
echo @ $+ $sockname $sockname : Lost connection.
}
on *:INPUT:@irc*:{
if (/* !iswm $1) {
sockwrite -n $right($active,-1) $1-
echo @ $+ $right($active,-1) -> $1-
}
}
alias writeall {
var %i = 1
while ($sock(irc*,%i)) {
sockwrite -n $v1 $1-
echo @ $+ $v1 -> $1-
inc %i
}
}
on *:CLOSE:@:{
if ($sock($right($target,-1))) { .timer 1 0 window -e $target $chr(124) echo -s Reopened IRC connection window $target }
}
Yeah, it works - i added things i needed and everything is almost fine till the \"Client exited\" thing - it means, when the nick idles in the chan throught the sockets, it gets Client exited quits pretty much, is it PING PONG related or anything else - i dont know.
Just curios about how to fix that.