Quantcast

Added debug command

Kevin Lyles [10-08-11 - 16:56]
Added debug command
Filename
ItemScanner.lua
diff --git a/ItemScanner.lua b/ItemScanner.lua
index 72ffa1e..00ee536 100644
--- a/ItemScanner.lua
+++ b/ItemScanner.lua
@@ -242,7 +242,22 @@ local function itemParseCoroutine(start, tooltip, threadNumber)
 end

 local function commandHandler(msg)
-	if string.match(msg, "^items") then
+	if string.match(msg, "^debug") then
+		if IS_status.items.scan_active then
+			if IS_status.items.finished then
+				print("Scanning all items with " .. #(frame.itemco) .. " threads")
+			else
+				print("Scanning known valid items with " .. #(frame.itemco) .. " threads")
+			end
+			print("Last item: " .. tostring(IS_status.items.last_scanned or "none"))
+			local currentTime = GetTime()
+			print("roundTime = " .. tostring(currentTime - roundStartTime))
+			print("elapsedTime = " .. tostring(currentTime - startTime))
+		else
+			print("Scanning not active")
+			return
+		end
+	elseif string.match(msg, "^items") then
 		local start

 		if msg == "items" or msg == "items start" then
@@ -296,6 +311,7 @@ local function commandHandler(msg)
 		frame:SetScript("OnUpdate", OnUpdate)
 	else
 		print("Usage: /is <arg> (or /itemscanner <arg>")
+		print("  debug       prints scanning status")
 		print("  items       scans all items")
 	end
 end