I have just a couple questions about some skills. My first question is about some skills that when I enable them in my profile, they seem to cast over, and over, and over. For instance, the Priest's Magic Barrier. If I enable it, the bot will cast it repeatedly. What would my settings need to be so it only casts it when the buff is gone (or about to expire)? The same thing seems to happen a lot of times with other buff skills so I just want to understand the different parts of the setting so I can set it properly. I'd post my current setting for that skill from my profile but I've messed with it so much that it's obviously wrong. I've recently made sure I have the latest skills file (I think at some point I had edited something in there but I updated it with the latest).
My other question deals with the mage's Flame. Is there any way to set it so it will not use it if the target is below a certain # of HP? I was also thinking of implementing a way where if the target has over a certain amount of HP, that it will keep casting Flame until that hp drops below that level. I tried to put some code in my onPreSkillCast section but I couldn't get it to work. Here's what I tried using:
Code: Select all
<onPreSkillCast><![CDATA[
if player:haveTarget() then
target = player:getTarget();
if target.Type == 2 then
if 70000 > target.HP then
ChangeProfileSkill("MAGE_FLAME","AutoUse",false)
else
ChangeProfileSkill("MAGE_FLAME","AutoUse",true)
end
if target.HP > 300000 then
printf("target HP is higher than 300,000. Using Flame!")
player:cast("MAGE_FLAME")
end
end
end
]]></onPreSkillCast>
the line
if target.Type == 2 then was my attempt at making sure the target is something I want to attack as I don't want this code to execute if, for instance, the bot is trying to apply a self buff. In this particular example I wanted it to where if the target has more than 300K HP, it would only cast flame. If the target HP was between 70K and 300K, it would do my normal skills use, and if the target HP is below 70K, then it would NOT cast a flame. I couldn't seem to get this to work. Also, I wanted to add a check so it doesn't change the setting from true to true but I couldn't figure out how to check the current setting of a skill's autouse.