Page 1 of 1

How to detect that teleport is completed

Posted: Sat Feb 06, 2010 12:44 pm
by x_art
I've created a waypoint file for solo Raichika farming. All work well except one. Sometimes the script crashes on Cpawn:update when my character teleports from/to the instance. I think that this problem is caused by characters address changing. So, my question is: how to detect that teleport is completed and don't call Cpawn:update until TP is active?

I've tried a script like:

Code: Select all

		player.free_counter2 = 0;
		while(true)do
			yrest(6000);
			cprintf(cli.lightblue, "Testing zone ID\n");
			local zoneid = RoMScript("GetZoneID();");
			if(zoneid == 207)then
				break;
			end
			player.free_counter2 = player.free_counter2 + 1;
			if(player.free_counter2 > 3)then
				cprintf(cli.lightblue, "  Moving back and retry\n");
				player:moveTo( CWaypoint(4576, 1669), true);
				player:moveTo( CWaypoint(4573, 1764), true);
				player.free_counter2 = 0;
			end
		end
but it doesn't help...

Re: How to detect that teleport is completed

Posted: Sat Feb 06, 2010 1:42 pm
by Administrator
The easy way is to just yrest for 30 seconds (or more, if you have a slow computer).

Re: How to detect that teleport is completed

Posted: Mon Feb 08, 2010 2:30 am
by x_art
Administrator wrote:The easy way is to just yrest for 30 seconds (or more, if you have a slow computer).
This is very problematic on a PVP server :), because the character can be killed :). Additionally, it looks very suspicious if the character stays for this long period. Also I'm trying to farm in a non-stop mode (using party invite/leave), with max efficiency.

I don't understand, where in the code above the :update() function is called, because the script can fail in first 1-10 seconds.

Re: How to detect that teleport is completed

Posted: Mon Feb 08, 2010 7:34 am
by Administrator
x_art wrote:I don't understand, where in the code above the :update() function is called, because the script can fail in first 1-10 seconds.
I don't know what this is supposed to mean.