channel protections - 04/10/07 03:43 PM
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 } } } }