From 0fbec86f19d12a01012c944cb21706d5e438741e Mon Sep 17 00:00:00 2001 From: rubin Date: Sun, 15 Jan 2023 15:41:17 +0300 Subject: [PATCH] fix AFK on load/unload only & fix solo_message --- TruckHUD.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/TruckHUD.lua b/TruckHUD.lua index 21dcb64..e5202f4 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -1188,7 +1188,7 @@ function doRenderStats() " {" .. autoColor .. "}[" .. (workload == 1 and "Un" or "") .. "Load] ") - if os.difftime(msk_timestamp, timer) > 178 and isPairModeActive() and os.time() - pair_afk_stop.auto_stop <= 3 then + if os.difftime(msk_timestamp, timer) > 178 and isPairModeActive() and os.time() - pair_afk_stop.auto_stop <= 3 and (unload_location or load_location) then printStyledString("Wait afk " .. (3 - (os.time() - pair_afk_stop.auto_stop)), 1111, 5) end @@ -3332,7 +3332,11 @@ function transponder() print("{ff0000}[" .. string.upper(thisScript().name) .. "]: Áûë ïîëó÷åí íåêîððåêòíûé îòâåò îò ñåðâåðà.") else if download_call == 0 then - clearSoloMessage() + if request_table["info"]["solo_message"]["name"] == solo_message_send.name then + clearSoloMessage() + else + say("ÇÀÙÈÒÀ ÎÒ ÏÅÐÅÇÀÏÈÑÈ ÑÎËÎ ÌÅÑÑÅÄÆ") + end transponder_delay = info.delay response_timestamp = info.timestamp if info.base ~= nil then @@ -3455,6 +3459,18 @@ function transponder_solo_message(info) if counter == 4 and os.time() - solo_data_antiflood[sender][i]["antiflood"] < 10 then result_find = true break + else + if af_say == nil then + af_say = {} + end + local key = string.format("%s%s", solo_data_antiflood[sender][i]["name"], solo_data_antiflood[sender][i]["time"]) + + if af_say[key] == nil then + af_say[key] = true + say(solo_data_antiflood[sender][i]["name"].." antiflood 10 sek!!") + say(os.time() - solo_data_antiflood[sender][i]["antiflood"].." sec") + say(counter) + end end end if not result_find then