LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 1505|回复: 0

[其他] 求大神相助

[复制链接]
发表于 2016-12-23 01:26:16 | 显示全部楼层 |阅读模式
各位大大们

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'
[string "RunMacroText("")..."]:2: in main chunk
[C]: 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>
[C]: in function `UseAction'
Interface\FrameXML\SecureTemplates.lua:346: in function `handler'
Interface\FrameXML\SecureTemplates.lua:619: in function `SecureActionButton_OnClick'
[string "*:OnClick"]:2: in function <[string "*:OnClick"]:1>
Locals: level = 1
msg = "W_BuffTime:29166.925->4.9789999999994"
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to compare nil with number"


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2024-5-19 10:52 PM , Processed in 0.033913 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表