viewing paste timer + code verify antibot | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
 
 
-       script  antibot -1,{
function GetString;
 
OnInit:
// mode
// 1 - numbers
// 2 - uppercase letter
// 4 - lowercase letter
// 8 - symbols
set .mode,1|2|4|8;
 
// 8 ~ 20 characters
setarray .string_size,8,20;
 
// max wrong attempt
set .max_attempt,5;
 
OnPCLoginEvent:
        attachnpctimer;
        initnpctimer;
        set .@string$,GetString( .mode,rand( .string_size[0],.string_size[1] ) );
        mes "Antibot";
        mes "Enter the code below:";
        mes "^FF0000"+.@string$+"^000000";
        do{
                set .@attempt,.@attempt + 1;
                dispbottom "Attempt : "+.@attempt;
                input( .@code$ );
                set .@result,( .@code$ == .@string$ );
                if( !.@result && .@attempt >= .max_attempt ){
OnTimer60000:
                        atcommand "@kick "+strcharinfo(0);
                        end;
                }
        }while( .@result );
        stopnpctimer;
        detachnpctimer;
        mes "Done";
        close;
 
function    GetString    {
        set .@arg,getarg(0);
        set .@length,getarg(1);
       
        if( .@arg & 1 ) setarray .@list$[ getarraysize( .@list$ ) ],"1","2","3","4","5","6","7","8","9";
        if( .@arg & 2 ) setarray .@list$[ getarraysize( .@list$ ) ],"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";
        if( .@arg & 4 ) setarray .@list$[ getarraysize( .@list$ ) ],"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";
        if( .@arg & 8 ) setarray .@list$[ getarraysize( .@list$ ) ],"!","@","#","$","%","^","&","*","(",")","-","=","/","+";
         
        set .@size,getarraysize( .@list$ );
        while( getstrlen( .@str$ ) < .@length )
                set .@str$,.@str$ + .@list$[ rand( .@size ) ];
        return .@str$;
}
 
}
Viewed 771 times, submitted by Emistry.