Page 1 of 1

Aggro Interfering With Teleport...Much Death

Posted: Fri Jun 04, 2010 11:41 am
by althalos
I've had a problem for a while now, and can't find a solution on this forum (yet). While botting in an area with aggressive enemies, I have written code to teleport myself to my registered location when my main hand durability or potions get below a certain level. The script then pauses for the load screen, and loads a new waypoint file to get me to the appropriate shop to repair and restock (standard stuff). However, if the teleport gets interrupted by aggro, it still pauses for the allotted time, and I take massive damage and sometimes death. Clearly, I bot without watching the game and have ironed out pretty much all the wrinkles except this one. Has anyone else had this problem and devised a workaround? Should I just load a return waypoint, and if so, could it be made from one of my existing waypoints and just run in reverse? An example of code would be much appreciated. Thanks.

Fo' my code:

Code: Select all

<onLeaveCombat>
		-- Additional Lua code to execute after killing an enemy
			printf("\nCurrent Stats:\n");
			printf("---------------------------\n\n");
			printf("Health:%s\n", player.HP);
			local dura = inventory:getMainHandDurability();
			printf("Weapon Durability:%s\n", dura);
			if (0.55 > dura) then
			yrest(10000);
			RoMScript("UseSkill(1,2);");  --recall
			yrest(40000);
			player:update();
			__WPL:setForcedWaypointType("TRAVEL");
			loadPaths("Ystra Snoop to Jacques.xml");  --load repair path from teleport drop
			-- yrest(40000);
			end; 
			local poti = inventory:itemTotalCount("Regeneration Mixture");
			printf("Health Potions:%s\n\n", poti);
			if (11 > poti) then
			yrest(10000);
			RoMScript("UseSkill(1,2);");  --recall
			yrest(40000);
			__WPL:setForcedWaypointType("TRAVEL");
			-- yrest(40000);
			player:update();
			loadPaths("Ystra Snoop to Jacques.xml");  --load repair path from teleport drop
			end;
			
	</onLeaveCombat>

Re: Aggro Interfering With Teleport...Much Death

Posted: Fri Jun 04, 2010 12:09 pm
by rock5
First of all you don't need to do 2 separate 'if' statements that do the same thing, just use;

Code: Select all

if (0.55 > dura) or (11 > poti) then
After looking at your code a possible solution occurs to me. If you use

Code: Select all

__WPL:setForcedWaypointType("RUN");
before loadPath, it should ignore attacks while it teleports. That's assuming you can handle a bit of damage while teleporting and mob attacks don't interrupt teleports.

Re: Aggro Interfering With Teleport...Much Death

Posted: Fri Jun 04, 2010 12:39 pm
by althalos
Mob attacks do interrupt teleports, that's the problem.

Re: Aggro Interfering With Teleport...Much Death

Posted: Fri Jun 04, 2010 12:55 pm
by rock5
althalos wrote:Mob attacks do interrupt teleports, that's the problem.
There's probably a way to check if you are still in combat before attempting to teleport but I don't know how you can deal with being interrupted after you've already started teleporting.

I think the way you are doing it is wrong anyway. Return scripts are usually related to the waypoint file. If you load a different waypoint file wouldn't your onLeaveCombat become obsolete, or at least need to be edited?

I personally would choose certain safe points in the waypoint file to check your dura and potions and teleport. After all, your dura doesn't drop so fast that you need to check it after every combat.

What do you think?

Re: Aggro Interfering With Teleport...Much Death

Posted: Fri Jun 04, 2010 1:45 pm
by althalos
I agree, I don't need to check my dura after every combat, but it seems a moot point becuase it only takes a couple of seconds. But I see what you're saying; If I check it at, say, the end of the waypoints, which starts me standing on a safe path, I shouldn't be interrupted. Thanks for the idea.