added safety check to buying by confirmation in case some other addon or something changes the page
This commit is contained in:
+14
-12
@@ -696,18 +696,20 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
Aux.scan.abort()
|
||||
else
|
||||
public.dialog_action = function()
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))
|
||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))..'.')
|
||||
entry.gone = true
|
||||
refresh = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
AuxFilterSearchFrameResultsConfirmation:Hide()
|
||||
update_sheet()
|
||||
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))
|
||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxFilterSearchFrameResultsConfirmationContentBid))..'.')
|
||||
entry.gone = true
|
||||
refresh = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxFilterSearchFrameFiltersSearchButton:Enable()
|
||||
AuxFilterSearchFrameResultsConfirmation:Hide()
|
||||
update_sheet()
|
||||
end
|
||||
end
|
||||
AuxFilterSearchFrameResultsConfirmationContentActionButton:Enable()
|
||||
end
|
||||
|
||||
+14
-12
@@ -672,18 +672,20 @@ function find_auction(entry, buyout_mode, express_mode)
|
||||
Aux.scan.abort()
|
||||
else
|
||||
public.dialog_action = function()
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
|
||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
|
||||
entry.gone = true
|
||||
refresh = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxItemSearchFrameItemRefreshButton:Enable()
|
||||
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
||||
update_listing()
|
||||
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
|
||||
if GetMoney() >= amount then
|
||||
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
|
||||
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
|
||||
entry.gone = true
|
||||
refresh = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxItemSearchFrameItemRefreshButton:Enable()
|
||||
AuxItemSearchFrameAuctionsConfirmation:Hide()
|
||||
update_listing()
|
||||
end
|
||||
end
|
||||
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
|
||||
end
|
||||
|
||||
+15
-13
@@ -475,20 +475,22 @@ function private.find_auction(entry, action, express_mode)
|
||||
Aux.scan.abort()
|
||||
else
|
||||
public.dialog_action = function()
|
||||
if action == 'cancel' then
|
||||
CancelAuction(auction_info.index)
|
||||
entry.gone = true
|
||||
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
||||
elseif GetMoney() >= amount then
|
||||
PlaceAuctionBid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)
|
||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)..'.')
|
||||
entry.gone = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
|
||||
if action == 'cancel' then
|
||||
CancelAuction(auction_info.index)
|
||||
entry.gone = true
|
||||
Aux.log('Canceled'..auction_record.hyperlink..' x '..auction_record.aux_quantity)
|
||||
elseif GetMoney() >= amount then
|
||||
PlaceAuctionBid('bidder', auction_info.index, action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)
|
||||
Aux.log((action == 'buyout' and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(action == 'bid' and MoneyInputFrame_GetCopper(AuxManageFrameListingDialogContentBid) or amount)..'.')
|
||||
entry.gone = true
|
||||
else
|
||||
Aux.log('Not enough money.')
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxManageFrameListingDialog:Hide()
|
||||
public.update_listing()
|
||||
end
|
||||
Aux.scan.abort()
|
||||
AuxManageFrameListingDialog:Hide()
|
||||
public.update_listing()
|
||||
end
|
||||
AuxManageFrameListingDialogContentActionButton:Enable()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user