WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   objectives out of objectiveFullText (https://www.wowinterface.com/forums/showthread.php?t=56347)

ebonyfaye 07-09-18 06:43 PM

objectives out of objectiveFullText
 
Hi,

so am taking objectiveFullText = GetQuestLogLeaderBoard(questID)

and i would like to remove the objective information off the quest EG: (0/1)

i been using

Code:

arg1, agr2 = string.match(text, "(.-%S)%s(.*)")
the problem is in some languages the objective information is at the end of the quest EG:

0/1 Kill Cat Boss
Kill Cat Boss: 0/1


I made this but it seems to be a bit to much and it will only work for quests with 0/4 at the start but at least it shows all the text on non English clients

Code:

        if text == nil then
                return L["N/A"], L["N/A"]
        end
        local makeString = nil
        local dig1, dig2 = string.match( text, "(%d*)/(%d*)")
        AJM:Print("test", dig1, dig2)
        if (dig1  and dig2) then
                local arg1, arg2 = string.match(text, "(.-%S)%s(.*)")
                AJM:Print("testm", arg1, "A", arg2)
                makeString = dig1..L["/"]..dig2
               
        end
        AJM:Print("test1", makeString, text)
        if makeString ~= nil then
               
                local arg1, arg2 = string.match(text, "(.-%S)%s(.*)")
                local textFind = string.find(arg1, "(%d*)")
                AJM:Print("text", textFind)
                if textFind then
                        return makeString, arg2
                else
                        return makeString, text
                end       
                       
        else
                return L["DONE"] , text
        end

thanks for any help

dssd 07-09-18 07:06 PM

I think you'd be interested in the GetQuestObjectiveInfo function.

local objectiveText, objectiveType, finished, numFulfilled, numRequired = GetQuestObjectiveInfo(questID, objectiveIndex)

return numFulfilled .. "/" .. numRequired

ebonyfaye 07-09-18 07:34 PM

Quote:

Originally Posted by dssd (Post 328587)
I think you'd be interested in the GetQuestObjectiveInfo function.

local objectiveText, objectiveType, finished, numFulfilled, numRequired = GetQuestObjectiveInfo(questID, objectiveIndex)

return numFulfilled .. "/" .. numRequired

what happens if i don't have the objectiveIndex though ( saying if someone in the party did not have x quest)

dssd 07-09-18 07:41 PM

I think you can set it to 0.

ebonyfaye 07-09-18 08:12 PM

Infact i do have objectiveIndex. A lot easyer using that. Now:

I need a way to remove the 0/1 text from the quest text be it at the front or end and olny that ( sorry tried) as if not my frame show column 1( 0/1 text ) column 2 ( 0/1 )

Thanks


All times are GMT -6. The time now is 11:25 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI