View Single Post
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: 27
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