Page 1 of 1
Rogue Poison
Posted: Wed Aug 24, 2011 3:15 pm
by Dsanchez
If you're playing a rogue and run out of poison the bot will keep trying to apply poisons resulting in it walking a few inches to the next waypoint and stopping over and over. Would it be possible to stop trying to cast the buff if you run out of poisons?
Thanks
Re: Rogue Poison
Posted: Wed Aug 24, 2011 8:25 pm
by rock5
You could check your inventory before the skill is cast. Try adding this to your onPreCast section of your profile. Add it if it doesn't already exist.
Code: Select all
<onPreSkillCast>
if player.Class1 == CLASS_ROGUE then
if arg1.Name == "ROGUE_POISON" and inventory:itemTotalCount("Poison Bottle") == 0 then
return false
end
end
return true
</onPreSkillCast>
Re: Rogue Poison
Posted: Thu Aug 25, 2011 8:58 am
by Mushroomstamp
I have two questions about this;
Bot should only attempt to cast Poison if the character is a Rogue, so why bother with the class check?
And
Why the "return true" at the end when I thought it automatically returns true?
Re: Rogue Poison
Posted: Thu Aug 25, 2011 10:04 am
by rock5
Mushroomstamp wrote:Bot should only attempt to cast Poison if the character is a Rogue, so why bother with the class check?
Um... Good point. I guess I'm used to using that in other sections where it's needed.
Leave that out.
Mushroomstamp wrote:Why the "return true" at the end when I thought it automatically returns true?
I think you're right. I just wasn't 100% sure and was bein thorough. I don't make use of onprecastskill so I'm not used to it.
You can leave that out too.