Page 1 of 1

Remove buff

Posted: Tue Aug 28, 2012 4:50 pm
by romaniac
In the game you can remove some buffs by right-clicking on the icon next to the minimap.

Can you do this for a certain buff with the bot?

Re: Remove buff

Posted: Tue Aug 28, 2012 7:17 pm
by lisa
I thought there was a removebuff function but I can't find it.

Anyway you are looking at something like this
using the buff ID of the buff

Code: Select all

mybuff = player:getBuff(ID)
		for index, buff in pairs(player.Buffs) do
			if string.find(mybuff.Name,buff.Name,1, true) then
				sendMacro("CancelPlayerBuff("..index..");")
				return
			end
		end
getBuff() does an updateBuffs() so no need to do it again afterwards.

Re: Remove buff

Posted: Wed Oct 24, 2012 10:23 am
by gloover
Hey lisa,

do you know how to get the buff-remaining time?

player:hasBuff("Buffname") can only print true or false - is it possible to get the buff remaining time?

thx in advance!

Re: Remove buff

Posted: Wed Oct 24, 2012 11:05 am
by rock5
The bot doesn't have a way to get the time left on a buff, it has no use for it. You would have to use the in game functions. Probably a combination of the "list buffs" macro that is floating around and the UnitBuffLeftTime function. So something like

Code: Select all

RoMScript("} local i=1 while UnitBuff( \"player\", i) ~= nil do if UnitBuff( \"player\", i) == \""..name.."\" then a = {UnitBuffLeftTime(\"player\",i)} break end i = i + 1 end z={")
Where 'name' is a variable that holds the buff name.

Re: Remove buff

Posted: Wed Oct 24, 2012 11:16 am
by gloover
thx rock. Have found an elegant solution in combination with lisas buff index checking:

Code: Select all

lefttime=RoMScript("GetPlayerBuffLeftTime(GetPlayerBuff("..index..", 'HELPFUL'))");
thx again!

Re: Remove buff

Posted: Thu Oct 20, 2016 2:40 pm
by beanybabe
I tried using waypoint that uses the remove buff from lisa but it is not clearing the buff. This should clear the frog maid buff "Princely Look", can anyone see what is wrong.

Code: Select all

	function CancleBuff()
		player:update()
		mybuff = player:getBuff(506685)
		for index, buff in pairs(player.Buffs) do
			if string.find(mybuff.Name,buff.Name,1, true) then
				sendMacro("CancelPlayerBuff("..index..");")
				return
			end
		end
	end