-
Member
why for i=1,#a do not working ?
local slowIDs = {
1715,
236027,
12323 ,
211793 }
function shouldslow(unit)
for i=1,#slowIDs do
local slowdebuff, _, _, _, _, _, slowdebuffExp = UnitDebuff(unit,slowIDs[i])
if slowdebuff and slowdebuffExp - GetTime() > 2
and not UnitDebuff(unit,135299)
then
return false
else
return true
end
end
end
why it aways return true...
Last edited by wowmacro; 06-01-2017 at 06:14 PM.
-
Code:
function isSlowed()
local slow={
6343,
183218,
205273,
204242,
5116,
194279,
}
for i=1,#slow do
if(UnitBuff("target",slow[i])) then
return true
end
end
end
It should work? what errors do you get?
-
Post Thanks / Like - 1 Thanks
bynike (1 members gave Thanks to ev0 for this useful post)
-
Member
function isSlowed()
local slow={
6343,
183218,
205273,
204242,
5116,
194279,
}
for i=1,#slow do
if(UnitBuff("target",slow[i])) then
return true
end
end
end
test with my pally. /run if isSlowed() == true then print("1") end
no error. but it will not return true...and I changed the lua. it aways return true.
Last edited by wowmacro; 06-02-2017 at 02:36 AM.
-
Originally Posted by
wowmacro
function isSlowed()
local slow={
6343,
183218,
205273,
204242,
5116,
194279,
}
for i=1,#slow do
if(UnitBuff("target",slow[i])) then
return true
end
end
end
test with my pally. /run if isSlowed() == true then print("1") end
no error. but it will not return true...and I changed the lua. it aways return true.
let's throw a few more checks/boolean in there. I'll work on this tonight with you (shoot me a PM on discord - Discord)
-
Member
not idea why i cant pm u
but I fix this lua with the following way..
for i=1,40 do local debuffid = select(11,UnitDebuff(unit,i))
for k=1,#slow do
if debuffid == slow[k]
then
XXXXXXXXX
end
end
end
but the old Lua was working in WOD 6.x
-
Contributor
Originally Posted by
wowmacro
local slowIDs = {
1715,
236027,
12323 ,
211793 }
function shouldslow(unit)
for i=1,#slowIDs do
local slowdebuff, _, _, _, _, _, slowdebuffExp = UnitDebuff(unit,slowIDs[i])
if slowdebuff and slowdebuffExp - GetTime() > 2
and not UnitDebuff(unit,135299)
then
return false
else
return true
end
end
end
why it aways return true...
# will use the index given so the first one is 6343 if you wanted to truly use the # you'd have to write it like this
local slow = { [1] = 6343, [2] = 183218,}
so on so forth.