Check for debuff; if present, wait until gone before proceed
Check for debuff; if present, wait until gone before proceed
There are some mobs that put a debuff that causes slips/falls (e.g. Lakaso in Weeping Coast). Having this debuff causes the bot to slip/fall while in battle which may interrupt attacks and even the use of items (e.g. healing pots). Is there a way to check for this debuff after a battle; if present after a battle, then wait before proceeding?
Re: Check for debuff; if present, wait until gone before pro
Nevermind. Found this other post. Thanks anyways.
edit:
Actually, I tried the code in the linked post,
but if another mob attacks while in the check for debuffs, the bot does not fight back The bot seems to be stuck in debuff check loop. Am I missing something?
edit:
Actually, I tried the code in the linked post,
Code: Select all
local debuff = RoMScript("GetPlayerBuffLeftTime(GetPlayerBuff(1,'HARMFUL'))");
if(debuff == nil) then
debuff = 0;
end
while debuff ~= 0 do
printf("Debuff:%s\n", debuff);
yrest(1000);
debuff = 0;
debuff = RoMScript("GetPlayerBuffLeftTime(GetPlayerBuff(1,'HARMFUL'))");
if(debuff == nil) then
debuff = 0;
end
end
printf("No Debuff, lets resume\n");
Re: Check for debuff; if present, wait until gone before pro
I did some testing of GetPlayerBuff. No matter what values I used it always returned -1. I suspect this function has been disabled.ou81too wrote:Actually, I tried the code in the linked post, but if another mob attacks while in the check for debuffs, the bot does not fight back The bot seems to be stuck in debuff check loop. Am I missing something?
You could probably use "UnitDebuff()" but I can't test if it still works now because the servers are down.
If UnitBuff() and UnitDebuff() still work you also use the rombot equivilent.
Just run player:updateBuffs() then you can check if the variable player.Debuffs has any values. This, though, updates both buffs and debuffs so would be a bit slower.
A problem with that code, though, is it won't heal or apply buffs while it's waiting and probably wont fight back if attacked. It should probably call checkPotions() and checkSkills() in it's loop but an even better solution might be to use player:rest(). It fights back when attacked and uses potions and skills. Maybe you could use GetPlayerBuffLeftTime() then get player:rest() to rest that amount. Or maybe just use player:rest(300,300,"full"). That will basically rest after each battle until hp and mp are full before continuing.
Enough speculation, I'll try and help you with this after the servers come back.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Check for debuff; if present, wait until gone before pro
Ok, maybe you could try something like this
This should rest until all debuffs are gone, use potions and skills and fight back if attacked.
Code: Select all
<onLeaveCombat>
debuff = RoMScript("UnitDebuff('player',1)")
while debuff ~= nil do
player:rest(1)
debuff = RoMScript("UnitDebuff('player',1)")
end
printf("No Debuff, lets resume\n");
</onLeaveCombat>
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests