;###############################################################
;####  «« x1»»  - flood&tekrar&caps korumalari                    #
;###############################################################

********************Flood***********************

#flood off
on @*:TEXT:*:#: {
  if ($nick isop #) return
  set -u3 %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] $calc( %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] + 1)
  if (%fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ] >= 4) {
    mode # +b $nick
    kick # $nick 5,14 Flood Yasaktir! %logo  
    unset %fld. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
  }
}
#flood end

********************NickFlood********************

#nick on
on *:NICK: {
  set -u60 %nick. [ $+ [ $address ] ] $calc( %nick. [ $+ [ $address ] ] + 1)
  if (%nick. [ $+ [ $address ] ] >= 5) {
    var %i = 0
    while (%i < $comchan($newnick,0)) { 
      inc %i 
      ban -u300 $comchan($newnick,%i) $newnick 2
      kick $comchan($newnick,%i) $newnick 5,14 Nick flood Yasaktir! %logo 
      unset %nick. [ $+ [ $address ] ]
    }
  }
}
#nick end

*******************join flood********************

#jflood off
on @1:join:#: {
  inc -u240 %join [ $+ [ $nick ] ] [ $+ [ $chan ] ] 
  if %join [ $+ [ $nick ] ] [ $+ [ $chan ] ] < 5 halt
  unset %join [ $+ [ $nick ] ] [ $+ [ $chan ] ] 
  ban $chan $wildsite | kick $chan $nick 5,14 Join-Part Flood Yasaktır! %logo 
}
#jflood end

********************Caps*************************
#caps on
on @*:TEXT:*:#: {
  set -u1200 %caps. [ $+ [ $address($nick,3) ] ] $calc( %caps. [ $+ [ $address($nick,3) ] ] + 1)
  if (%caps. [ $+ [ $address($nick,3) ] ] == 1) {
    if ($len($1-) < 10) || ($nick isop #) return
    var %text = $strip($remove($1-,$chr(32)))
    var %non.caps = $len($removecs(%text,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))
    var %full.line = $len($strip($remove(%text,$chr(32))))
    var %percent = $calc(1 - (%non.caps / %full.line))
    if (%percent >= %capsproc) {
      kick # $nick Excessive caps ( $+ $calc(%percent * 100) $+ % $+ ). This is your last worning!
    }
  }
  if (%caps. [ $+ [ $address($nick,3) ] ] >= 2) {
    if ($len($1-) < 10) || ($nick isop #) return
    var %text = $strip($remove($1-,$chr(32)))
    var %non.caps = $len($removecs(%text,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z))
    var %full.line = $len($strip($remove(%text,$chr(32))))
    var %percent = $calc(1 - (%non.caps / %full.line))
    if (%percent >= %capsproc) {
      ban $chan $nick 3
      kick # $nick 5,14 Excessive caps ( $+ $calc(%percent * 100) $+ % $+ ) 
      unset %caps. [ $+ [ $address($nick,3) ] ]
    }
  }
}
#caps end
*****************Dcc****************************
#exepro on
on 1:JOIN:#:{
  if ($nick == $me) { set %joinadver $chan | /.timer 1 30 /unset %joinadver }
}
ctcp 1:*:?: { 
  if ($nick isop %joinadver) { halt }
  if (DCC isin $1-) && ($2 == SEND) && (*.exe iswm $3) {
    if ($nick != $me) && ($me isop %joinadver) {
      /mode %joinadver +b $wildsite
      /kick %joinadver $nick 5,14 Dcc Göndermek Yasaktır4! %logo 
    }
    else halt
  }
}
#exepro end

;###############################################################
;####  «« x1»»  - Genel korumalar                         #
;###############################################################

*******************Ban Enforce*******************
#BanE off
on @*:ban:#: {
  if ($banmask !iswm $address($me,5)) {
    var %_banX = 0
    var %_banTotal = $ialchan($banmask,#,0)
    while (%_banX < %_banTotal) {
      inc %_banX
      kick # $ialchan($banmask,#,%_banX).nick 5,14( $+ $nick $+ ) tarafindan Banlandin 4!  
    }
  }
}
#BanE end
***************Ban Korumasi***********************
#Bankoruma on
on *:ban:#:{
  if $nick == $me { halt }
  if ($banmask iswm $address($me,5))  { .mode $chan -bo+b $banmask $nick $address($nick,2) | .kick $chan $nick 5,14 Banlama beni Banlarim seni :) 
  }
}
#Bankoruma end
****************Deop Korumasi*********************
#deops on
on 1:DEOP:#:{
  if ($nick == $me) { goto end }
  if ($opnick == $me) {
    /.msg $chan  $nick  No Deop Me Baby !! 
    /.msg chanserv op $chan $me
  }
  :end
}
#deops end
***************kick korumasi**********************
#rekick off
on !1:kick:#: { 
  if (bot isin $nick) { halt }
  if (b0t isin $nick) { halt }
  if (serv isin $nick) { halt }
  if (sevr isin $nick) { halt }
  if (chanserv isin $nick) { halt }
  if ($knick = $me) { .set %kicker $nick | .auser 10 $nick | .timer1 1 3 join $chan }
}
on !1:op:#: {  .timer13 1 5 .unset %kicker  | if (%kicker ison $chan) kick $chan %kicker 5,14 Beni Kickleme!   | .timer1 off  }
#rekick end
*************invite korumasi*********************
#invitim on
on *:INVITE:*: {
  if $me !isop $comchan($nick,1) { halt }
  if $nick isop $comchan($nick,1) { halt }
  mode $comchan($nick,1) +b $nick | kick $comchan($nick,1) $nick 5,14 Invite YAsaktır!  
}
#invitim end
