Jump to content
  • 0

Error with Emistry's counting game script 1.2


Question

Posted

Hello everyone, my problem is: I tried put and test Emistry's Counting Game v 1.2 in my rAthena, but i got this error, i don't know if this a PCRE problem or a script error (i'm using Visual Studio C++ 2017 professional for compiling, OS: Windows 7 x64).

Thanks.

Sin título.jpg

7 answers to this question

Recommended Posts

  • 1
Posted

Try adding a space after your answer and it should work.

or search the script for:

defpattern 1,"([^:]+):.*"+.@amount+".$", "OnRight";

and change to:

defpattern 1,"([^:]+):.*\\s"+.@amount+".*","OnRight";

It should work.

  • Upvote 1
  • 1
Posted

Well it worked on my side so...yeah.


-	script	testcg	-1,{
OnInit:
	bindatcmd "testcg","Monster Counting Game::OnStartEvent";
	end;
}


prontera,155,181,5	script	Monster Counting Game	757,{
	function xy_wall;
	end;
	
	OnInit:
		.max_round = 3;
		.max_duration = 3;
		.wall_mob_id = 1085;
		setarray .xy_area,
			151,169,
			161,179;
		setarray .monster,
			1002,
			1113,
			1242,
			1031;
			
		.monster_size = getarraysize( .monster );
		.npc_name$ = strnpcinfo(0);
		getmapxy( .map$,.npc_x,.npc_y,1 );
		setmapflag .map$,mf_monster_noteleport;
		end;
	
	OnMinute55:
	announce "[Event] Monster Counting Event in New Prontera will begin in 5 minutes!",bc_all,0x66FFCC;
	end;
	
	OnMinute56:
	announce "[Event] Monster Counting Event in New Prontera will begin in 4 minutes!",bc_all,0x66FFCC;
	end;
	
	OnMinute57:
	announce "[Event] Monster Counting Event in New Prontera will begin in 3 minutes!",bc_all,0x66FFCC;
	end;
	
	OnMinute58:
	announce "[Event] Monster Counting Event in New Prontera will begin in 2 minutes!",bc_all,0x66FFCC;
	end;
	
	OnMinute59:
	announce "[Event] Monster Counting Event in New Prontera will begin in 1 minute!",bc_all,0x66FFCC;
	setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_basilica,1;
	setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_walkable,1;
	end;
	
	OnMinute00:
	OnStartEvent:
		if ( !.status ) {
			areawarp .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],.map$,.npc_x,.npc_y;
			killmonster .map$,.npc_name$+"::OnDied";
			killmonster .map$,.npc_name$+"::OnWallDied";
			//setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_basilica,1;
			//setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_walkable,1;
			.status = 1;
			
			for( .@i = .xy_area[0]; .@i <= .xy_area[2]; .@i++ ){
				xy_wall( .@i,.xy_area[1] );
				xy_wall( .@i,.xy_area[3] );
			}
			for( .@i = .xy_area[1]; .@i <= .xy_area[3]; .@i++ ){
				xy_wall( .xy_area[0],.@i,0 );
				xy_wall( .xy_area[2],.@i );
			}
			
			do{
				.@round++;
				npctalk "Round # "+.@round;
				sleep 5000;
				
				.status = 2;
				.@mob = .monster[ rand( .monster_size ) ];
				.@amount = rand( 20,50 );
				// add-on size influence ?
				areamonster .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],"",.@mob,.@amount,.npc_name$+"::OnDied";
			
				deletepset 1;
				defpattern 1,"([^:]+):.*\\s"+.@amount+".*","OnRight";
				activatepset 1;
				waitingroom "How many's there?",0;
				npctalk "Tell me the correct amount of monster in there.";
				debugmes " > "+.@amount+" "+getmonsterinfo( .@mob,MOB_NAME );
				
				sleep ( .max_duration * 60000 );
				
				killmonster .map$,.npc_name$+"::OnDied";
				delwaitingroom;
				deletepset 1;
				.status = 1;
				sleep 5000;
				
			}while( .@round < .max_round );
			
			npctalk "That's the Last, thank you for participating.";
			emotion e_thx;
			
			killmonster .map$,.npc_name$+"::OnDied";
			killmonster .map$,.npc_name$+"::OnWallDied";
			setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_basilica,0;
			setcell .map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_walkable,1;
			.status = 0;
		}
		end;
		
	OnDied: 
	OnWallDied: 
		end;

	OnRight:
		getmapxy( .@map$,.@x,.@y,0 );
		if ( .status == 0 ) {
			dispbottom "[Counting Game] Event isnt running.";
		}
		else if ( .status == 1 ) {
			dispbottom "[Counting Game] Please wait for the round to start.";
		}
		else if ( distance( .npc_x,.npc_y,.@x,.@y ) > 14 ) {
			dispbottom "[Counting Game] You're too far away.";
		}
		else {
			npctalk "Bravo!! "+strcharinfo(0)+" is correct!!";
			
			// rewards
			getitem 512,1;
			getitem 512,2;
			getitem 512,3;
			
			specialeffect2 EF_POTION_CON;
			awake .npc_name$;
		}
		end;
		
	function	xy_wall	{
		.@x = getarg(0); 
		.@y = getarg(1);
		monster .map$,.@x,.@y,"",.wall_mob_id,1,.npc_name$+"::OnWallDied";
		setcell .map$,.@x,.@y,.@x,.@y,cell_walkable,0;
		setcell .map$,.@x,.@y,.@x,.@y,cell_basilica,1;
		return;
	}

}

 

Test this. Type @testcg to force start the event.

  • 0
Posted (edited)

Thanks for replying, i changed this:

		setarray .monster,
			PORING,
			DROPS,
			MARIN,
			POPORING;

for this:

		setarray .monster,
			1002,
			1113,
			1242,
			1031;
5983eef65fc69_Sinttulo.jpg.ccfb8f0d093b8dd942a8871c34d03a34.jpg
 
 
Now the script runs without errors, but the npc does nothing with my answers (mob number quantity)
Edited by DelghLay
grammar mistake xd
  • 0
Posted

Doesn't react with my answers (yes, i've counted properly xd), also i've tested disguiser but this work 100%, i dont know

 

Fixed, Thanks you sotf, you're great

 

 

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