国内2.0久久不发布,无聊中学习了些魔兽宏的编写。将网上流传的dly宏整理了一下,验证可用后,贴出来供广大玩家参考。 由于wow自带的宏有256字数限制,我使用了supermacro进行了扩展,使其支持7000字的超大宏,这样就可以编写自己的个性宏。 下面是一些编写宏的公共函数,将其添加到supermacro的lua区即可。--施放魔法,检查魔法值
--锁敌function TE() if UnitName("target") == nil or UnitIsDead("target") then TargetNearestEnemy() elseif UnitIsFriend("player","target") then if UnitCanAssist("player","target") then AssistUnit("target") else TargetNearestEnemy() end endendfunction C(s,m) if m==nil or UnitMana("player")>=m then CastSpellByName(s) endend--检查目标的减益魔法function BU(s,p)if p==nil then p="target"endfor i=1,16 do f=UnitDebuff(p,i)--SendChatMessage(f) if f then if string.find(f,s) then return true end else return false endendreturn falseend--检查目标的增益魔法function B(s,p)if p==nil then p="target"endfor i=1,16 do f=UnitBuff(p,i)--SendChatMessage(f) if f then if strfind(f,s) then return true end else return false endendreturn falseend--检查能量点function CP(s,m,e) if GetComboPoints()>=e and UnitMana("player")>=m then CastSpellByName(s) endend--精灵之火function FA() if not BU("Faerie") then C("精灵之火") endend--猛虎之怒function TG() if not B("猛虎之怒","player") then C("猛虎之怒",30) endend 接下来的是一些实用宏,将他们也添加到lua的公共代码区即可。--根据目标的等级释放野性印记function yexing() l={1,10,20,30,40,50,60} t=UnitLevel("target") for j=7,1,-1 do if (t>=l[j]-10) then CastSpellByName("野性印记(等级 "..j..")") break end endend--根据目标的等级释放荆棘function jingji() l={6,14,24,34,44,54} t=UnitLevel("target") for j=6,1,-1 do if (t>=l[j]-10) then CastSpellByName("荆棘术(等级 "..j..")") break end endend--判断玩家身上的已有buff决定释放哪种bufffunction buff()--野性印记 if B("Regeneration") == false then yexing()--荆棘光环 elseif B("Thorns") == false then jingji() endend--释放愤怒之前判断目标是否有减益魔法,没有则释放之function fenlu() if not BU("StarFall") then C("月火术(等级 10)") elseif not BU("FaerieFire") then C("精灵之火(等级 4)") else C("愤怒(等级 8)") endend--给目标上dotfunction dot() if BU("StarFall") == false then C("月火术(等级 10)") elseif BU("FaerieFire") == false then C("精灵之火(等级 4)") --elseif BU("虫群") == false then --C("虫群") endend
--猫形态攻击function catAttack() TE() CP("凶猛撕咬",35,5) if not BU("GhoulFrenzy") then CP("撕扯",30,4) end if not BU("Disembowel") then C("扫击",40) end --C("畏缩",60) C("爪击",45) TG() if(not PlayerFrame.inCombat) then C("攻击") endend--猫形态背刺function beici() TE() if B("Ambush","player") then C("毁灭",60) else C("撕碎",60) endend--猫形态偷袭function touxi() TE() if B("Ambush","player") then C("突袭",50) else C("撕碎",60) endend--熊形态攻击function bearAttack() TE() if not BU("Physical") then C("低吼") end if not BU("Demoralizing") then C("挫志咆哮",10) end C("槌击",10) if(not PlayerFrame.inCombat) then C("攻击") endend 使用方法,新建一个宏,调用相应的函数即可例如:创建一个给目标上dot的宏,只用新建一个宏,添加如下代码:/script dot() 关于宏的编制,大家有什么好的想法可以讨论下。献丑了,呵呵。附件中有supermacro,解压后添加到addons下就可以了。里面没有可执行文件,怕有木马的朋友可以自己去信任的网站下载这个插件。 (不好意思,不会添加附件)