Aggro Interfering With Teleport...Much Death
Posted: Fri Jun 04, 2010 11:41 am
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:
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>