Jump to content
  • 0

R>NPC that generates random text


noobsai

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  70
  • Reputation:   0
  • Joined:  02/05/12
  • Last Seen:  

Hi can you help me with my gold room warper.

 

I want to have an NPC which asks for a random character to prevent bot. after successfully entering the random text he will now warp the player ex. @warp jupe_ele

 

Thanks.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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.

Edited by GmOcean
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Bots can still read and type your random text, and pass your check...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Try to be creative. You won't be able to stop good botters with methods like this, but with a little variation, you can stop the inexperienced ones. A handful of ideas that come to mind:

  • Generate easy questions to ask (don't rely on a static list!).
  • Feed the random number/string through other windows...
    • using 'npctalk'
    • using 'message'
    • using mail (requires relog using SQL/without a source mod)
    • using @fakename
  • Any combination of the above.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

I've seen an anti-bot feature which randomize a random skill & level at login, so that your cursor become the randomed skill level number (1 to 10) and you have to type in. Does OpenKore able to read the client's cursor skill level?

Edited by darristan
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  70
  • Reputation:   0
  • Joined:  02/05/12
  • Last Seen:  

 

Try to be creative. You won't be able to stop good botters with methods like this, but with a little variation, you can stop the inexperienced ones. A handful of ideas that come to mind:

  • Generate easy questions to ask (don't rely on a static list!).
  • Feed the random number/string through other windows...
    • using 'npctalk'
    • using 'message'
    • using mail (requires relog using SQL/without a source mod)
    • using @fakename
  • Any combination of the above.

 

thanks for the tips.

 

but I have seen a NPC that generates the random text but with different color.

for example: "asdfqwertzxcv"

the strings "asdf" have color blue then "qwert" is red and "zxcv" is blue again then the npc will say to input only the red text.

 

is it still not safe?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

I imagine that it would be easier, not harder, for bots to pick up colored text...

 

Does OpenKore able to read the client's cursor skill level?

Possibly, but that seems like another good method to include nonetheless.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Yea, colored text does make it easier IMO to read, but, that is why I added showdigit as it only pops up for 5seconds. Most butters from what I can tell periodically monitor their bots. And this way, even they might miss it. Not sure if a bot can detect showdigit either.

Edited by GmOcean
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...