Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. function private.purchaseall()
  2. local enableres = lib.GetSetting("reserve.enable")
  3. local reserve = lib.GetSetting("reserve") or 1
  4. local money = GetMoney()
  5. for _, sortedRow in ipairs(gui.sheet.sort) do
  6. local bidqueue = gui.frame.cancel.value or 0
  7. local balance = money - bidqueue --account for money we've already "spent"
  8.  
  9. local data = gui.sheet:GetRowData(sortedRow)
  10. local link = data[1]
  11. local seller = data[8]
  12. local stack = data[4]
  13. local bid = data[6]
  14. local minbid = data[12]
  15. local curbid = data[13]
  16. local buyout = data[5]
  17. local reason = data[7]
  18. local price = 0
  19.  
  20. if strmatch(reason, ":buy") then
  21. price = buyout
  22. elseif strmatch(reason, ":bid") then
  23. price = 10000
  24. elseif buyout > 0 then
  25. price = buyout
  26. else
  27. price = 10000
  28. end
  29.  
  30. if ((balance-price) > reserve or not enableres) then
  31. AucAdvanced.Buy.QueueBuy(link, seller, stack, minbid, buyout, price, private.cropreason(reason))
  32.  
  33. else
  34. aucPrint("Purchase cancelled: Reserve reached")
  35. end
  36. end
  37. private.removeall()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement