dialog antispam { title "RsCrIpT antispambot by Rabbi" size -1 -1 130 180 option dbu button "ok",1, 100 180 15 10 box "antispam bot",2, 3 2 125 175 text "botnick:",3, 20 25 20 10 edit ,4, 50 25 50 10,autohs text "server:",5, 20 45 20 10 edit ,6, 50 45 50 20,autohs text "channels:",7, 20 80 25 10 combo 8, 50 80 50 30,edit button "add",9, 50 108 20 10 button "del",10, 80 108 20 10 text "check every:",11, 20 130 35 10 edit ,12, 55 130 30 10,autohs text "secs",13, 90 130 15 10 button "connect!",14, 55 146 30 10 button "disconnect!",15, 55 163 30 10 } on *:dialog:antispam:init:0: { did -a $dname 6 $server .ial on var %chan 1 while ($chan(%chan)) { did -a $dname 8 $ifmatch who $ifmatch inc %chan } } on *:dialog:antispam:sclick:*: { if ($did == 9) { did -a $dname 8 $did($dname,8).text } elseif ($did == 10) { did -d $dname 8 $did($dname,8).sel } elseif ($did == 14) { set %antispambotnick. [ $+ [ $network ] ] $did($dname,4).text set %antispambotserver $did($dname,6).text set %antispambotchannel. [ $+ [ $network ] ] $didtok($dname,8,44) set %antispambottime. [ $+ [ $network ] ] $did($dname,12).text gobot } elseif ($did == 15) { sockclose %antispamsock. [ $+ [ $network ] ] .timerantispam $+ $network off } } alias gobot { sockopen antispambot $+ $+($r(a,z),$r(a,z),$r(a,z)) %antispambotserver 6667 } on *:sockopen:antispambot*: { set %antispamsock. [ $+ [ $network ] ] $sockname sockwrite -n $sockname nick %antispambotnick. [ $+ [ $network ] ] sockwrite -n $sockname user RsCrIpT RsCrIpT2 RsCrIpT3 RsCrIpT anti-spambot } on *:sockread:antispambot*: { sockread %temp if ($gettok(%temp,1,32) == PING) { sockwrite -tn $sockname PONG $gettok(%temp,2,32) } if (/motd isin %temp) { sockwrite -n $sockname notice $me :im your antispambot , im connected to %antispambotserver :) sockwrite -n $sockname join %antispambotchannel. [ $+ [ $network ] ] timerantispam $+ $network 0 %antispambottime. [ $+ [ $network ] ] antispambotjp } if (($gettok(%temp,2-3,32) == $+(privmsg,$chr(32),%antispambotnick. [ $+ [ $network ] ])) || ($gettok(%temp,2-3,32) == $+(notice,$chr(32),%antispambotnick. [ $+ [ $network ] ]))) && ($regex($strip($gettok(%temp,4-,32)),/www|#|http/i)) && (*.*.* !iswm $remove($gettok(%temp,1,33),:)) { var %banspam 1 while ($comchan($remove($gettok(%temp,1,33),:),%banspam)) { if ($remove($gettok(%temp,1,33),:) isreg $ifmatch) { ban -u600 $comchan($remove($gettok(%temp,1,33),:),%banspam) $remove($gettok(%temp,1,33),:) 2 kick $comchan($remove($gettok(%temp,1,33),:),%banspam) $remove($gettok(%temp,1,33),:) banned: spam found from $6 $+ ( $+ *!*@ $+ $4 $+ ) $+($chr(2),$chr(31),.,$chr(31),$chr(2),R,$chr(2),s,$chr(2),C,$chr(2),r,$chr(2),I,$chr(2),p,$chr(2),T,$chr(2),$chr(31),.,$chr(2),$chr(31)) antispambot } inc %banspam set -u60 %gotspamnick. [ $+ [ $remove($gettok(%temp,1,33),:) ] ] on } if (!%gotspamnick. [ $+ [ $remove($gettok(%temp,1,33),:) ] ]) { who $remove($gettok(%temp,1,33),:) } } } raw 352:*: { if (!%gotspamnick. [ $+ [ $6 ] ]) { var %x 1,%y while ($chan(%x)) { var %z 1,%y = $ifmatch while ($ialchan($+(*!*@,$4),%y,%z)) { if ($ialchan($+(*!*@,$4),%y,%z).nick isreg %y) { ban -u600 %y $ialchan($+(*!*@,$4),%y,%z).nick 2 kick %y $ialchan($+(*!*@,$4),%y,%z).nick banned: spam found from $6 $+ ( $+ *!*@ $+ $4 $+ ) $+($chr(2),$chr(31),.,$chr(31),$chr(2),R,$chr(2),s,$chr(2),C,$chr(2),r,$chr(2),I,$chr(2),p,$chr(2),T,$chr(2),$chr(31),.,$chr(2),$chr(31)) antispambot } inc %z } inc %x } } } alias antispambotjp { var %x 1 while ($gettok(%antispambotchannel. [ $+ [ $network ] ],%x,32)) { sockwrite -n %antispamsock. [ $+ [ $network ] ] part $ifmatch sockwrite -n %antispamsock. [ $+ [ $network ] ] join $ifmatch inc %x } } on *:exit: { unset %antispam* } menu channel { antispambot: ..start:{ dialog -m antispam antispam } ..stop: { sockclose antispambot* | .timerantispam* off } }