求大神相助
各位大大们AM_CustomFunctions中有两段代码,
function W_RetainBuff(UnitId, buffID, onlyMine)
return W_BuffTime(UnitId, buffID, onlyMine) > 2;
end
function W_BuffTime(UnitId, buffID, onlyMine)
local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = W_getBuff(UnitId, buffID, onlyMine);
if(name ~= nil)then
W_Log(1, "W_BuffTime:"..expirationTime..'->'..(expirationTime-GetTime()));
return expirationTime-GetTime();
end
return 0;
end
现在我想用这两段在wow中调用,实现冰DK的”冰冷之爪(194879)“BUFF覆盖
wow中宏的写法
/am
/if W_BuffTime(NA_Player, 194879, onlyMine)<2
/cast 冰霜打击
/end
或者
/if W_BuffTime(NA_Player, 194879, onlyMine)<2 and UnitBuff(NA_Player,"冰冷之爪")
/cast 冰霜打击
/end
但是使用的时候都会报错,不知道是哪里的问题,请大大指点:'(
错误如下
Message: ...rface\AddOns\AutomacroClassic\AM_CustomFunctions.lua:220: attempt to compare nil with number
Time: 12/23/16 01:23:03
Count: 2
Stack: ...rface\AddOns\AutomacroClassic\AM_CustomFunctions.lua:220: in function `W_Log'
...rface\AddOns\AutomacroClassic\AM_CustomFunctions.lua:378: in function `W_BuffTime'
:2: in main chunk
: in function `RunScript'
Interface\AddOns\AutomacroClassic\AM_Core.lua:10: in function `?'
Interface\FrameXML\ChatFrame.lua:4385: in function `ChatEdit_ParseText'
Interface\FrameXML\ChatFrame.lua:4053: in function `ChatEdit_SendText'
Interface\FrameXML\ChatFrame.lua:2660: in function <Interface\FrameXML\ChatFrame.lua:2653>
: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:346: in function `handler'
Interface\FrameXML\SecureTemplates.lua:619: in function `SecureActionButton_OnClick'
:2: in function <:1>
Locals: level = 1
msg = "W_BuffTime:29166.925->4.9789999999994"
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to compare nil with number"
页:
[1]