How to detect that teleport is completed

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

How to detect that teleport is completed

#1 Post by x_art » Sat Feb 06, 2010 12:44 pm

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

User avatar
Administrator
Site Admin
Posts: 5329
Joined: Sat Jan 05, 2008 4:21 pm

Re: How to detect that teleport is completed

#2 Post by Administrator » Sat Feb 06, 2010 1:42 pm

The easy way is to just yrest for 30 seconds (or more, if you have a slow computer).

x_art
Posts: 23
Joined: Thu Jun 11, 2009 2:22 am

Re: How to detect that teleport is completed

#3 Post by x_art » Mon Feb 08, 2010 2:30 am

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.

User avatar
Administrator
Site Admin
Posts: 5329
Joined: Sat Jan 05, 2008 4:21 pm

Re: How to detect that teleport is completed

#4 Post by Administrator » Mon Feb 08, 2010 7:34 am

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest