Isis
04.08.2007, 21:29
MSL SocketBot
alias s.con {
if ($sock(scon)) return
if (!$1) {
echo -ta usage: /s.con irc.antichat.net [6667]
}
else {
sockopen scon $1 $iif($2,$2,6667)
}
}
¤ sockopen scon $1 $iif($2,$2,6667) - открываем связь, если порт не указан, то используем порт 6667
alias s.write {
if (!$sock(scon)) return
sockwrite -n scon $1-
}
¤ sockwrite -n scon $1 - Передает связи, и соответственно серверу команды.
on *:sockopen:scon:{
s.write NICK bot
s.write USER bot * * : bot
.timer 1 4 s.write join #antichat
}
¤ s.write NICK bot - Ник бота
¤ s.write USER bot - Ident бота
¤ .timer 1 4 s.write join #antichat - Спустя 4 секунды заходим на канал
on *:sockread:scon:{
while ($sock(scon).rq) {
if ($sockbr == 0) return
if ($1 == PING) s.write PONG $2-
}
}
Отвечаем на пинги, понгом ;-)
; socketconnection
alias s.con {
if ($sock(scon)) return
if (!$1) {
echo -ta usage: /s.con irc.antichat.net [6667]
}
else {
sockopen scon $1 $iif($2,$2,6667)
}
}
alias s.write {
if (!$sock(scon)) return
sockwrite -n scon $1-
}
on *:sockopen:scon:{
s.write NICK take2
s.write USER take2 * * : take2
.timer 1 4 s.write join #antichat
}
on *:sockread:scon:{
while ($sock(scon).rq) {
if ($sockbr == 0) return
if ($1 == PING) s.write PONG $2-
}
}
(c) Enel
Translation has made Isis
alias s.con {
if ($sock(scon)) return
if (!$1) {
echo -ta usage: /s.con irc.antichat.net [6667]
}
else {
sockopen scon $1 $iif($2,$2,6667)
}
}
¤ sockopen scon $1 $iif($2,$2,6667) - открываем связь, если порт не указан, то используем порт 6667
alias s.write {
if (!$sock(scon)) return
sockwrite -n scon $1-
}
¤ sockwrite -n scon $1 - Передает связи, и соответственно серверу команды.
on *:sockopen:scon:{
s.write NICK bot
s.write USER bot * * : bot
.timer 1 4 s.write join #antichat
}
¤ s.write NICK bot - Ник бота
¤ s.write USER bot - Ident бота
¤ .timer 1 4 s.write join #antichat - Спустя 4 секунды заходим на канал
on *:sockread:scon:{
while ($sock(scon).rq) {
if ($sockbr == 0) return
if ($1 == PING) s.write PONG $2-
}
}
Отвечаем на пинги, понгом ;-)
; socketconnection
alias s.con {
if ($sock(scon)) return
if (!$1) {
echo -ta usage: /s.con irc.antichat.net [6667]
}
else {
sockopen scon $1 $iif($2,$2,6667)
}
}
alias s.write {
if (!$sock(scon)) return
sockwrite -n scon $1-
}
on *:sockopen:scon:{
s.write NICK take2
s.write USER take2 * * : take2
.timer 1 4 s.write join #antichat
}
on *:sockread:scon:{
while ($sock(scon).rq) {
if ($sockbr == 0) return
if ($1 == PING) s.write PONG $2-
}
}
(c) Enel
Translation has made Isis