Kod: Kodu kopyalamak için üzerine çift tıklayın!
alias bb if (!$sock(b)) sockopen b irc.trsohbet.com 6667
alias nk return $remove($gettok($1,1,33),:)
on *:sockopen:b:{
var %s sockwrite -nt $sockname
%s NICK $+(bot,$r(0,10000000000))
%s USER $+(Ident,$chr(32),*,$chr(32),*,$chr(32),:,my bot)
}
on *:SOCKREAD:b:{
var %b | sockread -f %b | tokenize 32 %b
$iif(!$window(@b),window -zel20 @b)
if ($regex($1,PING)) sockwrite -n $sockname PONG $2
if $regex($2-,/privmsg .+ \:version/i) { sockwrite -n $sockname notice $nk($1) $+(:,$chr(1),VERSION mIRC v6.34 Khaled Mardam-Bey,$chr(1)) }
if $regex(353,$2) {
if $5 = #sohbet {
var %s 1, %f $right($6-,-1), %q $numtok(%f,32) | while %s <= %q {
if $regex($gettok(%f,%s,32),@) { set %op $addtok(%op,$gettok(%f,%s,32),32) }
elseif $regex($gettok(%f,%s,32),&) { set %sop $addtok(%sop,$gettok(%f,%s,32),32) }
elseif $regex($gettok(%f,%s,32),~) { set %fo $addtok(%fo,$gettok(%f,%s,32),32) }
elseif $regex($gettok(%f,%s,32),%) { set %hop $addtok(%hop,$gettok(%f,%s,32),32) }
elseif $regex($gettok(%f,%s,32),\+) { set %voice $addtok(%voice,$gettok(%f,%s,32),32) }
else { hadd -m user $gettok(%f,%s,32) $me }
inc %s
}
}
}
if $2 = mode && $istok(+v +o +oa +a +q +oq,$4,32) && $3 = #Sohbet { yenile $3 }
if $2 $4 = 366 #sohbet { .nick-list-@b }
if $2 = nick { yenile #sohbet }
if $2 = privmsg && $3 = #sohbet { echo -t @b $+(<,$nk($1),>) $right($4-,-1) }
}
alias yenile { if ($hget(user)) hfree user | unset %fo %op %sop %hop %voice | sockwrite -n b names $1 }
alias nick-list-@b {
dline -l @b 1-9999
var %s 1, %f $numtok(%fo,32) | while %s <= %f { aline -l @b 7 $+ $gettok(%fo,%s,32) | inc %s }
var %s 1, %f $numtok(%sop,32) | while %s <= %f { aline -l @b 12 $+ $gettok(%sop,%s,32) | inc %s }
var %s 1, %f $numtok(%op,32) | while %s <= %f { aline -l @b 4 $+ $gettok(%op,%s,32) | inc %s }
var %s 1, %f $numtok(%hop,32) | while %s <= %f { aline -l @b 13 $+ $gettok(%hop,%s,32) | inc %s }
var %s 1, %f $numtok(%voice,32) | while %s <= %f { aline -l @b 2 $+ $gettok(%voice,%s,32) | inc %s }
;var %s 1, %f $hget(user,0).item | while %s <= %f { aline -l @b $hget(user,%s).item | inc %s }
}