【amcount】小队或者团队里符合条件的人物信息数量
amcount小队或者团队里符合条件的人物信息数量
语法
count ,Unit= amcount(String,StrReturn,group);
参数
String
字符串 - 字符串关系表达式,以下是函数里的变量值
name - 人物名称
class - 职业
race - 种族
spell - 正在施放的法术名称
unit - 人物 UnitID
spellcd - 正在施放的法术剩余时间
guid - 人物 Guid
注:String 可以有任何函数和变量出现
StrReturn
字符串 - 字符串表达式
group
字符串 - 指定获得数值的团/队
"party" - 小队
"partypet" - 小队宠物
"raid" - 团队
"raidpet" - 团队宠物
"arena" - 竞技场敌人小队
"arenapet" - 竞技场敌人小队宠物
返回值
当 String 表达式 的结果为 true 时
count 返回 整数值合计数,反之返回 0。
Unit 返回 最后一个符合条件的人物Unit。
备注
参数区分大小写
请参考
Unit 详细请看Unit的说明
例子1:
[*]local n = amcount('amisr("旋风斩",unit)',"amjl(unit)<=5","arena")
[*]
[*]if n>=3 then
[*]amrun("/CAST 旋风斩")
[*]end
当你5码之内有大于3个敌人时用旋风斩。
例子2:
[*]local n,Unit = amcount('amisr("治疗之环",unit)',"aml(unit,'%')<90 and not UnitIsDeadOrGhost(unit)","raid")
[*]if n >1 and amisr("治疗之环",Unit) then
[*]amrun("治疗之环",Unit);
[*]return;
[*]end
当目标血少于90%并且可以对其使用治疗之环,的目标大于1个以上使用。
页:
[1]