i would like to script something for a warden in the onleavecombat tags
they get a spells to summon/sacrifice a pet for buffs, i dont think the bot can handle that correctly as-is
so i want to use a custom function i found on the runes forums to check for that buff on leaving combat, and if not present, run the summon/sacrifice script
atm im using:
Code: Select all
<onLeaveCombat><![CDATA[
if(player.free_counter2 == 0) then player.free_counter2 = os.time(); end;
if( os.difftime(os.time(), player.free_counter2) > 600 ) then
player.free_counter2 = os.time();
player:rest(1);
RoMScript("UseSkill(4,3)"); ---sumon skill
player:rest(9);
RoMScript("UseSkill(4,9)"); ---sacrifice skill
player:rest(1);
end
]]></onLeaveCombat>
so i think it would be much more effective to use a buff check after each kill, instead of a timer
function:
Code: Select all
function ChkBuff(tgt, ...)
local counter = 1;
local friendly = UnitIsPlayer(tgt);
local currentbuff = "none";
while (currentbuff ~= nil) do
if friendly then
currentbuff = UnitBuff(tgt, counter);
else
currentbuff = UnitDebuff(tgt, counter);
end
for i,v in pairs(arg) do
if (currentbuff == tostring(v)) then
return true;
end
end
counter = counter + 1;
end
return false;
end
so i think the bot isnt set up to see the game function UnitIsPlayer, and im not sure how to set it as something the bot recognizes