Skip to content

Commit

Permalink
use a set for lowbid seen and fix the whisper
Browse files Browse the repository at this point in the history
  • Loading branch information
mooreatv committed Aug 7, 2020
1 parent 4f6da59 commit caba7af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions AuctionDB/AuctionDB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ ADB.buyoutProfit = 48 -- 48 copper
ADB.bidProfit = 78 -- 78 copper
ADB.lowBid = 10 -- display low bids on items without vendor price
ADB.lowBidTime = 3 -- only 30,2h,8h for low bids
ADB.lastLowBid = nil -- avoid spamming for hundreds of same
ADB.seenLowBid = {} -- avoid spamming for hundreds of same

-- ADB.sendTo = "OFFICER"

Expand Down Expand Up @@ -230,15 +230,15 @@ function ADB:checkAuction(timeLeft, itemCount, minBid, buyoutPrice, bidAmount, m
return
end
if vendorUnitPrice == 0 and bid < ADB.lowBid and not ourBid and timeLeft <= ADB.lowBidTime then
if itemLink == ADB.lastLowBid then
if ADB.seenLowBid[itemLink] then
ADB:Debug(2, "repeated lowbid on " .. itemLink)
return
end
ADB.lastLowBid = itemLink
ADB.seenLowBid[itemLink] = true
ADB:PrintDefault("AHDB: |cFF8742f5Low bid|r Auction " .. itemLink .. "x% bid " .. GetCoinTextureString(bid), itemCount)
-- Send to sendTo -- GetCoinText
if ADB.sendTo then
local tmsg = ADB:format("AHDB: Low bid Auction " .. itemLink .. "x% bid " .. GetCoinText(bid) .. " < vendor by ", itemCount)
local tmsg = ADB:format("AHDB: Low bid Auction " .. itemLink .. "x% bid " .. GetCoinText(bid), itemCount)
SendChatMessage(tmsg, ADB.sendTo)
end
end
Expand Down Expand Up @@ -402,6 +402,7 @@ function ADB:MaybeStartScan(msg, nowarning)
end

function ADB:AHendOfScanCB()
ADB.seenLowBid = {}
if ADB.autoSave then
-- C_UI.Reload()
ADB:Execute("/reload", L["Save the scan data to SavedVariables"], true)
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Coming next:
- Your input/suggestions welcome !
- See open issues for ideas https://github.com/mooreatv/AuctionDB/issues

v1.03.01 Aug 8th 2020
- Misc dev mode improvements: Seen filter for lowbid is now a set and corrected whisper message.

v1.03.00 July 24th 2020
- Auction Item Database schema v5, now contains itemSellPrice, itemStackCount, itemClassID,
itemSubClassID, itemRarity, itemMinLevel prefix before the link (MoLib change)
Expand Down

0 comments on commit caba7af

Please sign in to comment.