5.4.7 版本 Automacro经典版
本插件为有lua编程能力,或不习惯全自动操作的玩家设计
更新了toc文件,不需要"加载过期插件"了.
使用说明:
在宏命令的第一行先写/am
接下来即可在宏中使用/if /else /end 进行判断
例:
/am
/if UnitHealth("player")<400000
/cast 盾墙
/else
/cast XXX
/end
你也以打开AM_CustomFunctions.lua编写自己的函数,用于节省宏的字数或者进行复合判断
例: 这是自带的函数, 用于判断目标是否处于可打断状态
function UnitC(target)
local notInterruptible
local spellName
if UnitChannelInfo(target) then
notInterruptible = select(8,UnitChannelInfo(target))
spellName = UnitChannelInfo(target)
else
if UnitCastingInfo(target) then
notInterruptible = select(9,UnitCastingInfo(target))
spellName = UnitCastingInfo(target)
else
return false
end
end
return true
end
参考资料:
wow API
http://wowprogramming.com/docs/api
包含所有wow中的api, 如UnitHealth,UnitName等等 可以获取wow中几乎所有信息. -----这是Automacro的核心部分,不需要修改!------
local default = CreateFrame("Frame", "AutoM", UIParent)
default:Hide()
default:SetScript("OnKeyUp", function(self, key) print(key) end)
function AM_AM(msg)
if msg then
macrobody = GetMacroBody(GetRunningMacro())
StopMacro()
--print(script)-- Debug
--print(ConvertMacroToScript(macrobody))
RunScript(ConvertMacroToScript(macrobody))
end
end
function ConvertMacroToScript(macrobody)
if macrobody==nil then return end;
macrobody = gsub(macrobody,"/am","")
macrolist = strsplit("\n",macrobody)
local count = select(2,gsub(macrobody,"\n","\n"))
local macrolist ={}
for i=1,count+1 do
macrolist = select(i,strsplit("\n",macrobody))
end
local script = ""
for i=1,count+1 do
if strsub(macrolist,1,5)=="/run " then
local sub_script= gsub(macrolist,"/run ","")
script = script .. sub_script .."\n"
else
if strsub(macrolist,1,4)=="/if " then
local condition= gsub(macrolist,"/if ","")
script = script .. "if " .. condition.." then\n"
else
if strsub(macrolist,1,6)=="/else" then
script = script .. "else\n"
else
if strsub(macrolist,1,5)=="/end" then
script = script .. "end\n"
else
ifmacrolist~="\n" and macrolist~=" " then
script = script .. "RunMacroText\(\""..macrolist.."\"\)\n"
end
end
end
end
end
end
return script
end
SlashCmdList["AM"]=AM_AM;
SLASH_AM1="/am";我用的这个AM_Core.lua,就正常了。/click ActionButton 也可以使用!
小_红_猫 发表于 2014-3-23 16:04
动作会出错,可能是因为 /替换成换行符的错误造成的。
是的,但应该不是换行符的问题
/click ActionButton1
这样的宏运行起来和正常的宏不一样,没法运行
应该是新解锁器原理的问题,/click比其他宏命令会多调用一次保护函数(多一个click)原来旧的解锁器是因为解锁了全部函数所以没问题。
解决方法是我下次更新的时候把actionbutton相关函数也解锁,但不一定有必要(/click用途不大) 碟中谍 发表于 2014-3-23 23:18
是的,但应该不是换行符的问题
/click ActionButton1
这样的宏运行起来和正常的宏不一样,没法运行
:funk:那我就不太懂了,我就看见你hook了5处。你那解锁器蛮好。。。不太懂。 这个可以有,支持automarcro,呵呵。。 蛮好支持下。 也需要解锁哇??? 本帖最后由 zhmixio 于 2014-3-19 17:33 编辑
要解锁,不然用不了!谢谢大大! zs342991709 发表于 2014-3-19 17:22
也需要解锁哇???
要解!不然用不了! zhmixio 发表于 2014-3-19 17:32
要解!不然用不了!
哦哦哦~~ 谢谢老大 试了一天,目前发现某些指令会出现报错。例如动作条之类的,直接WOW.exe报错!
还在测试中!:lol 又是强力的武器