Quantcast objectives out of objectiveFullText - WoWInterface
Thread Tools Display Modes
07-09-18, 06:43 PM   #1
ebonyfaye
A Fallenroot Satyr
 
ebonyfaye's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 22
Thumbs down 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
  Reply With Quote
07-09-18, 07:06 PM   #2
dssd
A Fallenroot Satyr
Join Date: May 2016
Posts: 21
I think you'd be interested in the GetQuestObjectiveInfo function.

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

return numFulfilled .. "/" .. numRequired
  Reply With Quote
07-09-18, 07:34 PM   #3
ebonyfaye
A Fallenroot Satyr
 
ebonyfaye's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 22
Originally Posted by dssd View Post
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)
  Reply With Quote
07-09-18, 07:41 PM   #4
dssd
A Fallenroot Satyr
Join Date: May 2016
Posts: 21
I think you can set it to 0.
  Reply With Quote
07-09-18, 08:12 PM   #5
ebonyfaye
A Fallenroot Satyr
 
ebonyfaye's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2009
Posts: 22
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
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » objectives out of objectiveFullText

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off