看板 WOW 關於我們 聯絡資訊
※ 引述《OAzenO (すご-い!)》之銘言: : 如題 : 如何取得現在的日期? : 其實是因為每天都有人問何時煮湯 : 想要寫個巨集一鍵回答 : 但要想辦法取得星期 : 查到的這個不能用 : weekday, month, day, year = CalendarGetDate(); : 或許是我不會用 : 總是出錯 : 有沒有巨集大師能解決出來? : 順帶一提 : hours,minutes = GetGameTime(); : 現在時間的這個能用 : 只是感覺回傳的時間分鐘似乎跟實際時間有半分鐘到一分鐘左右的落差 : 參考: https://wowwiki-archive.fandom.com/wiki/World_of_Warcraft_API 巴哈有高手指點 完成了巨集 首先先把每天時間表定義進變數 /run mo="01:30,05:00,08:30,12:00,15:30,19:00,22:30"; tu="02:00,05:30,09:00,12:30,16:00,19:30,23:00"; we="02:30,06:00,09:30,13:00,16:30,20:00,23:30"; th="03:00,06:30,10:00,13:30,17:00,20:30,24:00"; /run fr="00:00,03:30,07:00,10:30,14:00,17:30,21:00"; sa="00:30,04:00,07:30,11:00,14:30,18:00,21:30"; su="01:00,04:30,08:00,11:30,15:00,18:30,22:00"; 然後取得今天星期幾 /run d = C_DateAndTime.GetCurrentCalendarTime(); wd = CALENDAR_WEEKDAY_NAMES[d.weekday]; 最後就可以判斷是星期幾 貼星期幾的時間表出來 /run if wd=="星期一" then tt=mo elseif wd=="星期二" then tt=tu elseif wd=="星期三" then tt=we elseif wd=="星期四" then tt=th elseif wd=="星期五" then tt=fr elseif wd=="星期六" then tt=sa else tt=su end; /run SendChatMessage( (format("巨集-煮湯時間- %s %s ", wd,tt )) ,"Say") 不過現在已變無用了 因為煮湯時間已改為1.5小時一次 我難過 Ref: https://wowpedia.fandom.com/wiki/API_C_DateAndTime.GetCurrentCalendarTime -- _ | ◢=▂▃▂ ◤▂ ▂◥ ▂≡▂ ー○-○- 竜が我が敵を喰らう! | 龍神の剣を喰え! /"Δ /\ ~胡適 | ~愛因斯坦 ψ \ \◥ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.38.97.14 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/WOW/M.1675779647.A.6C6.html
gagoga: 哭哭 02/08 01:08
wayne2002323: 這需求用wa更容易實現 何苦為難自己腦袋瓜 02/08 02:31