Daily Quest Script/Macro

I recently came across an amazingly helpful script on Wowhead in order to check which dailies/world quests are up in a particular zone (Korthia, in this example):

/script for i,t in ipairs(C_TaskQuest.GetQuestsForPlayerByMapID(1961)) do print("Korthia Daily: " … C_QuestLog.GetTitleForQuestID(t.questId)) end

It got me thinking about its general usefulness across the game. I’ve tried basic tinkering (I’m not very skilled at creating lua, only basic common sense modifications to existing code) to try and get it to post the quests for multiple zones at once, but adding a second MapID only returns the quests for the first map listed. And when trying to make a macro that would run the script for each zone separately one after the other, only the first script returns results while also throwing a lua error.

My question is if there actually is such a way to enable the script to return results for multiple zones at once…as in, show me the dailies for Korthia, Zereth Mortis and Revendreth.

Even better, is there a script that would return results for multiple specific quests? Such as…tell me if Oozing with Character is up in Korthia, Muck it Up is up in Revendreth, and/or Cluck, Cluck, Boom is up in Zereth Mortis.

This will run your macro for multiple zones, replace 2022,2023,etc with a list of mapIDs (these are Dragonflight which I had on hand):

/run for _,m in ipairs({2022,2023,2024,2025}) do for i,t in ipairs(C_TaskQuest.GetQuestsForPlayerByMapID(m)) do print(C_Map.GetMapInfo(m).name,C_QuestLog.GetTitleForQuestID(t.questId)) end end

This is amazing and works perfectly. Thank you!!

I was disappointed to see this is not working for me. I tried the script in the original post for one zone, as well as the update you provided to work for multiple zones, and nothing happens at all. I’ve pasted it right in the chat box and also tried CopyPasta add-on with no luck.
Any advice?