Jump to content
  • 0

RE:Timer Related Script Error


ToiletMaster

Question


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Hi there rAthena people!

Following back this topic, http://rathena.org/b...ased-on-timing/

credits to annieruru for the great assistance!

I marked it solved as it solved the problem entirely.

However, the problem came back again and this time. The npc is moving at all. I did some modifications and thought it was on my end. However, once i searched back my topic and took the code again. It still did not work. Is there anything i'm missing?

Thank you!

Here's the code from the topic.

end;
OnMon0000:
OnWed0000:
.unhide = 0;
disablenpc strnpcinfo(0);
end;
OnSun1629:
OnTue0000:
enablenpc strnpcinfo(0);
.unhide = 1;
goto L_start;
OnInit:
if ( gettime(4) != 0 && gettime(4) != 2 ) { // add this...
	disablenpc strnpcinfo(0);
	end;
}
else
	.unhide = 1;
L_start:
.@interval = 2;
.@step = 5;
while ( .unhide ) {
	sleep .@interval * 1000;
	getmapxy .@map$, .@x, .@y, 1;
	while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) );
	npcwalkto .@npc_x, .@npc_y;
	npctalk callfunc( "F_RandMes", 2,
		"Heloo!!!", // 1
		"Goodbye~!" // 2
	);		
}
end;
}

(note: I only change the onSun1429 for testing issues only)

(Another issue i found. The NPC will talk 2 times once it reaches the specific time.)

Example: Every 1 second NPC will say Hello and Goodbye!

Once it reaches OnSun1429, the NPC will say Hello and Goodbye 2 times and not moving still ._.)

Thanks again for taking your time to read this!

Bump for this topic thanks!

Another bump for this topic! Can't seem to get it to work either way

Edited by ToiletMaster
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I just thought wanna make this script a bit more readability,

prontera,156,182,5	script	Clemy	703,{
end;
OnFri2048:
OnFri2050:
goto L_start;
OnFri2049:
OnFri2051:
goto L_end;

OnInit:
if ( gettime(4) == 5 && gettime(3) == 20 && gettime(2) == 48 ||
	gettime(4) == 5 && gettime(3) == 20 && gettime(2) == 50 )
	goto L_start;
else
	goto L_end;

L_start:
enablenpc strnpcinfo(0);
.start = 1;
.@interval = 2;
.@step = 5;
while ( .start ) {
	sleep .@interval * 1000;
	getmapxy .@map$, .@x, .@y, 1;
	while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) );
//		announce .@map$ +" "+ .@npc_x +" "+ .@npc_y, 0;
	npcwalkto .@npc_x, .@npc_y;
	npctalk callfunc( "F_RandMes", 2,
		"Heloo!!!", // 1
		"Goodbye~!" // 2
	);		
}
end;
L_end:
.start = 0;
disablenpc strnpcinfo(0);
end;
}

then only found out the problem is npcmove script commmand is not working in latest SVN

dunno what the cause lol

http://rathena.org/board/tracker/issue-7165-npcwalkto-not-working-in-latest-svn/#entry17196

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  276
  • Reputation:   7
  • Joined:  08/11/12
  • Last Seen:  

Thanks annie for putting it up! Hope it gets fixed soon!

Solved at 17094

Edited by ToiletMaster
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

looks like its fixed now

however it seems that we have to npcspeed 150; for now

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