Jump to content

Question

Posted

hello is there any possibility that instead of chance it will trigger every 30 mins?

 

Quote

//===== Thaddeus Scripts ================================== 
//= Simple Cool Anti-Bot
//===== By: ================================================== 
//= Thaddeus
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= Hercules, rAthena, 3ceam, eAthena
//===== Description: =========================================
// Improvise Simple Anti-Bot! from method of Brian.
//===== Comments: ============================================
//= Change the % chance of triggering, change jail time.
//===== Additional Comments: =================================
//= 1.00 Initial Release
//===== Contact Info: =========================================
//= http://hercules.ws/board/user/457-thaddeus/
//============================================================
//===== Credits to: =========================================
//= Brian,
//============================================================


-    script    anti-bot2    -1,{
OnPCLoginEvent:
set checkbot,0;
if(botter >= 1) {
doevent "anti-bot::Oncheckb"; }

}
-    script    anti-bot    -1,{
OnNPCKillEvent:
if( rand(100) < 75 ) {goto end;} // Default Setting: 75% Chance to Ignore the Anti-Bot
Oncheckb:
function GetString;
//if (getgmlevel() >= 3) { goto end;} /* Uncomment if you want to Ignore this by GM */
if(checkbot >= 1) { goto end; }

atcommand "@jail "+strcharinfo(0)+"";
set botter,1;
sleep2 3000;
On2nd:
set .@String$,GetString( 15,rand(3,7) );
mes "You Have 3 Chance to Type the Red Text Correctly";
mes "If you failed- You will be jailed";
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$ ){
    if (botter >= 3) 
    {
    atcommand "@unjail "+strcharinfo(0)+"";
    sleep2 1000;
    atcommand "@jailfor 10d "+strcharinfo(0)+"";
    announce "[Anti-BOT]: The user [" +strcharinfo(0) +"] Has Been Jailed For 10 Days.",0,0xe80f0f;

    set botter,0;
    close;
    end;}
    
    mes "Wrong..";
    set botter,botter + 1;
    next;
    goto On2nd;
}
atcommand "@unjail "+strcharinfo(0)+"";
set botter,0;
set checkbot,1;
sc_end SC_BERSERK;
sc_end SC_FREEZE;
sc_start SC_INCREASEAGI,240000,10; heal -15,0;
sc_start SC_BLESSING,240000,10;  
end;

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","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","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$;

}

}

sec_pri    mapflag    pvp    off

 

2 answers to this question

Recommended Posts

  • 0
Posted
//===== Thaddeus Scripts ================================== 
//= Simple Cool Anti-Bot
//===== By: ================================================== 
//= Thaddeus
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= Hercules, rAthena, 3ceam, eAthena
//===== Description: =========================================
// Improvise Simple Anti-Bot! from method of Brian.
//===== Comments: ============================================
//= Change the % chance of triggering, change jail time.
//===== Additional Comments: =================================
//= 1.00 Initial Release
//===== Contact Info: =========================================
//= http://hercules.ws/board/user/457-thaddeus/
//============================================================
//===== Credits to: =========================================
//= Brian,
//============================================================


-	script	ANTIBOT	-1,{
	function create_code_segment;

	OnInit:
		.code_segment_length = 4;
		.code_segment_count = 3;
		.jail_duration_days = 10;
		.max_error_treshold = 3;

		initnpctimer;
	end;

	OnPCLoginEvent:
		if(bot_check_error_count) {
			doevent("ANTIBOT::OnBotCheck");
		}
	end;

	OnTimer1800000:
		initnpctimer;
		addrid(0);
	OnBotCheck:
		setpcblock(PCBLOCK_ALL, true);
	OnRetry:
		for(.@i = 0; .@i < .code_segment_count; .@i++) {
			.@code$[.@i] = create_code_segment(.code_segment_length);
		}

		mes "You Have 3 Chance to Type the Red Text Correctly";
		mes "If you failed- You will be jailed";
		mes "Input the ^FF0000RED COLOUR^000000 parts";
		mes "^FF0000" + implode(.@code$, "^000000^0000FF-^000000^FF0000") + "^000000";
		input .@input$;
		if(.@input$ != implode(.@code$, "")){
			bot_check_error_count++;
			if (bot_check_error_count >= .max_error_treshold) {
				atcommand("@jailfor " + .jail_duration_days + "d " + strcharinfo(0));
				announce("[Anti-BOT]: The user [" + strcharinfo(0) + "] has been jailed for " + .jail_duration_days + " days.", 0, 0xe80f0f);

				bot_check_error_count = 0;
				setpcblock(PCBLOCK_ALL, false);
				end;
			}
			
			mes("You entered the wrong code..");
			next;
			goto OnRetry;
		}

		bot_check_error_count = 0;
		setpcblock(PCBLOCK_ALL, false);
		end;

	function	create_code_segment	{
		.@length = getarg(0);

		setarray(.@character_list$, "1", "2", "3", "4", "5", "6", "7", "8", "9",
		"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", 
		"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
		"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=", "/", "+");

		for(.@i = 0; .@i < .@length; .@i++) {		
			.@code$ += .@character_list$[rand(getarraysize(.@character_list$))];
		}

		return .@code$;
	}
}

sec_pri	mapflag	pvp	off

 

  • Upvote 1
  • 0
Posted
12 hours ago, Winterfox said:
//===== Thaddeus Scripts ================================== 
//= Simple Cool Anti-Bot
//===== By: ================================================== 
//= Thaddeus
//===== Current Version: ===================================== 
//= 1.0
//===== Compatible With: ===================================== 
//= Hercules, rAthena, 3ceam, eAthena
//===== Description: =========================================
// Improvise Simple Anti-Bot! from method of Brian.
//===== Comments: ============================================
//= Change the % chance of triggering, change jail time.
//===== Additional Comments: =================================
//= 1.00 Initial Release
//===== Contact Info: =========================================
//= http://hercules.ws/board/user/457-thaddeus/
//============================================================
//===== Credits to: =========================================
//= Brian,
//============================================================


-	script	ANTIBOT	-1,{
	function create_code_segment;

	OnInit:
		.code_segment_length = 4;
		.code_segment_count = 3;
		.jail_duration_days = 10;
		.max_error_treshold = 3;

		initnpctimer;
	end;

	OnPCLoginEvent:
		if(bot_check_error_count) {
			doevent("ANTIBOT::OnBotCheck");
		}
	end;

	OnTimer1800000:
		initnpctimer;
		addrid(0);
	OnBotCheck:
		setpcblock(PCBLOCK_ALL, true);
	OnRetry:
		for(.@i = 0; .@i < .code_segment_count; .@i++) {
			.@code$[.@i] = create_code_segment(.code_segment_length);
		}

		mes "You Have 3 Chance to Type the Red Text Correctly";
		mes "If you failed- You will be jailed";
		mes "Input the ^FF0000RED COLOUR^000000 parts";
		mes "^FF0000" + implode(.@code$, "^000000^0000FF-^000000^FF0000") + "^000000";
		input .@input$;
		if(.@input$ != implode(.@code$, "")){
			bot_check_error_count++;
			if (bot_check_error_count >= .max_error_treshold) {
				atcommand("@jailfor " + .jail_duration_days + "d " + strcharinfo(0));
				announce("[Anti-BOT]: The user [" + strcharinfo(0) + "] has been jailed for " + .jail_duration_days + " days.", 0, 0xe80f0f);

				bot_check_error_count = 0;
				setpcblock(PCBLOCK_ALL, false);
				end;
			}
			
			mes("You entered the wrong code..");
			next;
			goto OnRetry;
		}

		bot_check_error_count = 0;
		setpcblock(PCBLOCK_ALL, false);
		end;

	function	create_code_segment	{
		.@length = getarg(0);

		setarray(.@character_list$, "1", "2", "3", "4", "5", "6", "7", "8", "9",
		"A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", 
		"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
		"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "=", "/", "+");

		for(.@i = 0; .@i < .@length; .@i++) {		
			.@code$ += .@character_list$[rand(getarraysize(.@character_list$))];
		}

		return .@code$;
	}
}

sec_pri	mapflag	pvp	off

 

thank you buds !

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...