viewing paste cutin + antibot + timer | 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
 
-   script  antibot -1,{
OnPCLoginEvent:
    attachnpctimer;
    initnpctimer;
    set .@rand_picture,rand( .picture_size );
    mes "Antibot";
    mes "Enter the code from the picture";
    cutin ""+.picture$[.@rand_picture],4;
    do{
        set .@attempt,.@attempt + 1;
        dispbottom "Attempt : "+.@attempt;
        input( .@code_enter$ );
        set .@result,( .@code_enter$ != .code$[.@rand_picture] );
        if( .@result && .@attempt >= .max_attempt ){
OnTimer60000:
            atcommand "@kick "+strcharinfo(0);
            end;
        }
    }while( .@result );
    stopnpctimer;
    detachnpctimer;
    mes "Done";
    cutin "",255;
    close;
    
OnInit:
    // picture name
    setarray .picture$,
        "cutin001",
        "cutin002",
        "cutin003";
        
    // code inside the picture
    setarray .code$,
        "abcdef001",
        "abcdef002",
        "abcdef003";
        
    // max wrong attempt
    set .max_attempt,5;
 
    set .picture_size,getarraysize( .picture$ );
    end;    
}
Viewed 1290 times, submitted by Emistry.