posting mechanism changed

This commit is contained in:
Manuel Simon Hirsig
2016-04-24 05:46:43 +02:00
parent 12e8a2045b
commit caa59498dc
2 changed files with 13 additions and 3 deletions
+2 -2
View File
@@ -174,9 +174,9 @@ do
local listener = Aux.control.event_listener('CHAT_MSG_SYSTEM')
listener:set_action(function()
if arg1 == ERR_AUCTION_BID_PLACED then
listener:stop()
on_success()
locked = false
listener:stop()
end
end)
listener:start()
@@ -203,9 +203,9 @@ do
local listener = Aux.control.event_listener('CHAT_MSG_SYSTEM')
listener:set_action(function()
if arg1 == ERR_AUCTION_REMOVED then
listener:stop()
on_success()
locked = false
listener:stop()
end
end)
listener:start()
+11 -1
View File
@@ -41,7 +41,17 @@ function private.post_auction(slot, k)
ClearCursor()
StartAuction(max(1, Aux.round(state.unit_start_price * item_info.aux_quantity)), Aux.round(state.unit_buyout_price * item_info.aux_quantity), state.duration)
Aux.control.wait_until(function() return not GetContainerItemInfo(unpack(slot)) end, function()
local posted
local listener = Aux.control.event_listener('CHAT_MSG_SYSTEM')
listener:set_action(function()
if arg1 == ERR_AUCTION_STARTED then
posted = true
listener:stop()
end
end)
listener:start()
Aux.control.wait_until(function() return posted end, function()
state.posted = state.posted + 1
return k()
end)