-
Banned
Need help with LUA Script in 2.4.3
Trying to use this script with 2.4.3 using EWT.
if not UnitBuff("player", "Seal of Righteousness") then CastSpellByName("Seal of Righteousness") end
Although this command works on 3.3.5, using it in 2.4.3 not only doesn't work, but also leads to this error.
[string "if not UnitBuff("player", "Seal of Righteou..."]:1:Usage: UnitBuff("unit" , index [,raidFilter])
-
Member
It doesn't seem like UnitBuff accepts buff name as second arguement in TBC.
You could use wrapper function:
Code:
function UnitBuffByName(unit, buffname)
local aura;
local i= 1
repeat
aura = UnitBuff(unit, i)
if aura == buffname then
return UnitBuff(unit, i)
-- return true -- would work as well, depends what you are trying to do
end
i = i +1
until aura == nil
end
-
Post Thanks / Like - 1 Thanks
-
Banned
Originally Posted by
CrazyCo
It doesn't seem like UnitBuff accepts buff name as second arguement in TBC.
You could use wrapper function:
Code:
function UnitBuffByName(unit, buffname)
local aura;
local i= 1
repeat
aura = UnitBuff(unit, i)
if aura == buffname then
return UnitBuff(unit, i)
-- return true -- would work as well, depends what you are trying to do
end
i = i +1
until aura == nil
end
Adding that along with
Code:
if not UnitBuffByName("player", "Seal of Righteousness") then CastSpellByName("Seal of Righteousness") end
did the trick.