Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ----------- Settings --------------
- alias -l channel { return #sex } ; The channel that code to work (NO MULTI CHANNELS SUPPORTED)
- alias -l bad_file { return badchans.txt } ; The bad channels location file
- alias -l ban_kick { return 1 } ; 1 = kick him yes, 0 = no kick just ban
- alias -l ban_time { return 300 } ; 0 = permanent, (use seconds only)
- alias -l ban_type { return 2 } ; use /help $mask for ban type
- alias -l random_delay { return $rands(300,900) } ; From 300 seconds up to 900 in random
- ; ----------- Settings --------------
- ON *:JOIN:$($channel): {
- if ($nick == $me) {
- var %t = $nick($chan,0,r)
- var %i = 1
- while (%i <= %t) {
- var %n = $nick($chan,%i,r)
- if (%n) && (%n !== $me) { .timer[BCS_ $+ %n $+ _AUTOCHECK] 0 $random_delay recheck_badchan %n }
- inc %i
- }
- return
- }
- if ($me !isop $chan) { return }
- recheck_badchan $nick
- }
- ON *:PART:$($channel): {
- if ($nick == $me) { .timer[BCS_*_AUTOCHECK] off }
- else { .timer[BCS_ $+ $nick $+ _AUTOCHECK] off }
- }
- ON *:KICK:$($channel): {
- if ($knick == $me) { .timer[BCS_*_AUTOCHECK] off }
- else { .timer[BCS_ $+ $nick $+ _AUTOCHECK] off }
- }
- RAW *:*: {
- if (!$hget(BCS,0).item) || ($status !== connected) { return }
- haltdef
- var %h = $hget(BCS,$2)
- if ($numeric == 318) && (%h) { hdel BCS $2 }
- if ($numeric == 319) && (%h) {
- var %r = $check_badchans($3-)
- var %t = $comchan($2,0)
- if (!%r) || (!%t) { return }
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($2,%i)
- if ($me ison %c) && ($me isop %c) && ($2 ison %c) {
- inc %knum 1
- var %f = -
- if ($ban_kick) { var %f = %f $+ k }
- if ($ban_time) { var %f = %f $+ u $+ $ban_time }
- ban %f %c $2 $ban_type 4[Banned] (reason: You have been found in ( $+ $numtok(%r,32) $+ ) blacklisted channels ( $+ %r $+ ) -- for more infomation reagarding your ban please contact Kendy for removal -52- [Kick id: $chr(35) $+ %knum $+ ] (Expires in: $duration($ban_time) $+ )
- }
- inc %i
- }
- }
- }
- alias recheck_badchan {
- ; /recheck_badchan <nickname>
- if (!$1) || ($status !== connected) { return }
- hadd -mu10 BCS $1 1
- whois $1
- }
- alias -l check_badchans {
- ; $check_badchans(#channel1 #channel2 ...)
- if (!$1) || (!$file($bad_file)) { return }
- var %chans = $fix_badchans($1-)
- var %win = $+(@BCS_,$crc($1-,0))
- if ($window(%win)) { window -c $v1 }
- window -hj10000000000000 %win
- loadbuf %win $qt($bad_file)
- var %t = $line(%win,0)
- var %i = 1
- while (%i <= %t) {
- var %r = $line(%win,%i)
- if (!%r) { goto next }
- if ($istok(%chans,%r,32)) { var %tot = $addtok(%tot,%r,32) | goto next }
- var %z = 1
- while (%z <= $numtok(%chans,32)) {
- var %n = $gettok(%chans,%z,32)
- if (%n) && (%r iswm %n) { var %tot = $addtok(%tot,%n,32) }
- inc %z
- }
- :next
- inc %i
- }
- window -c %win
- return $iif(%tot,$v1,0)
- }
- alias -l fix_badchans {
- ; $fix_badchans(@#channel1 ~#channel2 ...)
- if (!$1) { return 0 }
- var %t = $numtok($1-,32)
- var %i = 1
- while (%i <= %t) {
- var %o = $gettok($1-,%i,32)
- if (%o) { var %c = $+($chr(35),$right(%o,- $+ $pos(%o,$chr(35),1))) }
- if (%c) { var %tot = $addtok(%tot,%c,32) }
- inc %i
- }
- return $iif(%tot,$v1,0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement