From ac4983687daaa6b14c9124253096bd09eebc63db Mon Sep 17 00:00:00 2001 From: ackis Date: Tue, 16 Jun 2009 19:53:24 +0000 Subject: [PATCH] Convert the PrintScanResults into using a table to store output and returning the table.concat of it. --- ARLDatamine.lua | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ARLDatamine.lua b/ARLDatamine.lua index 7aaf50e..8ecaef9 100644 --- a/ARLDatamine.lua +++ b/ARLDatamine.lua @@ -2401,7 +2401,7 @@ function addon:TooltipScanRecipe(spellid, is_vendor) self:Print("Item ID: " .. itemid .. " not in cache. If you have Querier use /iq " .. itemid) end end - self:PrintScanResults() + self:Print(self:PrintScanResults()) end -- Lets hide this output for runeforging. @@ -2797,9 +2797,11 @@ do -- Parse the recipe database until we get a match on the name local recipe_name = gsub(scan_data.match_name, "%a+%?: ", "") local spellid = scan_data.reverse_lookup[recipe_name] + -- Output table + local t = {} if (not spellid) then - self:Print("Recipe "..recipe_name.." has no reverse lookup") + self:Print("Recipe " .. recipe_name .. " has no reverse lookup") return end @@ -2807,8 +2809,8 @@ do twipe(missing_flags) twipe(extra_flags) - if scan_data.specialty then - self:Print(GetSpellInfo(scan_data.specialty)) + if (scan_data.specialty) then + tinsert(t,"Recipe " .. recipe_name .. " Specialty: " .. scan_data.specialty) end if scan_data.is_vendor then @@ -2912,14 +2914,14 @@ do end if (#missing_flags > 0) or (#extra_flags > 0) then - self:Print(recipe_name .. " - " .. spellid) + tinsert(t,recipe_name .. " - " .. spellid) if (#missing_flags > 0) then - self:Print("Missing flags: " .. tconcat(missing_flags, ", ")) + tinsert(t,"Missing flags: " .. tconcat(missing_flags, ", ")) end if (#extra_flags > 0) then - self:Print("Extra flags: " .. tconcat(extra_flags, ", ")) + tinsert(t,"Extra flags: " .. tconcat(extra_flags, ", ")) end local count = 0 @@ -2931,20 +2933,22 @@ do end if count == 0 then - self:Print("Missing: item type flag") + tinsert(t,"Missing: item type flag") elseif count > 1 then - self:Print("Extra: item type flag") + tinsert(t,"Extra: item type flag") end end if (not flags[1]) and (not flags[2]) then - self:Print("Horde or alliance not selected - " .. spellid) + tinsert(t,"Horde or alliance not selected - " .. spellid) end if (not scan_data.tank) and (not scan_data.healer) and (not scan_data.caster) and (not scan_data.dps) then - self:Print("No player role flag - " .. spellid) + tinsert(t,"No player role flag - " .. spellid) end + return tcontact(t,"\n") + end end -- 1.7.9.5