安之若泰 发表于 2024-4-3 17:29:19

求助大佬关于魔改F道具物品CD的问题

例如
if BeeSpellCD("/usd item:630001")==0 then
    BeeRun("/usd item:630001")
end

这样没有用呢。
道具物品名字是有颜色的也有一些杂乱的符号,用物品名字也没办法,物品ID也没办法。

请教大佬们,有什么办法能解决吗。

懒动行不行 发表于 2024-4-3 19:29:02

试试用startTime, duration, enable = GetItemCooldown(itemInfo)
iteminfo用物品的ID
local _,_,enable=GetItemCooldown(xxxx)
if enable==1 then BeeRun(xxx) end

安之若泰 发表于 2024-4-3 20:26:44

懒动行不行 发表于 2024-4-3 07:29 PM
试试用startTime, duration, enable = GetItemCooldown(itemInfo)
iteminfo用物品的ID
local _,_,enable= ...

感谢版主,感谢版主,感谢版主,!:victory:

安之若泰 发表于 2024-4-4 10:37:46

懒动行不行 发表于 2024-4-3 07:29 PM
试试用startTime, duration, enable = GetItemCooldown(itemInfo)
iteminfo用物品的ID
local _,_,enable= ...

local _,enable=GetItemCooldown(386010)
if enable>3 and enable<118 then
    BeeRun("/cast 恐惧")
end
版主,这个函数大于和小于没用吗?识别不了物品正在CD中。


local _,enable=GetItemCooldown(386010)
if enable==0 then
    BeeRun("/use item:386010")
end
只有这样才有用

懒动行不行 发表于 2024-4-4 16:38:15

enable
    number - 1 if the item is ready or on cooldown, 0 if the item is used, but the cooldown didn't start yet (e.g. potion in combat).
你试出来就行

安之若泰 发表于 2024-4-5 20:17:16

懒动行不行 发表于 2024-4-4 04:38 PM
enable
    number - 1 if the item is ready or on cooldown, 0 if the item is used, but the cooldown...

版主这段不怎么看得懂什么意思呢

懒动行不行 发表于 2024-4-5 21:08:24

安之若泰 发表于 2024-4-5 08:17 PM
版主这段不怎么看得懂什么意思呢

这句话的意思是当enable的值是1时,表示物品冷却已经结束,如果是0表示物品被使用了但是冷却还未开始,比如战斗中使用药水的情形

这个函数在WOW API网站的解释和335版本是不对应的,可能是高版本后,API的返回值发生了变化,你可以自己试下

根据我的实验结果,starttime和enable无论饰品是否使用,是否在冷却中,其值一直分别为nil和1,所以无法区分物品是否冷却
而duration倒是在冷却结束时,返回值是0,而冷却开始和冷却中值一直返回的是这个物品的冷却总时间
因此可以这样写
ocal _,duration=GetItemCooldown(xxxx)
if duration==0 then BeeRun(xxx) end

gaogaogao 发表于 2024-4-5 21:20:05

道具物品名字是有颜色的也有一些杂乱

安之若泰 发表于 2024-4-6 18:24:12

懒动行不行 发表于 2024-4-5 09:08 PM
这句话的意思是当enable的值是1时,表示物品冷却已经结束,如果是0表示物品被使用了但是冷却还未开始,比 ...

原来如此再次感谢版主,,回头我在去试试

公认坏人 发表于 2024-4-6 21:17:00

本帖最后由 公认坏人 于 2024-4-7 04:35 PM 编辑

local _,cd=GetItemCooldown(331005)
if cd==0 then BeeRun("/run UseItemByName('331005')") end

331005为物品ID
==0不行的话可以试下<0.1,<0.5之类的,有些魔改服战斗状态物品是不会正常CD转到0的,所以==0就不能识别。
页: [1] 2
查看完整版本: 求助大佬关于魔改F道具物品CD的问题