
ctcp *:dcc:?:{
  if ($readini($fp,botnetdcc,enabled)) && ($flood(dcc.all,$readini($fp,botnetdcc,seconds),$readini($fp,botnetdcc,lines))) { 
    .ignore $+(-dnu,$readini($fp,botnetdcc,ignoretime)) *!*@* 
    if ($readini($fp,botnetdcc,inform)) echo -as %info dcc flood, ignoro tutti per $readini($fp,botnetdcc,ignoretime) secondi
  }
  if ($readini($fp,dcc,enabled)) && ($flood($+(dcc.,$wildsite),$readini($fp,dcc,seconds),$readini($fp,dcc,lines))) {  
    .ignore $+(-,$readini($fp,dcc,ignore),u,$readini($fp,dcc,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))
    if ($readini($fp,dcc,inform)) echo -as %info dcc flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,dcc,ignoretime) secondi
    if ($readini($fp,dcc,informlamer))  .notice $nick sei in ignore per $duration($readini($fp,dcc,ignoretime)) perchè no me gusta el flood.
  }
}
ctcp *:*:{
  if ($readini($fp,botnetctcp,enabled)) && ($flood(ctcp.all,$readini($fp,botnetctcp,seconds),$readini($fp,botnetctcp,lines))) { 
    .ignore $+(-tu,$readini($fp,botnetctcp,ignoretime)) *!*@* 
    if ($readini($fp,botnetctcp,inform)) echo -as %info ctcp flood, ignoro tutti per $readini($fp,botnetctcp,ignoretime) secondi
  }
  if ($readini($fp,ctcp,enabled)) && ($flood($+(ctcp.,$wildsite),$readini($fp,ctcp,seconds),$readini($fp,ctcp,lines))) {  
    .ignore $+(-,$readini($fp,ctcp,ignore),u,$readini($fp,ctcp,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))
    if ($readini($fp,ctcp,inform)) echo -as 3* %info ctcp flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,ctcp,ignoretime) secondi
    if ($readini($fp,ctcp,informlamer))  .notice $nick Sei in ignore per $duration($readini($fp,ctcp,ignoretime)) perchè no me gusta el flood.
  }
}
on *:text:*:?:{
  if ($readini($fp,botnetquery,enabled)) && ($flood(query.all,$readini($fp,botnetquery,seconds),$readini($fp,botnetquery,lines))) { 
    .ignore $+(-pu,$readini($fp,botnetquery,ignoretime)) *!*@* 
    if ($readini($fp,botnetquery,closequery)) .close -m
    if ($readini($fp,botnetquery,inform)) echo -as %info query flood, ignoro tutti per $readini($fp,botnetquery,ignoretime) secondi
  }
  if ($readini($fp,query,enabled)) && ($flood($+(query.,$wildsite),$readini($fp,query,seconds),$readini($fp,query,lines))) {  
    .ignore $+(-,$readini($fp,query,ignore),u,$readini($fp,query,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))
    if ($readini($fp,query,closequery)) .close -m $nick    
    if ($readini($fp,query,inform)) echo -as %info query flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,query,ignoretime) secondi
    if ($readini($fp,query,informlamer)) .notice $nick Sei in ignore per $duration($readini($fp,query,ignoretime)) perchè no me gusta el flood.
  }
}
on *:action:*:?:{
  if ($readini($fp,botnetquery,enabled)) && ($flood(query.all,$readini($fp,botnetquery,seconds),$readini($fp,botnetquery,lines))) { 
    .ignore $+(-pu,$readini($fp,botnetquery,ignoretime)) *!*@* 
    if ($readini($fp,botnetquery,closequery)) .close -m
    if ($readini($fp,botnetquery,inform)) echo -as %info query flood, ignoro tutti per $readini($fp,botnetquery,ignoretime) secondi
  }
  if ($readini($fp,query,enabled)) && ($flood($+(query.,$wildsite),$readini($fp,query,seconds),$readini($fp,query,lines))) {  
    .ignore $+(-,$readini($fp,query,ignore),u,$readini($fp,query,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))
    if ($readini($fp,query,closequery)) .close -m $nick    
    if ($readini($fp,query,inform)) echo -as %info query flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,query,ignoretime) secondi
    if ($readini($fp,query,informlamer))  .notice $nick Sei in ignore per $duration($readini($fp,query,ignoretime)) perchè no me gusta el flood.
  }
}
on *:text:*:#:{
  if ($readini($fp,botnettext,enabled)) && ($flood(text.all,$readini($fp,botnettext,seconds),$readini($fp,botnettext,lines))) { 
    .ignore $+(-cu,$readini($fp,botnettext,ignoretime)) *!*@* 
    if ($readini($fp,botnettext,inform)) echo -as %info text flood, ignoro tutti per $readini($fp,botnettext,ignoretime) secondi
  }
  if ($readini($fp,text,enabled)) && ($flood($+(text.,$chan,$wildsite),$readini($fp,text,seconds),$readini($fp,text,lines))) {  
    .ignore $+(-,$readini($fp,text,ignore),u,$readini($fp,text,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))  
    if ($readini($fp,text,inform)) echo -as %info text flood, ignoro8 nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,text,ignoretime) secondi
    if ($readini($fp,text,informlamer))  .notice $nick Sei in ignore per $duration($readini($fp,text,ignoretime)) perchè no me gusta el flood.
  }
}
on *:action:*:#:{
  if ($readini($fp,botnettext,enabled)) && ($flood(text.all,$readini($fp,botnettext,seconds),$readini($fp,botnettext,lines))) { 
    .ignore $+(-cu,$readini($fp,botnettext,ignoretime)) *!*@* 
    if ($readini($fp,botnettext,inform)) echo -as %info text flood, ignoro tutti per $readini($fp,botnettext,ignoretime) secondi
  }
  if ($readini($fp,text,enabled)) && ($flood($+(text.,$chan,$wildsite),$readini($fp,text,seconds),$readini($fp,text,lines))) {  
    .ignore $+(-,$readini($fp,text,ignore),u,$readini($fp,text,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))  
    if ($readini($fp,text,inform)) echo -as 3* %info text flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,text,ignoretime) secondi
    if ($readini($fp,text,informlamer)) .notice $nick Sei in ignore per $duration($readini($fp,text,ignoretime)) perchè ne me gusta el flood.
  }
}
on *:notice:*:*:{
  if (*serv !iswm $nick) {
    if ($readini($fp,botnetnotice,enabled)) && ($flood(notice.all,$readini($fp,botnetnotice,seconds),$readini($fp,botnetnotice,lines))) { 
      .ignore $+(-nu,$readini($fp,botnetnotice,ignoretime)) *!*@* 
      if ($readini($fp,botnetnotice,inform)) echo -as %info notice flood, ignoro tutti per $readini($fp,botnetnotice,ignoretime) secondi
    }
    if ($readini($fp,notice,enabled)) && ($flood($+(notice.,$wildsite),$readini($fp,notice,seconds),$readini($fp,notice,lines))) {  
      .ignore $+(-,$readini($fp,notice,ignore),u,$readini($fp,notice,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))  
      if ($readini($fp,notice,inform)) echo -as %info notice flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,notice,ignoretime) secondi
      if ($readini($fp,notice,informlamer)) .notice $nick Sei in ignore per $duration($readini($fp,notice,ignoretime)) perchè no me gusta el flood.
    }
  }
}
on *:chat:*:{
  if ($readini($fp,chat,enabled)) && ($flood($+(chat.,$wildsite),$readini($fp,chat,seconds),$readini($fp,chat,lines))) {  
    .ignore $+(-,$readini($fp,chat,ignore),u,$readini($fp,chat,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))  
    if ($readini($fp,chat,closechat)) .close -c $nick
    if ($readini($fp,chat,inform)) echo -as %info dcc chat flood, ignoro $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,chat,ignoretime) secondi
    if ($readini($fp,chat,informlamer))  .notice $nick sei stato ignorato per $duration($readini($fp,chat,ignoretime)) no me gusta el flood.
  }
}
on *:invite:*:{
  if ($readini($fp,botnetinvite,enabled)) && ($flood(invite.all,$readini($fp,botnetinvite,seconds),$readini($fp,botnetinvite,lines))) { 
    .ignore $+(-iu,$readini($fp,botnetinvite,ignoretime)) *!*@* 
    if ($readini($fp,botnetinvite,inform)) echo -as %info invite flood, ignora tutti per $readini($fp,botnetinvite,ignoretime) secondi
  }
  if ($readini($fp,invite,enabled)) && ($flood($+(invite.,$wildsite),$readini($fp,invite,seconds),$readini($fp,invite,lines))) {  
    .ignore $+(-,$readini($fp,invite,ignore),u,$readini($fp,invite,ignoretime)) $mask($fulladdress,$readini($fp,address,mask))  
    if ($readini($fp,invite,inform)) echo -as %info invite flood, ignoro8 $nick $chr(40) $+ $mask($fulladdress,$readini($fp,address,mask)) $+ $chr(41) per $readini($fp,invite,ignoretime) secondi
    if ($readini($fp,invite,informlamer)) .notice $nick Sei stato ignorato perchè $duration($readini($fp,invite,ignoretime)) no me gusta el flood.
  }
}
; $flood(description,seconds,limit) 
alias flood {
  hadd $+(-mu,$2) $1 $ticks
  var %i = $hget($1,0).item
  var %f
  while (%i) {
    inc %f $hget($1,$hget($1,%i).item)
    dec %i
  }
  if (%f >= $3) { 
    hfree $1
    return $true
  }
}
alias -l fp return $+(",$scriptdirprotection.ini,")
