Jump to content

Question

Posted

hello and good day mam and sir

i here again for requesting

 

anti bot for mvp

after i kill the mvp the antibot pop up

 

-	script	Anti123	-1,{
OnNPCKillEvent:
  set @bot_chk, @bot_chk+1;
  if (@bot_chk < 60) end;
  else set @bot_chk,0;
atcommand "@die";
atcommand "@adjgmlvl -1 "+strcharinfo(0);
set .@A,rand(5000);
set .@B,rand(5000);
mes "If A = "+.@A+"   B = "+.@B;
cutin "kafra_08",2;
switch( rand(1) ){
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);
}
else if( .@Input == .@Answer ){
mes "Good Job!";
atcommand "@raise";
atcommand "@adjgmlvl 0 "+strcharinfo(0);
}
close;
}

this my script can i add all mvp id

14 answers to this question

Recommended Posts

Posted (edited)
-	script	Anti123	-1,{
OnNPCKillEvent:
setarray .@MVP,1000,1001,1002,10003; // Input MVP ID's here.
set .@m,getarraysize(.@MVP);
	for ( .@i = 0; .@i < .@m; .i++ ) {
		if (killedrid == .@MVP[.@i]) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		}
	}
}

try this just add MVP ID's over here. Tell me if not working. :D

setarray .@MVP,1000,1001,1002,10003; // Input MVP ID's here.
Edited by Lil Troll
Posted (edited)

Owww, this commands in my knowledge is for rathena only, gonna research how to do it on AE :(

for ( .@i = 0; .@i < .@m; .i++ ) {

 

DONE RESEARCHING

EDITED:

replace this:

set .@m,getarraysize(.@MVP);
    for ( .@i = 0; .@i < .@m; .i++ ) {
        if (killedrid == .@MVP[.@i]) {

to this:

for(set @i,0; @i<getarraysize(.@MVP); set @i,@i++) {
     if (killedrid == .@MVP[.@i]) {

 

If not working lets stick to oldschool scripting like this:

edit MVP number here:

if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
-	script	Anti123	-1,{
OnNPCKillEvent:
		if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		
	}
}

Sorry i didnt even try using eathena, actually im really new to scripting but i know many commands now but only in rathena, i actually dont know whats the difference between those emulators, pity me.. :(

Edited by Lil Troll
Posted
-	script	Anti123	-1,{
OnNPCKillEvent:
		if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
			set .@m,getarraysize(.@MVP);
    for ( .@i = 0; .@i < .@m; .i++ ) {
        if (killedrid == .@MVP[.@i]) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		}
	}
}

 Like this?

Posted (edited)
-	script	Anti123	-1,{
OnNPCKillEvent:
		if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
			set .@m,getarraysize(.@MVP);
    for ( .@i = 0; .@i < .@m; .i++ ) {
        if (killedrid == .@MVP[.@i]) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		}
	}
}
 Like this?

this one: (easy to configure)  

setarray .@MVP,1000,1001,1002,10003; // Input MVP ID's here.
-	script	Anti123	-1,{
OnNPCKillEvent:
setarray .@MVP,1000,1001,1002,10003; // Input MVP ID's here.
for(set @i,0; @i<getarraysize(.@MVP); set @i,@i++) {
     if (killedrid == .@MVP[.@i]) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		}
	}
}

if not working try this oldschool one: (manual adding)

if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
-	script	Anti123	-1,{
OnNPCKillEvent:
		if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		
	}
}
Edited by Lil Troll
Posted
-	script	Anti123	-1,{
OnNPCKillEvent:
		if (killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 ) {
			set @bot_chk, @bot_chk+1;
			if (@bot_chk < 60) end;
			else set @bot_chk,0;
			atcommand "@die";
			atcommand "@adjgmlvl -1 "+strcharinfo(0);
			set .@A,rand(5000);
			set .@B,rand(5000);
			mes "If A = "+.@A+"   B = "+.@B;
			cutin "kafra_08",2;
			switch( rand(1) ){
			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);
			}
			else if( .@Input == .@Answer ){
			mes "Good Job!";
			atcommand "@raise";
			atcommand "@adjgmlvl 0 "+strcharinfo(0);
			}
			close;
		
	}
}

i try this is not working i change the id to poporing when i kill poporing nothing happen

Posted

i try this is not working i change the id to poporing when i kill poporing nothing happen

 

First I'd like to ask. Are you talking about a mvp room or random mvp spawns?

 

If you're talking about for an mvp room please post the script you're using.

 


Also I recommend you do this so we can forever avoid the problem that keeps happening here.

 

1810835-GPYS0TV.png

 

1810839-EW84GT8.png

Posted

Using the original script.

 

-	script	Anti123	-1,{
OnNPCKillEvent:
	if ( !getmonsterinfo(killedrid,22) ) end;
	set @bot_chk, @bot_chk+1;
	if (@bot_chk < 1) end;
	else set @bot_chk,0;
	set .@user$, strcharinfo(0);
	
	attachnpctimer;
	startnpctimer;
	atcommand "@mute 1 "+.@user$;
	set .@A, rand(1,10);
	set .@B, rand(1,10);
	mes "If A = "+.@A+"   B = "+.@B;
	cutin "kafra_08",2;

	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 ?";
	}
	input .@Input;
	
	if ( .@Input == .@Answer ) {
		mes "Good Job!";
		cutin "",255;
		stopnpctimer;
		close2;
		detachrid;
		atcommand "@unmute "+.@user$;
		end;
	}
	
	mes "Wrong";
	stopnpctimer;
	detachrid;
	atcommand "@kick "+.@user$;
	close;
	
OnTimer60000:
	mes "Time Out!";
	stopnpctimer;
	sleep 1000;
	atcommand "@kick "+.@user$;
}
Posted (edited)

if add more mvp?

 

!getmonsterinfo(killedrid,1031,1904) 
!getmonsterinfo( killedrid == 5001 || killedrid == 5002 || killedrid == 5003 || killedrid == 5004 || killedrid == 5005 )

i try to combine but error

Edited by Phantom Of Rogue-Gon
Posted

Change : 

 if ( !getmonsterinfo(killedrid,22) ) end;

to : 

if ( killedrid != 5001 || killedrid != 5002 || killedrid != 5003 || killedrid != 5004 || killedrid != 5005 ) end;
Posted

What? Why?

getmonsterinfo(killedrid,22)

Ugh nvm... MVP EXP is an rAthena thing... Geez it's hard too keep track of all the changes.

 


 

-	script	Anti123	-1,{
OnNPCKillEvent:
	if ( !compare(.mvps$,"|"+killedrid+"|") ) end;
	set @bot_chk, @bot_chk+1;
	if (@bot_chk < 1) end;
	else set @bot_chk,0;
	set .@user$, strcharinfo(0);
	
	attachnpctimer;
	startnpctimer;
	atcommand "@mute 1 "+.@user$;
	set .@A, rand(1,10);
	set .@B, rand(1,10);
	mes "If A = "+.@A+"   B = "+.@B;
	cutin "kafra_08",2;

	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 ?";
	}
	input .@Input;
	
	if ( .@Input == .@Answer ) {
		mes "Good Job!";
		cutin "",255;
		stopnpctimer;
		close2;
		detachrid;
		atcommand "@unmute "+.@user$;
		end;
	}
	
	mes "Wrong";
	stopnpctimer;
	detachrid;
	atcommand "@kick "+.@user$;
	close;
	
OnTimer60000:
	mes "Time Out!";
	stopnpctimer;
	sleep 1000;
	atcommand "@kick "+.@user$;
	end;
	
OnInit:
	set .mvps$, "|5001|5002|5003|5004|5005|";
}
  • Upvote 1
Posted

What? Why?

getmonsterinfo(killedrid,22)

Ugh nvm... MVP EXP is an rAthena thing... Geez it's hard too keep track of all the changes.

 


 

-	script	Anti123	-1,{
OnNPCKillEvent:
	if ( !compare(.mvps$,"|"+killedrid+"|") ) end;
	set @bot_chk, @bot_chk+1;
	if (@bot_chk < 1) end;
	else set @bot_chk,0;
	set .@user$, strcharinfo(0);
	
	attachnpctimer;
	startnpctimer;
	atcommand "@mute 1 "+.@user$;
	set .@A, rand(1,10);
	set .@B, rand(1,10);
	mes "If A = "+.@A+"   B = "+.@B;
	cutin "kafra_08",2;

	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 ?";
	}
	input .@Input;
	
	if ( .@Input == .@Answer ) {
		mes "Good Job!";
		cutin "",255;
		stopnpctimer;
		close2;
		detachrid;
		atcommand "@unmute "+.@user$;
		end;
	}
	
	mes "Wrong";
	stopnpctimer;
	detachrid;
	atcommand "@kick "+.@user$;
	close;
	
OnTimer60000:
	mes "Time Out!";
	stopnpctimer;
	sleep 1000;
	atcommand "@kick "+.@user$;
	end;
	
OnInit:
	set .mvps$, "|5001|5002|5003|5004|5005|";
}

Wow!! First time I see, set command that will set a variable to the value that the expression results is in "OR". Is that possible in rAthena too sir Skorm?

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