- 368
- 126
- Версия MoonLoader
- .026-beta
не приходят увидамление о покупке и продажи в TG
code:
local bank_check = false
local payday_notification_str = '%E2%9D%97__________Банковский чек__________%E2%9D%97\n'
local function collectAndSendPayDayData(text)
local ptrs = {
"Организационная зарплата: %$[%d%.]+",
"Депозит в банке: %$[%d%.]+",
"Сумма к выплате: %$[%d%.]+",
"Текущая сумма в банке: %$[%d%.]+",
"Текущая сумма на депозите: %$[%d%.]+"
}
local text = text:gsub("{%x+}", "")
for _, v in ipairs(ptrs) do
if text:find(v) then
payday_notification_str = ("%s\n%s"):format(payday_notification_str, text)
end
end
if text:find("В данный момент у вас %d") then
payday_notification_str = ("%s\n%s"):format(payday_notification_str, text)
if bank_check then
sendTelegramNotification(("%s"):format(payday_notification_str)) -- copy string
payday_notification_str = '%E2%9D%97__________Банковский чек__________%E2%9D%97\n'
end
bank_check = false
end
end
function sampev.onServerMessage(color, text)
if text:find('{FFFFFF}Вы успешно арендовали лавку для продажи/покупки товара!') then
sendTelegramNotification('Ебать молодец словил лавку')
end
if text:find('^%[Информация%] {FFFFFF}Ваша лавка была закрыта') then
sendTelegramNotification('Вас выкинули с вашей лавки!')
end
if text:find('^.+ купил у вас .+, вы получили %$%d+ от продажи %(комиссия %d процент%(а%)%)') then
local name, product, money = text:match('^(.+) купил у вас (.+), вы получили %$([%d.,]+) от продажи %(комиссия %d процент%(а%)%)')
local reg_text = 'Вы продали: "'..product..'" за '..money..'$ Игроку: '..name..'.'
sendTelegramNotification(reg_text)
end
if text:find('^Вы купили .+ у игрока .+ за %$%d+') then
local product, name, money = text:match('^Вы купили (.+) у игрока (.+) за %$([%d.,]+)')
local reg_text = 'Вы купили: "'..product..'" за '..money..'$ У игрока: '..name..'.'
sendTelegramNotification(reg_text)
end
if text:find('{FFFFFF}У вас есть 3 минуты, чтобы настроить товар, иначе аренда ларька будет отменена.') then
lavka = new.bool(false)
end
if text:find('Банковский чек') then bank_check = true end
if bank_check then collectAndSendPayDayData(text) end
end
if Chesttimer[0] then
if text:find('1') then
notification = true
end
end