Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function private.purchaseall()
- StaticPopupDialogs["WRECKIT"] = {
- OnShow = function (self, data)
- self.editBox:SetText("Input value here")
- end,
- OnAccept = function (self, data, data2)
- local bidValue = self.editBox:GetText()
- --OG code right here
- local enableres = lib.GetSetting("reserve.enable")
- local reserve = lib.GetSetting("reserve") or 1
- local money = GetMoney()
- for _, sortedRow in ipairs(gui.sheet.sort) do
- local bidqueue = gui.frame.cancel.value or 0
- local balance = money - bidqueue --account for money we've already "spent"
- local data = gui.sheet:GetRowData(sortedRow)
- local link = data[1]
- local seller = data[8]
- local stack = data[4]
- local bid = data[6]
- local minbid = data[12]
- local curbid = data[13]
- local buyout = data[5]
- local reason = data[7]
- local price = 0
- if strmatch(reason, ":buy") then
- price = buyout
- elseif strmatch(reason, ":bid") then
- price = 10*stack
- -- 10 is copper value mulitplied by stack size
- elseif buyout > 0 then
- price = buyout
- else
- price = 10*stack
- -- 10 is copper value mulitplied by stack size
- end
- if ((balance-price) > reserve or not enableres) then
- AucAdvanced.Buy.QueueBuy(link, seller, stack, minbid, buyout, price, private.cropreason(reason))
- else
- aucPrint("Purchase cancelled: Reserve reached")
- end
- end
- end,
- hasEditBox = true
- timeout = 0,
- whileDead = true,
- hideOnEscape = true,
- preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/
- }
- StaticPopup_Show ("WRECKIT")
- [private.removeall]()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement