Check other bot's Level after combat?
Posted: Fri Sep 07, 2012 8:47 am
I have a question on how to do this. I'm making a Forsaken Abbey automated run where two bot will go in on an honor party. One of the many areas I'm having trouble figuring out is this. After the higher level bot leaves combat, he should check the other bot's level, and if the other bot has reached level 29, then it should break party and load a different waypoint (to prevent the other bot from reaching level 30 and thus not being able to do honor with it's other class). Here's the code I'm trying to use on the profile of the higher level bot that's running the honor party:
The error I got said something about targeting a global variable or something (should have wrote it down). Maybe this would work better to have the bot that levels up check his own level during an onLevelup event? Either way, I have trouble getting any code to work in the event handlers on the profiles so I'm not sure if my syntax is way off or what. Any help would be much appreciated.
Code: Select all
<onLeaveCombat><![CDATA[
-- Additional Lua code to execute after killing an enemy
-- *****Check for message from player or level of player so i know whether or not to exit
RoMScript("TargetUnit('party2');");
player:update();
partner = player:getTarget();
if( partner ) then
if target.level == 29 then
SlashCommand("ILG destroy");
loadPaths("exitmacro");
end
end
]]></onLeaveCombat>