From caa59498dcb995fbd385aff699c76bd56bd73e30 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Sun, 24 Apr 2016 05:46:43 +0200 Subject: [PATCH] posting mechanism changed --- core.lua | 4 ++-- post.lua | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core.lua b/core.lua index 4b21bb6..dc6e19b 100644 --- a/core.lua +++ b/core.lua @@ -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() diff --git a/post.lua b/post.lua index dc2859f..aba5993 100644 --- a/post.lua +++ b/post.lua @@ -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)