[Foreach] Pet

[复制链接]
发表于 5 天前 | 显示全部楼层 |阅读模式

Pet
Foreach.Pet(PetFunction)
函数功能
对所有在线宠物执行指定函数(PetFunction)。

参数说明
PetFunction: 函数型 可执行的lua函数。
返回值
执行成功的次数。 -1为参数错误。

PetFunction(CharIndex)
参数说明
CharIndex: 数值型 宠物对象Index。
返回值


参考实例
-- 定义一个PetFunction
function MyForeachPet(CharIndex)
  print("MyForeachPet: "..CharIndex.." called"..Char.GetData(CharIndex, %對象_CDK%))
  return 0
end

Foreach.Pet(MyForeachPet); -- 对所有在线宠物批量执行PetFunction
回复

使用道具 举报

快速回复 返回顶部 返回列表