From 3653889116a85c2ccc30b9bc53a07963d0bea38c Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Tue, 2 Feb 2010 23:00:44 -0600 Subject: [PATCH] Added a small wait loop for items that are still loading --- ItemScanner.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ItemScanner.lua b/ItemScanner.lua index 465803a..e29efe2 100644 --- a/ItemScanner.lua +++ b/ItemScanner.lua @@ -1,6 +1,7 @@ local minItem, maxItem = 1, 99999 local CONSECUTIVE_INVALID_TO_IGNORE = 5 local VALID_DELAY = 0.025 +local INVALID_DELAY = 5 local function scanItemLink(link) local textL, textR @@ -9,8 +10,16 @@ local function scanItemLink(link) ItemScannerHiddenTooltip:ClearLines() ItemScannerHiddenTooltip:SetHyperlink(link) - if ItemScannerHiddenTooltipTextLeft1:GetText():find(RETRIEVING_ITEM_INFO) then - return false + local startTime = GetTime() + while ItemScannerHiddenTooltipTextLeft1:GetText():find(RETRIEVING_ITEM_INFO) do + coroutine.yield() + if GetTime() - startTime >= INVALID_DELAY then + -- If we got anything useful, keep it + if numLines > 1 then + break + end + return false + end end IS_item_info[link] = { -- 1.7.9.5