Jump to content
  • 0

Pleeas help me to fix disconnect my simple anti bot script


Question

Posted

Hi,
I'm trying to fix the disconnect issue from this script but no luck ?  Could you find the error? Thanks
 

-	script	AntiBot	-1,{
OnPCLoginEvent:
	@mobCount = 0;
	end;

OnPCLogoutEvent:
	if (getgmlevel() < 99) {
		callsub S_UnHide;
	}
	end;

OnNPCKillEvent:

	if (@checking) end;

	.@map$ = strcharinfo(3);

	if (.@map$ == "mosk_dun03" || 
		.@map$ == "bra_dun02" || 
		.@map$ == "ice_dun03" || 
		.@map$ == "um_fild02" || 
		.@map$ == "um_fild04" || 
		.@map$ == "mosk_dun03" || 
		.@map$ == "ra_fild01" || 
		.@map$ == "yuno_fild11" ) {

		@mobCount++;

		if (@mobCount >= (.count-5)) {
			message strcharinfo(0), "Anti Bot will appear after "+ (.count - @mobCount) +" mobs.";
		}

		if (@mobCount >= .count) {
			@mobCount = 0;
			@checking = 1;

			attachnpctimer;
			initnpctimer;

			callsub S_Hide;

			.@A = rand(5);
		    .@B = rand(5);
		    @Answer = .@A + .@B;

		    mes "^0000FF[ Anti Marco ]^000000";
		    mes "A = "+.@A+"   B = "+.@B;
		    mes "A + B?";
		    input @Input;

		    if (@Input != @Answer) {
		    	@checking = 0;
		    	stopnpctimer;
	       	 	detachnpctimer;

	       	 	callsub S_UnHide;

		        Zeny -= 100000;
		        warp "prontera", 156,191;
		    } else {
		    	@checking = 0;
		    	next;
		    	mes "^0000FF[ Anti Bot ]^000000";
		    	mes "....";
		    	percentheal 100,100;

		    	stopnpctimer;
	        	detachnpctimer;
			    
	        	callsub S_UnHide;

			    Zeny += 50000;
				close;
		    }
			end;
		}
		end;
	}
	end;

S_Hide:
	setoption 0x2,1; // Hide in effect.
	setoption 0x2000,1; // Ruwach is in effect.
	atcommand "@battleignore";
	return;

S_UnHide:
	setoption 0x2,0; // Hide in effect.
	setoption 0x2000,0; // Ruwach is in effect.
	atcommand "@battleignore";
	return;

OnTimer30000:
	Zeny -= 100000;
	warp "prontera", 156,191;
	callsub S_UnHide;
	end;
OnInit:
	.count = 100; // 100 mobs
	end;
}

 

1 answer to this question

Recommended Posts

  • 0
Posted
[Error]: script_set_reg: failed to set param 'Zeny' to -37769.
[Debug]: Source (NPC): AntiBot (invisible/not on a map)

make sure you put Zeny check before deducting Zeny...
and probably check Zeny if overflow if the condition is true

just put atcommand "@kick "+ strcharinfo(0); if you want to kick players

  • Love 1

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