mIRC Home    About    Download    Register    News    Help

Print Thread
channel protections #187386 04/10/07 03:43 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
It is valid? or it is possible to be improved

Code:

on *:TEXT:*:#:{
  if ( $ulevel <= 2 ) { 
    ;;Followed lines ;; 
    hadd -mu3 antiflood. $+ $chan $nick $+ @ $+ $rand(0,99999999) 1 
    if ( $hfind(antiflood. $+ $chan,$nick $+ @*,0,w).item >= 5 ) { msg or command | return  }
    ;fin

    ;;Anti repeat ;;
    inc -u10 %rp. [ $+ [ $hash($nick $chan $strip($1-),32) ] ]
    if ( %rp. [ $+ [ $hash($nick $chan $strip($1-),32) ] ] == 3 ) { msg or command | return  }

    ;;Max 150 characters ;;
    if ( $len($strip($1-)) >= 150 ) { msg or command | return }

    ;;Anti Caps ;; 
    if ( $len($1-) < 9 ) { return }
    if ( $calc(1 - ($len($removecs($strip($remove($1-,$chr(32))),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)) / $len($strip($remove($strip($remove($1-,$chr(32))),$chr(32)))))) >= 0.8 ) {
      inc -u600 %caps. [ $+ [ $hash($nick $chan ,32) ] ]
      if ( %caps. [ $+ [ $hash($nick $chan ,32) ] ] == 1 ) { msg warning | return } 
      if ( %caps. [ $+ [ $hash($nick $chan ,32) ] ] >= 3 ) { msg or command | return } 
    }
  }
}


Re: channel protections [Re: kwell] #187390 04/10/07 05:10 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: kwell
It is valid? or it is possible to be improved

Code:

on *:TEXT:*:#:{
  if ( $ulevel <= 2 ) { 
    ;;Followed lines ;; 
    hadd -mu3 antiflood. $+ $chan $nick $+ @ $+ $rand(0,99999999) 1 
    if ( $hfind(antiflood. $+ $chan,$nick $+ @*,0,w).item >= 5 ) { msg or command | return  }
    ;fin

    ;;Anti repeat ;;
    inc -u10 %rp. [ $+ [ $hash($nick $chan $strip($1-),32) ] ]
    if ( %rp. [ $+ [ $hash($nick $chan $strip($1-),32) ] ] == 3 ) { msg or command | return  }

    ;;Max 150 characters ;;
    if ( $len($strip($1-)) >= 150 ) { msg or command | return }

    ;;Anti Caps ;; 
    if ( $len($1-) < 9 ) { return }
    if ( $calc(1 - ($len($removecs($strip($remove($1-,$chr(32))),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)) / $len($strip($remove($strip($remove($1-,$chr(32))),$chr(32)))))) >= 0.8 ) {
      inc -u600 %caps. [ $+ [ $hash($nick $chan ,32) ] ]
      if ( %caps. [ $+ [ $hash($nick $chan ,32) ] ] == 1 ) { msg warning | return } 
      if ( %caps. [ $+ [ $hash($nick $chan ,32) ] ] >= 3 ) { msg or command | return } 
    }
  }
}



Instead of posting here for validility checks try the code see if it works :P There's not much to improve if anything. Its short formed code already.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }