[閒聊] 巨集函式有更新

看板WOW (魔獸世界)作者 (すご-い!)時間1月前 (2024/09/02 21:58), 1月前編輯推噓11(1109)
留言20則, 13人參與, 1月前最新討論串1/1
因為突然發現以前正常使用的巨集失效 /cast 太陽光束 /run s,d,e=GetSpellCooldown("太陽光束"); if (s>2 and d>2) then SendChatMessage("太陽光束CD中:"..SecondsToTime(s+d-GetTime()),ic); else SendChatMessage("對[%t]施放 <太陽光束>",ic); end 錯誤訊息寫 GetSpellCooldown 不動作了 查了一下發現11版又更新了函式 https://warcraft.wiki.gg/wiki/Patch_11.0.0/API_changes 雖然看不懂 但搜到了 reddit 這篇 https://reurl.cc/zDl75N 剛好解決了我的需求 簡而言之就是 GetSpellCooldown 更新為 C_Spell.GetSpellCooldown(spell) 回傳值用 C_Spell.GetSpellCooldown(spell).startTime C_Spell.GetSpellCooldown(spell).duration 所以把原本的巨集改成 (借助ChatGPT幫忙) /cast 太陽光束 /run cd = C_Spell.GetSpellCooldown("太陽光束"); SCM=SendChatMessage; if (cd.startTime > 0 and cd.duration > 2) then local rt = cd.startTime + cd.duration- GetTime(); SCM("光束CD:"..SecondsToTime(rt), "SAY"); else SCM("對[%t] <太陽光束>", "SAY") end; 實測可用 共勉之 (ChatGPT還真方便XD 對寫程式語法來說) == 編輯.精簡 229字元 記得接成一行 /cast 太陽光束 /run cd=C_Spell.GetSpellCooldown("太陽光束"); SCM=SendChatMessage; st=cd.startTime; dt=cd.duration; if (st > 0 and dt > 2) then SCM("太陽光束CD還有:"..SecondsToTime(st + dt - GetTime()), "SAY"); else SCM("對[%t] <太陽光束>", "SAY") end; -- _ | ◢=▂▃▂ ◤▂ ▂◥ ▂≡▂ ー○-○- 竜が我が敵を喰らう! | 龍神の剣を喰え! /"Δ /\ ~胡適 | ~愛因斯坦 ψ \ \◥ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.224.172.28 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/WOW/M.1725285518.A.66A.html

09/02 23:40, 1月前 , 1F
快推,不然別人以為我們看不懂XD
09/02 23:40, 1F

09/03 00:05, 1月前 , 2F
所以這個巨集是幹嘛的?斷法巨集嗎
09/03 00:05, 2F

09/03 00:08, 1月前 , 3F
施法成功用白頻:對XXX 太陽光束
09/03 00:08, 3F

09/03 00:10, 1月前 , 4F
施法失敗用白頻:光束CD:x (還有幾秒)
09/03 00:10, 4F

09/03 00:17, 1月前 , 5F
我可能誤會了,如果只是要判斷剩餘冷卻時間應該只要抓dur
09/03 00:17, 5F

09/03 00:17, 1月前 , 6F
ation就可以了?請問rt那段的目的是什麼
09/03 00:17, 6F

09/03 01:19, 1月前 , 7F
duration是技能完整的cd時間
09/03 01:19, 7F

09/03 02:52, 1月前 , 8F
超過255個字...
09/03 02:52, 8F

09/03 03:09, 1月前 , 9F
太多字最後一段可以不用把end移上去,也比較不洗畫面
09/03 03:09, 9F

09/03 12:02, 1月前 , 10F
應該有UI WA可以取代(?)
09/03 12:02, 10F

09/03 12:31, 1月前 , 11F
難怪我萬年沒更新的MSBT一直說GetSpellCooldown 這個錯誤
09/03 12:31, 11F

09/03 12:47, 1月前 , 12F
msbt不是更新了嗎
09/03 12:47, 12F

09/03 14:24, 1月前 , 13F
大聲巨集
09/03 14:24, 13F

09/03 15:13, 1月前 , 14F
他這個會白字喊話 比較偏向RSA這種ui
09/03 15:13, 14F

09/03 15:36, 1月前 , 15F
starttime是開始時間,duration CD, gettime是你電腦
09/03 15:36, 15F

09/03 15:36, 1月前 , 16F
時間,所以你回推一下就知道為什麼需要rt那段了
09/03 15:36, 16F

09/03 15:40, 1月前 , 17F
reurl.cc/yvYdjO 參考這篇你可以壓點字數
09/03 15:40, 17F

09/03 16:22, 1月前 , 18F
看來是我誤會文件寫的duration意思 原來是指完整CD
09/03 16:22, 18F

09/03 16:23, 1月前 , 19F
我看完文件以為是剩餘秒數XD 想說為啥要這麼複雜算rt
09/03 16:23, 19F

09/03 19:10, 1月前 , 20F
原來巴哈已經有討論文了 沒想到查巴哈XD
09/03 19:10, 20F
※ 編輯: OAzenO (61.224.172.28 臺灣), 09/03/2024 21:46:16
文章代碼(AID): #1crSIEPg (WOW)
文章代碼(AID): #1crSIEPg (WOW)