Join/Part Flood Protection v1.0 - Forum
Friday, 09 Dec 2016, 16:27:31
Welcome on westor (^WeSt) website!
Welcome NOT MEMBER | RSS
[ New messages · Members · Forum rules · Search · RSS ]
Page 1 of 11
Forum moderator: ^WeSt 
Forum » General » mIRC Codes » Join/Part Flood Protection v1.0
Join/Part Flood Protection v1.0
^WeStDate: Friday, 26 Sep 2014, 19:46:04 | Message # 1
ULTRA MEMBER
Group: Administrators
Messages: 13
Awards: 0
Reputation: 0
Status: Offline
This module will ban any user that will join/part or part/join too many times on the channel!

Right click on the channel to enable/disable or to set the seconds of ban.


Code
#join_flood on
ON !*:JOIN:#: {
   if ($me !ison $chan) { return }
   if ($me !isop $chan) { return }
   var %h = joinchan_ $+ $chan
   if ($hget(%h,$address($nick,2)) == 3) { join_kb_all $chan $address($nick,2) | return }
   hinc -em %h $address($nick,2)
   .timer[JOINCHAN_REMOVE_ $+ $address($nick,2) $+ _ $+ $chan $+ ] 1 60 join_chan_ok $address($nick,2) $chan
}

ON *:PART:#: {  
   if ($nick == me) { join_chan_off }
   elseif ($nick !== me) {
     if ($me !ison $chan) { return }
     if ($me !isop $chan) { return }
     var %h = joinchan_ $+ $chan
     if ($hget(%h,$address($nick,2)) == 3) { join_kb_all $chan $address($nick,2) | return }
     hinc -em %h $address($nick,2)
     .timer[JOINCHAN_REMOVE_ $+ $address($nick,2) $+ _ $+ $chan $+ ] 1 60 join_chan_ok $address($nick,2) $chan
   }
}
ON *:DISCONNECT: { join_chan_off }
ON *:CONNECT: { join_chan_off }
#join_flood end

ON *:UNLOAD { unset %joinchan_flood_ban_secs | .disable #join_flood | var %ok = $input(The Join/Part Flood Protection module has been unloaded successfully. $crlf $crlf $+ $+ by westor,oidbk30,by westor) }
ON *:LOAD: { .enable #join_flood | var %ok = $input(The Join/Part Flood Protection module has been loaded successfully. $crlf $crlf $+ $+ by westor,oidbk30,by westor) }
alias join_chan_off { hfree -w joinchan_* | .timer[JOINCHAN_*] off }
alias join_chan_ok {  
   var %h = joinchan_ $+ $2
   if ($hget(%h,$1)) { hdel %h $1 }
}

alias join_kb_all {
   if (!$1) { return }
   if (%joinchan_flood_ban_secs) { var %s = %joinchan_flood_ban_secs }
   elseif (!%joinchan_flood_ban_secs) { var %s = $rand(300,600) }
   var %h = joinchan_ $+ $1
   if ($hget(%h,$2)) { hdel %h $2 }
   .timer[JOINCHAN_REMOVE_ $+ $2 $+ _ $+ $1 $+ ] off
   cs ban $1 + $+ %s $2 [BANNED]: Too many joins/parts detected from your host/ip, please try to join again later. - (Ban Time:  $+ $duration(%s) $+  $+ ) - $chr(32)
}

menu channel {
   -
   Join/Part Flood Protection by westor ( $+ $upper($group(#join_flood)) $+ )
   .$iif($group(#join_flood) == off,Enable the protection): {  
     .enable #join_flood
     var %ok = $input(The Join/Part Flood Protection has been enabled.,oidbk60,by westor)
   }
   .$iif($group(#join_flood) == on,Disable the protection): {  
     .disable #join_flood
     join_chan_off
     var %ok = $input(The Join/Part Flood Protection has been disabled.,oidbk60,by westor)
   }
   .-
   .Set ban seconds: {
     var %s = $input(Enter here the second(s) that you want to ban the user from the channel,eidbk30,by westor)
     if (!%s) { return }
     if (%s) && (%s !isnum) { var %error = $input(The seconds must be only numbers!,hodbk30,by westor) | return }
     set %joinchan_flood_ban_secs %s
     var %ok = $input(The join/flood protection ban seconds has been changed!,oidbk30,by westor)
   }
   -
}




I Would Like To Kiss You But I Cant Tell Me Why Not My Baby ? ? ?
 
Forum » General » mIRC Codes » Join/Part Flood Protection v1.0
Page 1 of 11
Search:


Website builderuCoz