Kewlx Posted September 10, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 12/02/12 Last Seen: June 24, 2016 Share Posted September 10, 2014 - script AntiBot -1,{ function GetString; OnPCLoginEvent: if (strcharinfo(0)=="[Dev] Jero" || strcharinfo(0)=="[Admin] Jec" || strcharinfo(0)=="[Admin] Jec") { close; } else { atcommand "@option 2 0 3"; sc_start sc_berserk, 1000000000, 1; initnpctimer; attachnpctimer strcharinfo(0); switch( rand(2) ){ Case 0: set .@String$,GetString( 15,rand(5,10) ); mes "[Anti-Botting System]"; mes "Seems like the server suspects that you're a bot."; mes "==================================="; mes "Input the ^FF0000RED COLOUR^000000 part"; mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000"; mes "==================================="; mes "You will have 30 seconds to enter in my special codes otherwise you'll be kicked."; mes "Ready? Go!"; input .@Input$; if( .@Input$ != .@String$ ){ mes "Wrong.."; sc_end sc_berserk; atcommand "@option 0"; atcommand "@load"; stopnpctimer; announce "[Anti-Botting System] : "+strcharinfo(0)+" has failed to answer and got kick from the server!! He is suspected a bot !.",0; atcommand "@kick "+strcharinfo(0); } break; Case 1: set .@String$,GetString( 15,rand(5,10) ); mes "Input the ^FF0000RED COLOUR^000000 part"; mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000"; input .@Input$; if( .@Input$ != .@String$ ){ mes "Wrong.."; sc_end sc_berserk; atcommand "@option 0"; atcommand "@load"; stopnpctimer; announce "[Anti-Botting System] : "+strcharinfo(0)+"has failed to answer !!He is also suspected a bot! He is now kicked.",0; atcommand "@kick "+strcharinfo(0); } break; } sc_end sc_berserk; atcommand "@option 0"; percentheal 0,100; // since berserk use your 100% sp atcommand "@option 0 0 0"; stopnpctimer; close; function GetString { if( getarg(0) & 1 ) setarray .@List$[ getarraysize( .@List$ ) ],"1","2","3","4","5","6","7","8","9"; if( getarg(0) & 2 ) setarray .@List$[ getarraysize( .@List$ ) ],"A","B","C","D","E","F","G","H","J","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"; if( getarg(0) & 4 ) setarray .@List$[ getarraysize( .@List$ ) ],"a","b","c","d","e","f","g","h","i","j","k","M","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; set .@Str$,""; while( getstrlen( .@Str$ ) < getarg(1) ) set .@Str$,.@Str$ + .@List$[ rand( getarraysize( .@List$ ) ) ]; return .@Str$; } OnTimer10000: dispbottom "You failed to answer the question within 30 seconds."; goto L_Fail; L_Fail: mes "[Anti-Botting System]"; mes "You have been detected as a bot and will now be kicked off the server."; next; announce "[Anti-Botting System] : "+strcharinfo(0)+"has failed to answer !!He is also suspected a bot! He is now kicked.",0; atcommand "@kick "+strcharinfo(0); close; } } i got this error when you cant answer within 10 sec Quote Link to comment Share on other sites More sharing options...
Elsa Mist Posted September 10, 2014 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 387 Reputation: 60 Joined: 10/08/13 Last Seen: July 14, 2022 Share Posted September 10, 2014 Hi Zanje, perhaps u can try existing scripts. - script Sample -1,{ function GetString; OnPCLoginEvent: switch( rand(2) ){ Case 0: set .@String$,GetString( 15,rand(5,10) ); mes "Input the ^FF0000RED COLOUR^000000 part"; mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000"; input .@Input$; if( .@Input$ != .@String$ ){ mes "Wrong.."; atcommand "@kick "+strcharinfo(0); } break; Case 1: set .@A,rand(1000); set .@B,rand(1000); mes "If A = "+.@A+" B = "+.@B; switch( rand(4) ){ Case 0: set .@Answer,.@A + .@B; mes "How many is A + B ?"; break; Case 1: set .@Answer,.@A - .@B; mes "How many is A - B ?"; break; Case 2: set .@Answer,.@A * .@B; mes "How many is A * B ?"; break; Case 3: set .@Answer,.@A / .@B; mes "How many is A / B ?"; break; } input .@Input; if( .@Input != .@Answer ){ mes "Wrong"; atcommand "@kick "+strcharinfo(0); } break; } close; function GetString { if( getarg(0) & 1 ) setarray .@List$[ getarraysize( .@List$ ) ],"1","2","3","4","5","6","7","8","9"; if( getarg(0) & 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( getarg(0) & 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( getarg(0) & 8 ) setarray .@List$[ getarraysize( .@List$ ) ],"!","@","#","$","%","^","&","*","(",")","-","=","/","+"; set .@Str$,""; while( getstrlen( .@Str$ ) < getarg(1) ) set .@Str$,.@Str$ + .@List$[ rand( getarraysize( .@List$ ) ) ]; return .@Str$; } } credits to the owner... Quote Link to comment Share on other sites More sharing options...
Kewlx Posted September 10, 2014 Group: Members Topic Count: 20 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 12/02/12 Last Seen: June 24, 2016 Author Share Posted September 10, 2014 Hi Zanje, perhaps u can try existing scripts. - script Sample -1,{ function GetString; OnPCLoginEvent: switch( rand(2) ){ Case 0: set .@String$,GetString( 15,rand(5,10) ); mes "Input the ^FF0000RED COLOUR^000000 part"; mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000"; input .@Input$; if( .@Input$ != .@String$ ){ mes "Wrong.."; atcommand "@kick "+strcharinfo(0); } break; Case 1: set .@A,rand(1000); set .@B,rand(1000); mes "If A = "+.@A+" B = "+.@B; switch( rand(4) ){ Case 0: set .@Answer,.@A + .@B; mes "How many is A + B ?"; break; Case 1: set .@Answer,.@A - .@B; mes "How many is A - B ?"; break; Case 2: set .@Answer,.@A * .@B; mes "How many is A * B ?"; break; Case 3: set .@Answer,.@A / .@B; mes "How many is A / B ?"; break; } input .@Input; if( .@Input != .@Answer ){ mes "Wrong"; atcommand "@kick "+strcharinfo(0); } break; } close; function GetString { if( getarg(0) & 1 ) setarray .@List$[ getarraysize( .@List$ ) ],"1","2","3","4","5","6","7","8","9"; if( getarg(0) & 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( getarg(0) & 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( getarg(0) & 8 ) setarray .@List$[ getarraysize( .@List$ ) ],"!","@","#","$","%","^","&","*","(",")","-","=","/","+"; set .@Str$,""; while( getstrlen( .@Str$ ) < getarg(1) ) set .@Str$,.@Str$ + .@List$[ rand( getarraysize( .@List$ ) ) ]; return .@Str$; } } credits to the owner... the dialog on npc are gone after minute then you can bypass it thats why i want to put timer ...so if they can answer they will kick Quote Link to comment Share on other sites More sharing options...
Question
Kewlx
- script AntiBot -1,{
function GetString;
OnPCLoginEvent:
if (strcharinfo(0)=="[Dev] Jero" || strcharinfo(0)=="[Admin] Jec" || strcharinfo(0)=="[Admin] Jec") {
close;
} else {
atcommand "@option 2 0 3";
sc_start sc_berserk, 1000000000, 1;
initnpctimer;
attachnpctimer strcharinfo(0);
switch( rand(2) ){
Case 0:
set .@String$,GetString( 15,rand(5,10) );
mes "[Anti-Botting System]";
mes "Seems like the server suspects that you're a bot.";
mes "===================================";
mes "Input the ^FF0000RED COLOUR^000000 part";
mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000";
mes "===================================";
mes "You will have 30 seconds to enter in my special codes otherwise you'll be kicked.";
mes "Ready? Go!";
input .@Input$;
if( .@Input$ != .@String$ ){
mes "Wrong..";
sc_end sc_berserk;
atcommand "@option 0";
atcommand "@load";
stopnpctimer;
announce "[Anti-Botting System] : "+strcharinfo(0)+" has failed to answer and got kick from the server!! He is suspected a bot !.",0;
atcommand "@kick "+strcharinfo(0);
}
break;
Case 1:
set .@String$,GetString( 15,rand(5,10) );
mes "Input the ^FF0000RED COLOUR^000000 part";
mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000";
input .@Input$;
if( .@Input$ != .@String$ ){
mes "Wrong..";
sc_end sc_berserk;
atcommand "@option 0";
atcommand "@load";
stopnpctimer;
announce "[Anti-Botting System] : "+strcharinfo(0)+"has failed to answer !!He is also suspected a bot! He is now kicked.",0;
atcommand "@kick "+strcharinfo(0);
}
break;
}
sc_end sc_berserk;
atcommand "@option 0";
percentheal 0,100; // since berserk use your 100% sp
atcommand "@option 0 0 0";
stopnpctimer;
close;
function GetString {
if( getarg(0) & 1 ) setarray .@List$[ getarraysize( .@List$ ) ],"1","2","3","4","5","6","7","8","9";
if( getarg(0) & 2 ) setarray .@List$[ getarraysize( .@List$ ) ],"A","B","C","D","E","F","G","H","J","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z";
if( getarg(0) & 4 ) setarray .@List$[ getarraysize( .@List$ ) ],"a","b","c","d","e","f","g","h","i","j","k","M","m","n","o","p","q","r","s","t","u","v","w","x","y","z";
set .@Str$,"";
while( getstrlen( .@Str$ ) < getarg(1) )
set .@Str$,.@Str$ + .@List$[ rand( getarraysize( .@List$ ) ) ];
return .@Str$;
}
OnTimer10000:
dispbottom "You failed to answer the question within 30 seconds.";
goto L_Fail;
L_Fail:
mes "[Anti-Botting System]";
mes "You have been detected as a bot and will now be kicked off the server.";
next;
announce "[Anti-Botting System] : "+strcharinfo(0)+"has failed to answer !!He is also suspected a bot! He is now kicked.",0;
atcommand "@kick "+strcharinfo(0);
close;
}
}
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.