27 - Problems detecting recall point registration
When trying to detect registration of the recall point XBar relies on the chat message "SC_TRANSFER_SAVEHOME_MEG". Unfortunately in some cases the Message Runes of Magic prints to the chat does not match such a filter pattern, as there the Messages ST_TRANSFER_1 to ST_TRANSFER_18 are used and their contents do not fit the filter pattern. This results in recall point registrations not being detected at all, or wrong locations being extracted from the message, depending on the client language and its individual translations for ST_TRANSFER_1 to ST_TRANSFER_18. One of these situations is the recall point in front of Varanas' bridge in the german client.
Tearsofdarknes pointed out this failure here and I found some similar problems of these kind in my addon "Where's My Home?" too. I've created a fix for both addons, that stops trying to extract the location from the messages and just tries to detect any of the ones mentioned and uses the zone name in any case and not just as a fallback value. Feel free to use or edit it as you like.
Begin of file:
local locMsgList = { TEXT("ST_TRANSFER_1"), TEXT("ST_TRANSFER_10"), TEXT("ST_TRANSFER_11"), TEXT("ST_TRANSFER_12"), TEXT("ST_TRANSFER_13"), TEXT("ST_TRANSFER_14"), TEXT("ST_TRANSFER_15"), TEXT("ST_TRANSFER_16"), TEXT("ST_TRANSFER_17"), TEXT("ST_TRANSFER_18"), TEXT("ST_TRANSFER_2"), TEXT("ST_TRANSFER_3"), TEXT("ST_TRANSFER_4"), TEXT("ST_TRANSFER_5"), TEXT("ST_TRANSFER_6"), TEXT("ST_TRANSFER_7"), TEXT("ST_TRANSFER_8"), TEXT("ST_TRANSFER_9"), TEXT("SC_SETRECORDPOINT"), TEXT("SC_TRANSFER_SAVEHOME_MEG"), } for i, locMsg in ipairs(locMsgList) do locMsgList[i] = locMsg:gsub("%b<>", "%%s"):gsub("%b[]", "%%s"):gsub("%%.", ".*") end
Eventhandler:
if event=="CHAT_MSG_SYSTEM" then if string.find(arg1, TEXT("QUEST_MSG_GET"):format("(.*)")) or string.find(arg1, TEXT("QUEST_MSG_CONDITION_FINISHED"):format("(.*)")) then Quest() elseif string.find(arg1:gsub("%d", "1"), TEXT("QUEST_MSG_DAILYGROUP_COMPLETE"):format("(.*)", 1, "(.*)")) or string.find(arg1, TEXT("QUEST_MSG_DAILYGROUP_DONE"):format("(.*)", "(.*)")) or string.find(arg1, TEXT("QUEST_MSG_DAILY_COMPLETE"):format("(.*)")) or string.find(arg1, TEXT("QUEST_MSG_DAILYRESET")) then Daily() elseif string.find(arg1, TEXT("QUEST_MSG_FINISHED"):format("(.*)")) then Quest() Chars["CQuest"] = Chars["CQuest"] + 1 else for i, locMsg in ipairs(locMsgList) do if string.find(arg1, locMsg) ~= nil then XBtnChars[UnitName("player")] = GetZoneName() or NONE break end end end end
| User | When | Change |
|---|---|---|
| Noguai | Aug 30, 2013 at 18:44 UTC | Create |