- script bot_checking_color -1,{
OnInit:
setarray .code_range,
10000,
999999;
setarray .color$,
"^00FF00",
"^FF0000",
"^0000FF",
"^0FF0FF",
"^CCCCCC",
"^CBCBCB";
set .color_size,getarraysize( .color$ );
end;
OnPCLoginEvent:
set .@right_color,rand( .color_size );
set .@random_code$,""+rand( .code_range[0],.code_range[1] );
mes "Enter color "+.color$[.@right_color]+"########^000000";
for ( set .@i,0; .@i < .color_size; set .@i,.@i + 1 )
mes .color$[.@i]+ ( ( .@i == .@right_color )? .@random_code$:rand( .code_range[0],.code_range[1] ) ) + "^000000";
do {
.@attempt++;
input .@code$;
} while( .@code$ != .@random_code$ && .@attempt <= 3 );
if ( .@code$ == .@random_code$ && .@attempt <= 3 ) {
mes "Correct.";
}
else {
atcommand "@kick "+strcharinfo(0);
}
close;
}