local frame=CreateFrame("Frame") --来个框架接收
frame:RegisterEvent("CHAT_MSG_WHISPER")--注册密语事件
frame:SetScript("OnEvent",function(self,event,...)--事件发生触发函数
if event == "CHAT_MSG_WHISPER" then--事件是密语
xx
end
end)
原来是我弄复杂了 直接根据玩家是否在副本的API判定就行了宏版本
/run F=F or CreateFrame("Frame")F:RegisterEvent("ZONE_CHANGED_NEW_AREA") if I then print("关闭重置") I=nil else print("开启重置")I = function() if IsInInstance()~=1 then ResetInstances() SendChatMessage(".instance unbind all") end end end F:SetScript("OnEvent",I)
lua版本
[Lua] 纯文本查看复制代码
if IsInInstance() ~= 1 then
ResetInstances()
SendChatMessage(".instance unbind all") --GM命令 如无权限可删除
end