diff --git a/sell.lua b/sell.lua index 2350fb2..7e2550a 100644 --- a/sell.lua +++ b/sell.lua @@ -87,8 +87,8 @@ function Aux_AuctionsCreateAuctionButton_OnClick() if existingEntry.buyoutPrice == buyoutPrice and existingEntry.stackSize == stackSize then existingEntry.count = existingEntry.count + posted existingEntry.numYours = existingEntry.numYours + posted - existingEntry.duration = max(existingEntry.duration, duration) - newEntry = existingEntry + existingEntry.maxTimeLeft = max(existingEntry.maxTimeLeft, duration) + entry = existingEntry end end if not entry then @@ -101,6 +101,7 @@ function Aux_AuctionsCreateAuctionButton_OnClick() numYours = posted, } tinsert(auxSellEntries[name], entry) + table.sort(auxSellEntries[name], function(a,b) return a.itemPrice < b.itemPrice end) end auxSellEntries[name].selected = entry Aux_UpdateRecommendation() diff --git a/stack.lua b/stack.lua index b39f951..b1f08d1 100644 --- a/stack.lua +++ b/stack.lua @@ -47,6 +47,14 @@ function find_empty_slot() end end +function find_charge_item_slot(name, charges) + for slot in item_slots(name) do + if item_charges(slot) == charges then + return slot + end + end +end + function locked(slot) local _, _, locked = GetContainerItemInfo(slog.bag, slot.bag_slot) return locked @@ -89,6 +97,15 @@ function stack_size(slot) return item_count or 0 end +function item_charges(slot) + Aux_Scan_ClearTooltip() + AuxScanTooltip:SetOwner(UIParent, "ANCHOR_NONE") + AuxScanTooltip:SetBagItem(slot.bag, slot.bag_slot) + AuxScanTooltip:Show() + local tooltip = Aux_Scan_ExtractTooltip() + return Aux_Scan_ItemCharges(tooltip) +end + function Aux.stack.onupdate() if state and state.processing <= 0 then local next_slot = state.other_slots() @@ -137,7 +154,7 @@ end function Aux.stack.stop() if state then local slot - if state.target_slot and stack_size(state.target_slot) == state.target_size then + if state.target_slot and (stack_size(state.target_slot) == state.target_size or item_charges(state.target_slot) == state.target_size) then slot = state.target_slot end local callback = state.callback @@ -169,7 +186,10 @@ function Aux.stack.start(name, size, callback) processing = 0, } - if not state.target_slot then + if not target_slot then + Aux.stack.stop() + elseif item_charges(target_slot) then + state.target_slot = find_charges_item(name, size) Aux.stack.stop() end end \ No newline at end of file