Jump to content
  • 0

bot checker


darking123

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

hi i want to modify my bot checker

i am using 3ceam svn

 

i want that this will work also once i talk to it.. then it would work on the map that i added to the script

 

example

i added the maps in the script like  prt_maze03, pay_fild00,

 

then when i choose ALL check then the both checker will activate on those map i provided so i won't be doing it manually player by player but i also still want that the manual bot check is intact 

 

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	initnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

 



also the 60 second countdown doesnt work..

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

L_Start:	
// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	initnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
	
OnWhisperGlobal:
	if(!getgmlevel())
		end;
	if(@whispervar0$=="all"){
		while( .@V < $PlayerNumber ){
			set .@V,.@V+1;
			if( isloggedin(getd("$RecordAID"+.@V)) ){
				attachrid(getd("$RecordAID"+.@V));
				goto L_Start;
			}
		}
		end;
	}
	if(@whispervar0$=="map") {
		while( .@V < $PlayerNumber ){
			set .@V,.@V+1;
			getmapxy(.@N123$,.@B,.@C,0,rid2name(getd("$RecordAID"+.@V)));
			if( @whispervar1$ != "" && @whispervar1$ == .@N123$ ){
				attachrid(getd("$RecordAID"+.@V));
				goto L_Start;
			}
		}
	}
	end;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

-	script	BlackHoleEvent	-1,{
OnPCLoginEvent:
	setd "$RecordAID"+set($PlayerNumber,$PlayerNumber+1),getcharid(3);
	end;
OnInit:
OnTimer5000:
	initnpctimer;
	for(set .@i,1;.@i<=$PlayerNumber;set .@i,.@i+1)
	{
		if(!isloggedin(getd("$RecordAID"+.@i)))
		{
			if(!getd("$RecordAID"+.@i))
			{
				set $PlayerNumber,0;
				break;
			}
			setd "$RecordAID"+.@i,getd("$RecordAID"+(.@i+1));
			setd "$RecordAID"+(.@i+1),0;
			set .@i,.@i-1;
		}
	}
	end;
}

 

Added an OnGlobalWhisper thing...

 

I forgot exactly how they work but I think it's like:

To check all players.

ReviseRO Police : all

To check all players on a map.

ReviseRO Police : map#prt_maze03

Hope that works I have no way of testing x.x

 

Edit: forgot to include the blackhole event.

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

L_Start:	
// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	initnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
	
OnWhisperGlobal:
	if(!getgmlevel())
		end;
	if(@whispervar0$=="all"){
		while( .@V < $PlayerNumber ){
			set .@V,.@V+1;
			if( isloggedin(getd("$RecordAID"+.@V)) ){
				attachrid(getd("$RecordAID"+.@V));
				goto L_Start;
			}
		}
		end;
	}
	if(@whispervar0$=="map") {
		while( .@V < $PlayerNumber ){
			set .@V,.@V+1;
			getmapxy(.@N123$,.@B,.@C,0,rid2name(getd("$RecordAID"+.@V)));
			if( @whispervar1$ != "" && @whispervar1$ == .@N123$ ){
				attachrid(getd("$RecordAID"+.@V));
				goto L_Start;
			}
		}
	}
	end;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

-	script	BlackHoleEvent	-1,{
OnPCLoginEvent:
	setd "$RecordAID"+set($PlayerNumber,$PlayerNumber+1),getcharid(3);
	end;
OnInit:
OnTimer5000:
	initnpctimer;
	for(set .@i,1;.@i<=$PlayerNumber;set .@i,.@i+1)
	{
		if(!isloggedin(getd("$RecordAID"+.@i)))
		{
			if(!getd("$RecordAID"+.@i))
			{
				set $PlayerNumber,0;
				break;
			}
			setd "$RecordAID"+.@i,getd("$RecordAID"+(.@i+1));
			setd "$RecordAID"+(.@i+1),0;
			set .@i,.@i-1;
		}
	}
	end;
}

 

Added an OnGlobalWhisper thing...

 

I forgot exactly how they work but I think it's like:

To check all players.

ReviseRO Police : all

To check all players on a map.

ReviseRO Police : map#prt_maze03

Hope that works I have no way of testing x.x

 

Edit: forgot to include the blackhole event.

when i tried to whisper map#zhakastia

the npc shows up

but there is no text box where i should type the code

all the countdown doesnt work

 

atkdo6.jpg

Edited by glemor123
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Are you getting any map errors... player not attached etc??

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

Are you getting any map errors... player not attached etc??

im not getting any error..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  254
  • Reputation:   72
  • Joined:  07/10/13
  • Last Seen:  

I tried that script with the latest rAthena SVN and it did work.

However, I was alone on my test server. Have you tested it with players online?

In general, this OnPCLoginEvent solution is a rather unhappy one and it might cause the problems.

You should rather get the players online by querying the char table, because there are always five seconds in this script to update which might lead to attachrid problems.

The char table is always up to date, so using it is the best solution for this issue.

deletearray .@AccountIDsOnline[ 0 ], getarraysize( .@AccountIDsOnline );
query_sql "SELECT `char`.`account_id` FROM `char` WHERE `char`.`online` = 1", .@AccountIDsOnline;
Please note that this solution will only work properly if you never have more than 128 players online on your server. If you have more players, a more complex solution is needed. You would have to use the OFFSET functionality of MySQL in that case.

If you want to check a certain map, you would firstly select all players online and then loop through the account ids, attach each single player and check the player's map. If you have problems realising this, tell me and I will help.

Edited by Xynvaroth
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

I tried that script with the latest rAthena SVN and it did work.

However, I was alone on my test server. Have you tested it with players online?

In general, this OnPCLoginEvent solution is a rather unhappy one and it might cause the problems.

You should rather get the players online by querying the char table, because there are always five seconds in this script to update which might lead to attachrid problems.

The char table is always up to date, so using it is the best solution for this issue.

deletearray .@AccountIDsOnline[ 0 ], getarraysize( .@AccountIDsOnline );
query_sql "SELECT `char`.`account_id` FROM `char` WHERE `char`.`online` = 1", .@AccountIDsOnline;
Please note that this solution will only work properly if you never have more than 128 players online on your server. If you have more players, a more complex solution is needed. You would have to use the OFFSET functionality of MySQL in that case.

If you want to check a certain map, you would firstly select all players online and then loop through the account ids, attach each single player and check the player's map. If you have problems realising this, tell me and I will help.

 

Yeah that would be a better solution. I am unable to test scripts because I had to reformat my HDD. Most of the time I just flip through my collection mentally until I think of a similar script and merge them together which isn't always the best solution.

 

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

L_Start:	
// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	initnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
	
OnWhisperGlobal:
	if(!getgmlevel())
		end;
	query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;
	set .@len, getarraysize(.@IDs);
	if(@whispervar0$=="all"){
		while( .@V < .@len ){
			if( isloggedin(.@IDs[.@V]) ){
				attachrid(.@IDs[.@V]);
				goto L_Start;
			}
			set .@V,.@V+1;
		}
		end;
	}
	if(@whispervar0$=="map")
		while( .@V < .@len ){
			getmapxy(.@N123$,.@B,.@C,0,rid2name(.@IDs[.@V]));
			if( @whispervar1$ != "" && @whispervar1$ == .@N123$ && isloggedin(.@IDs[.@V]) ){
				attachrid(.@IDs[.@V]);
				goto L_Start;
			}
			set .@V,.@V+1;
		}
	end;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

Try this still repairing server so I can't test just yet, but this uses the sql method posted by Xynvaroth.

 


 

If he has more then 128 players on at once I would use copy and delete array.

query_sql("SELECT SUM(`online`) FROM `char`",.@sum);
while(.@sum>=0) {
set .@sum,.@sum-128;
query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1 limit "+.@sum+",128",.@IDs);
set .@i,.@i+1;
copyarray getd(".@IDs"+.@i+"[0]"),.@IDs;
deletearray .@IDs[0], getarraysize( .@IDs );
}

Something like that...

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

 

I tried that script with the latest rAthena SVN and it did work.

However, I was alone on my test server. Have you tested it with players online?

In general, this OnPCLoginEvent solution is a rather unhappy one and it might cause the problems.

You should rather get the players online by querying the char table, because there are always five seconds in this script to update which might lead to attachrid problems.

The char table is always up to date, so using it is the best solution for this issue.

deletearray .@AccountIDsOnline[ 0 ], getarraysize( .@AccountIDsOnline );
query_sql "SELECT `char`.`account_id` FROM `char` WHERE `char`.`online` = 1", .@AccountIDsOnline;
Please note that this solution will only work properly if you never have more than 128 players online on your server. If you have more players, a more complex solution is needed. You would have to use the OFFSET functionality of MySQL in that case.

If you want to check a certain map, you would firstly select all players online and then loop through the account ids, attach each single player and check the player's map. If you have problems realising this, tell me and I will help.

 

Yeah that would be a better solution. I am unable to test scripts because I had to reformat my HDD. Most of the time I just flip through my collection mentally until I think of a similar script and merge them together which isn't always the best solution.

 

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

L_Start:	
// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	initnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
	
OnWhisperGlobal:
	if(!getgmlevel())
		end;
	query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;
	set .@len, getarraysize(.@IDs);
	if(@whispervar0$=="all"){
		while( .@V < .@len ){
			if( isloggedin(.@IDs[.@V]) ){
				attachrid(.@IDs[.@V]);
				goto L_Start;
			}
			set .@V,.@V+1;
		}
		end;
	}
	if(@whispervar0$=="map")
		while( .@V < .@len ){
			getmapxy(.@N123$,.@B,.@C,0,rid2name(.@IDs[.@V]));
			if( @whispervar1$ != "" && @whispervar1$ == .@N123$ && isloggedin(.@IDs[.@V]) ){
				attachrid(.@IDs[.@V]);
				goto L_Start;
			}
			set .@V,.@V+1;
		}
	end;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

Try this still repairing server so I can't test just yet, but this uses the sql method posted by Xynvaroth.

 


 

If he has more then 128 players on at once I would use copy and delete array.

query_sql("SELECT SUM(`online`) FROM `char`",.@sum);
while(.@sum>=0) {
set .@sum,.@sum-128;
query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1 limit "+.@sum+",128",.@IDs);
set .@i,.@i+1;
copyarray getd(".@IDs"+.@i+"[0]"),.@IDs;
deletearray .@IDs[0], getarraysize( .@IDs );
}

Something like that...

thank you for the help guys.

but my server have 150+ players

can this script still be useful even though there is a max aloted players for it?

also about the countdown i tried to not fillup the text box..but the countdown doesnt work.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////

////////////////////////////BOT POLICE 2.1////////////////////////////

/////////////////////////////By: Lucas M./////////////////////////////

//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.

// 2. Edit second marks as needed.

// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).

// 4. @jailfor works differently for different servers. Adjust appropriately.

// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6 script ReviseRO Police 884,{

if (getgmlevel() >= 60) goto L_AdminPolice;

mes "[EllieRO Police]";

mes "Good day.";

close;

L_AdminPolice:

mes "[EllieRO Police]";

mes "Please input the name of a";

mes "player you would like to";

mes "superimpose a check on.";

next;

input @NAME$;

if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;

mes "[EllieRO Police]";

mes "The player is online. An";

mes "interrogation is underway.";

close2;

attachrid(getcharid(3,@NAME$));

L_Start:

// Targetted Player Pop-Up Message

attachnpctimer strcharinfo(0);

startnpctimer;

atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.

mes "[Ellie Staff]";

mes "Manditory bot check in progress.";

set @botcode,rand (1111,9999);

mes "You have ^B4040460 seconds^000000 seconds to";

mes "input the following code:";

mes "[ ^5FB404"+@botcode+"^000000 ]";

input @exitnum;

if (@exitnum == @botcode) goto L_Correct;

if (@exitnum != @botcode) goto L_Wrong;

close;

OnTimer10000: //10 second mark.

dispbottom "50 seconds to comply or risk being banned.";

end;

OnTimer20000: //20 second mark.

dispbottom "40 seconds to comply or risk being banned.";

end;

OnTimer30000: //30 second mark.

dispbottom "30 seconds to comply or risk being banned.";

end;

OnTimer40000: //40 second mark.

dispbottom "20 seconds to comply or risk being banned.";

end;

OnTimer50000: //50 second mark.

dispbottom "10 seconds to comply or risk being banned.";

end;

OnTimer55000: //55 second mark.

dispbottom "5 seconds to comply.";

end;

OnTimer56000: //56 second mark.

dispbottom "4 seconds to comply.";

end;

OnTimer57000: //57 second mark.

dispbottom "3 seconds to comply.";

end;

OnTimer58000: //58 second mark.

dispbottom "2 seconds to comply.";

end;

OnTimer59000: //59 second mark.

dispbottom "1 second to comply.";

end;

OnTimer60000: //60 second mark.

stopnpctimer;

atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//

// 3 hours jail time for not responding in 60 seconds.

// (mh = month, dy = day, hr = hour, mn = minute)

atcommand "@ban 1y "+strcharinfo(0)+"";

end;

//-------------------------------------------------------------------//

L_Notlogged:

mes "[ReviseRO Police]";

mes "That person is not logged in.";

close;

L_Wrong:

next;

mes "[ReviseRO Staff]";

mes "This is your second attempt.";

set @botcode,rand (1111,9999);

mes "You have ^B40404less than a minute^000000";

mes "to input the following code:";

mes "[ ^DF7401"+@botcode+"^000000 ]";

input @exitnum;

if (@exitnum == @botcode) goto L_Correct;

if (@exitnum != @botcode) goto L_WrongLastTry;

close;

L_WrongLastTry:

next;

mes "[ReviseRO Staff]";

mes "This is your last chance.";

set @botcode,rand (1111,9999);

mes "You have ^B40404less than a minute^000000";

mes "to input the following code:";

mes "[ ^DF0101"+@botcode+"^000000 ]";

input @exitnum;

if (@exitnum == @botcode) goto L_Correct;

close2;

mes "[Ellie Staff]";

mes "You have failed the test.";

stopnpctimer;

sleep2 1000;

atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

sleep2 1000;

//-------------------------------------------------------------------//

// 3 hours jail time for inputting the incorrect code three times.

// (mh = month, dy = day, hr = hour, mn = minute)

atcommand "@ban 1y "+strcharinfo(0)+"";

end;

//-------------------------------------------------------------------//

L_Correct:

next;

stopnpctimer;

atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

percentheal 100,100;

sc_start SC_BLESSING,300000,10;

sc_start SC_INCREASEAGI,300000,10;

specialeffect2 EF_BLESSING;

specialeffect2 EF_INCAGILITY;

mes "[EllieRO Police]";

mes "You passed. Thank you for your time.";

close;

OnWhisperGlobal:

if(!getgmlevel())

end;

if(@whispervar0$=="all") {

query_sql("SELECT SUM(`online`) FROM `char`",.@sum);

set .@lim, 128;

if(.@sum>128) {

while(.@sum>0) {

if(.@sum<.@lim&&.@sum>0) { set .@lim,.@sum; set .@sum,1; }

else if(.@sum>=.@lim) { set .@sum,.@sum-.@lim; } else { end; }

query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1 LIMIT "+.@sum+","+.@lim,.@IDs);

set .@len, getarraysize(.@IDs);

while( .@V < .@len ){

if( isloggedin(.@IDs[.@V]) ) {

attachrid(.@IDs[.@V]);

goto L_Start;

}

set .@V,.@V+1;

} deletearray .@IDs, .@len;

if(!(.@sum-1)) end;

}

} else {

query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;

while( .@V < .@len ) {

if( isloggedin(.@IDs[.@V]) ) {

attachrid(.@IDs[.@V]);

goto L_Start;

}

set .@V,.@V+1;

}

}

end;

}

if(@whispervar0$=="map") {

query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;

set .@len, getarraysize(.@IDs);

while( .@V < .@len ){

getmapxy(.@N123$,.@B,.@C,0,rid2name(.@IDs[.@V]));

if( @whispervar1$ != "" && @whispervar1$ == .@N123$ && isloggedin(.@IDs[.@V]) ){

attachrid(.@IDs[.@V]);

goto L_Start;

}

set .@V,.@V+1;

}

}

end;

}

// Jail Cell 1.

sec_pri,57,83,4 script Jail Time#1::Jail Time 738,{

mes "[Jail Time]";

mes "You have been caught botting.";

mes "Please wait for your sentence";

mes "to play out or contact a GM.";

atcommand "@jailtime "+strcharinfo(0)+"";

close;

}

//Jail Cell 2.

sec_pri,32,83,4 duplicate(Jail Time) Jail Time#2 738

Edited by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////////////////////////////BOT POLICE 2.1////////////////////////////
/////////////////////////////By: Lucas M./////////////////////////////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

// 1. Edit names and location as needed.
// 2. Edit second marks as needed.
// 3. Edit @adjgmlvl command as needed(for servers with GM LvL 1 players).
// 4. @jailfor works differently for different servers. Adjust appropriately.
// 5. When testing on your lvl 99 GM, note that @adjgmlvl has been set to 0. Relog to refresh your commands.

zhakastia,79,37,6	script	ReviseRO Police	884,{
	if (getgmlevel() >= 60) goto L_AdminPolice;
	mes "[EllieRO Police]";
	mes "Good day.";
	close;

L_AdminPolice:
	mes "[EllieRO Police]";
	mes "Please input the name of a";
	mes "player you would like to";
	mes "superimpose a check on.";
	next;
	input @NAME$;
	if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
	mes "[EllieRO Police]";
	mes "The player is online. An";
	mes "interrogation is underway.";
	close2;
	attachrid(getcharid(3,@NAME$));

L_Start:	
// Targetted Player Pop-Up Message
	attachnpctimer strcharinfo(0);
	startnpctimer;
	atcommand "@adjgmlvl -1 "+strcharinfo(0)+""; // Leave this alone.
	mes "[Ellie Staff]";
	mes "Manditory bot check in progress.";
	set @botcode,rand (1111,9999);
	mes "You have ^B4040460 seconds^000000 seconds to";
	mes "input the following code:";
	mes "[          ^5FB404"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_Wrong;
	close;

OnTimer10000: //10 second mark.
	dispbottom "50 seconds to comply or risk being banned.";
	end;

OnTimer20000: //20 second mark.
	dispbottom "40 seconds to comply or risk being banned.";
	end;

OnTimer30000: //30 second mark.
	dispbottom "30 seconds to comply or risk being banned.";
	end;

OnTimer40000: //40 second mark.
	dispbottom "20 seconds to comply or risk being banned.";
	end;

OnTimer50000: //50 second mark.
	dispbottom "10 seconds to comply or risk being banned.";
	end;

OnTimer55000: //55 second mark.
	dispbottom "5 seconds to comply.";
	end;


OnTimer56000: //56 second mark.
	dispbottom "4 seconds to comply.";
	end;

OnTimer57000: //57 second mark.
	dispbottom "3 seconds to comply.";
	end;

OnTimer58000: //58 second mark.
	dispbottom "2 seconds to comply.";
	end;

OnTimer59000: //59 second mark.
	dispbottom "1 second to comply.";
	end;

OnTimer60000: //60 second mark.
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.

//-------------------------------------------------------------------//
// 3 hours jail time for not responding in 60 seconds.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//

L_Notlogged:
	mes "[ReviseRO Police]";
	mes "That person is not logged in.";
	close;

L_Wrong:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your second attempt.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF7401"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	if (@exitnum != @botcode) goto L_WrongLastTry;
	close;

L_WrongLastTry:
	next;
	mes "[ReviseRO Staff]";
	mes "This is your last chance.";
	set @botcode,rand (1111,9999);
	mes "You have ^B40404less than a minute^000000";
	mes "to input the following code:";
	mes "[          ^DF0101"+@botcode+"^000000          ]";
	input @exitnum;
	if (@exitnum == @botcode) goto L_Correct;
	close2;
	mes "[Ellie Staff]";
	mes "You have failed the test.";
	stopnpctimer;
	sleep2 1000;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	sleep2 1000;

//-------------------------------------------------------------------//
// 3 hours jail time for inputting the incorrect code three times.
// (mh = month, dy = day, hr = hour, mn = minute)

	atcommand "@ban 1y "+strcharinfo(0)+"";
	end;
//-------------------------------------------------------------------//


L_Correct:
	next;
	stopnpctimer;
	atcommand "@adjgmlvl 0 "+strcharinfo(0)+""; // Sets to GM LvL 0.
	percentheal 100,100;
	sc_start SC_BLESSING,300000,10;
	sc_start SC_INCREASEAGI,300000,10;
	specialeffect2 EF_BLESSING;
	specialeffect2 EF_INCAGILITY;
	mes "[EllieRO Police]";
	mes "You passed. Thank you for your time.";
	close;
	
OnWhisperGlobal:
	if(!getgmlevel())
		end;
	if(@whispervar0$=="all") {
		query_sql("SELECT SUM(`online`) FROM `char`",.@sum);
		set .@lim, 128;
		if(.@sum>128) {
			while(.@sum>0) {
				if(.@sum<.@lim&&.@sum>0) { set .@lim,.@sum; set .@sum,1; }
				else if(.@sum>=.@lim){ set .@sum,.@sum-.@lim; } else { end; }
				query_sql("SELECT `account_id` FROM `char` WHERE `online` = 1 LIMIT "+.@sum+","+.@lim,.@IDs);
				set .@len, getarraysize(.@IDs);
				while( .@V < .@len ){
					if( isloggedin(.@IDs[.@V]) ) {
						attachrid(.@IDs[.@V]);
						goto L_Start;
					}
					set .@V,.@V+1;
				} deletearray .@IDs, .@len;
			}
		} else {
			query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;
			while( .@V < .@len ) {
				if( isloggedin(.@IDs[.@V]) ) {
					attachrid(.@IDs[.@V]);
					goto L_Start;
				}
				set .@V,.@V+1;
			}
		}
		end;
	}
	if(@whispervar0$=="map") {
		query_sql "SELECT `account_id` FROM `char` WHERE `online` = 1", .@IDs;
		set .@len, getarraysize(.@IDs);
		while( .@V < .@len ){
			getmapxy(.@N123$,.@B,.@C,0,rid2name(.@IDs[.@V]));
			if( @whispervar1$ != "" && @whispervar1$ == .@N123$ && isloggedin(.@IDs[.@V]) ){
				attachrid(.@IDs[.@V]);
				goto L_Start;
			}
			set .@V,.@V+1;
		}
	}
	end;
}


// Jail Cell 1.

sec_pri,57,83,4	script	Jail Time#1::Jail Time	738,{
	mes "[Jail Time]";
	mes "You have been caught botting.";
	mes "Please wait for your sentence";
	mes "to play out or contact a GM.";
	atcommand "@jailtime "+strcharinfo(0)+"";
	close;
}


//Jail Cell 2.

sec_pri,32,83,4	duplicate(Jail Time)	Jail Time#2	738

the countdown time doesnt work sir/mam

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...