检查是否挖矿魔兽世界
我如何检查玩家是否正在魔兽世界中采矿,然后在采矿完成后铸造坐骑?
How would I check if the player is mining in World of Warcraft and then cast a mount once mining is complete?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要确定角色是否正在挖矿,请收听 UNIT_SPELLCAST_START 和
UNIT_SPELLCAST_SUCCEEDED
/UNIT_SPELLCAST_FAILED
事件。检查unitID ==player
和spellID==miningSpellId
(有几个,每个等级一个,所以你可能需要考虑使用法术名称)。但是,一旦采矿完成,您就无法自动铸造坐骑,因为采矿是通过单击插件无法访问的世界对象(即采矿节点)来初始化的。您可以使用 SecureActionButtonTemplate 按钮来获取硬件事件并投射坐骑,但将其链接到挖掘操作应该超出范围。
To figure out if a character is mining, listen to the UNIT_SPELLCAST_START and
UNIT_SPELLCAST_SUCCEEDED
/UNIT_SPELLCAST_FAILED
events. Check thatunitID == player
andspellID == miningSpellId
(there are several, one for each rank, so you might want to consider using the spell name instead).However, you cannot automatically cast a mount once your mining is finished, as mining is initialized by clicking a world object (i.e. the mining node) which is out of reach for addons. You could use a SecureActionButtonTemplate button to grab your hardware event and cast a mount, but linking that to the action of mining should be out of scope.