< 魔兽世界百科 >
|
![]() |
/script b=0;c=0;while(b<12)do a=GetPlayerBuffTimeLeft(b);if(a~=0) then c=c+1; end;b=b+1;end;SendChatMessage(c, "say");
可输出当前所有增益魔法的完整名字
/script
b=0;//增益魔法总长度
c=0;//先有增益魔法个数
while(b<12)do
a=GetPlayerBuffTimeLeft(b);//如果当前增益魔法有的话就返回时间,没有的话返回0
if(a~=0) //返回不等于0时记数器加1.就是有增益魔法
then
c=c+1;
end;
b=b+1;
end;
SendChatMessage(c, "say");
增益魔法位置排序[4][3][2][1]
此函数可修正
/script if (not string.find(UnitBuff("player", 1), "Mon")) then CastSpellByName("Aspect of the Monkey"); end
/script if (not PlayerFrame.inCombat) then CastSpellByName("Attack"); end
函数UnitBuff("player", 1)中的参数1需要循环 否则在增加增益魔法时会定位不准
函数string.find(UnitBuff("player", 1), "Mon")mon是技能名称 目前还只支持英文 英文技名使用时可能要去除中间空格 完整名字获得可用最上面的那句
例子:
/script c=1;while(c<=z(c))do if (not string.find(UnitBuff("player",c), "Fortitude")) then CastSpellByName("真言术:韧(等级 2)");elseif (not string.find(UnitBuff("player",c), "InnerFire")) then CastSpellByName("心灵之火(等级 2)");end;c=c+1;end
/script z=function() c=0;b=0;while(b<12)do a=GetPlayerBuffTimeLeft(b);if(a~=0) then c=c+1; end;b=b+1;end;return c;end
引用本页地址(点击复制到粘贴板) 粘贴到你想引用的网页。
HTML形式的传播:
论坛形式的传播: