Okay, so here is what you were asking for I guess. You can increase the strength of this by using methods that Euphy mentioned in addition to the showdigit time method. But for now this is in itself pretty strong D: ( i guess lol).
Okay, so the way this script works is the following:
1. It shows a time at the top of the screen for 5 seconds. (Same format as used when your #1 in PvP).
2. It generates 3 random strings of text each different in length depending on what you specify.
3. The FIRST and LAST string of text is highlighted red, and are what the player needs to type in.
4. It is case sensitive.
5. Format inputted is: string1+string2+numbers.
ex: asdf234asdfqwer5678qwer012345678
6. The player has a limited amount of time to input the password. (This can be specified in the script).
7. After the player logs in there is a random amount of time until the player is given the test. ( between 1min -> 15min by default ).
8. Lastly the length of the text is random from 10->48 (by default. can be changed).
ex: Ae16455934 OR ex: 1234AsDf5678qwERgh34awTGTJhiiL9ku8765Fta14593402
So, yeah it's up to you on what you wanna change it to.
First off, change this to a number higher than those your players are. This prevents them from using commands to bypass the bot check.
// Only group with level more than or equal this value can use atcommand while talking with NPC.
atcommand_enable_npc: 0
Then simply install this script and make the changes as needed.
- script bot_test -1,{
OnInit:
set .mim,1; //Minimum Wait time before starting bot test.
set .mxm,15; //Maximum Wait time before starting bot test.
set .often,60; //How often a bot test is given in minutes.
set .timetest,30; //Seconds for players to input test before they auto-fail.
set .minstr,1; //DO NOT CHANGE
//Max Length each section of the string will be.
set .maxstr,20; // ( .maxstr * 2 ) + 8 = Password Length.
//DO NOT CHANGE THE BELOW//
.day = 86400; .hour = 3600; .min = 60;
setarray .0$[0],"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";
setarray .1$[0],"A","B","C","D","E","F","G","H","ii","J","K","LL","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z";
setarray .2$[0],"0","1","2","3","4","5","6","7","8","9";
setarray .day$[1],"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30";
setarray .hour$[0],"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23";
setarray .min$[0],"00","01","02","03","04","05","06","07","08","09","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";
setarray .second$[0],"00","01","02","03","04","05","06","07","08","09","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";
OnPCLoginEvent:
addtimer (60000 *rand(.@min,.@mxm) ), strnpcinfo(3)"+::OnBotTest"; //Starts timer to trigger bot timer
end;
OnBotTest:
set @pass,0;
addtimer .timetest * 1000, strnpcinfo(3)"+::OnTestCheck";
set .@d,rand(1,30);
set .@h,rand(1,23);
set .@m,rand(60);
set .@s,rand(60);
set .@a,rand(20);
set .@b,rand(20);
set .@c,rand(20);
freeloop(1);
while( .@i <= .@a ){
.@d = rand(3);
if( .@d == 2 ){
set .@str1$,.@str1$ + getd(".@"+ .@d +"$["+ rand(10) +"]");
}
if( .@d == 0 || .@d == 1 ){
set .@str1$,.@str1$ + getd(".@"+ .@d +"$["+ rand(26) +"]");
}
.@i++;
}
while( .@j <= .@a ){
.@e = rand(3);
if( .@e == 2 ){
set .@str2$,.@str2$ + getd(".@"+ .@e +"$["+ rand(10) +"]");
}
if( .@e == 0 || .@e == 1 ){
set .@str2$,.@str2$ + getd(".@"+ .@e +"$["+ rand(26) +"]");
}
.@j++;
}
while( .@l <= .@a ){
.@f = rand(3);
if( .@f == 2 ){
set .@str3$,.@str3$ + getd(".@"+ .@f +"$["+ rand(10) +"]");
}
if( .@f == 0 || .@f == 1 ){
set .@str3$,.@str3$ + getd(".@"+ .@f +"$["+ rand(26) +"]");
}
.@l++;
}
freeloop(0);
showdigit ( (.@day * .@d) + (.@hour * .@h) + (.@min * .@m) + (.@s) );
mes "Input the ^FF0000TEXT^000000 only + the numbers above";
mes "^FF0000"+ .@str1$ +"^0000FF"+ .@str2$ +"^FF0000"+ .@str3$ +"^000000";
//For Debug purposes
//mes ""+ .@day$[.@d]+""+ .@hour$[.@h] +""+ .@min$[.@m] +""+ .@second$[.@s]+"";
input .@password$;
if( .@password$ != ""+ .@str1$ +""+ .@str3$ +""+ .@day$[.@d] +""+ .@hour$[.@h] +""+ .@min$[.@m] +""+ .@second$[.@s] +"" ){
mes "^FF0000 FAILED";
//Punishment
close;
}
addtimer (60000 * .often), strnpcinfo+"::OnBotTest";
set @pass,1;
close;
OnTestCheck:
if( @pass ){end;}
//Punishment
end;
}
Right now, this script does not provide any form of punishment. To punish a person (ban/kick or other wise), simply search for //Punishment and replace with your punishment method.