Помощь

SCandy

Известный
Автор темы
100
16
Версия MoonLoader
.026-beta
Знаю вполне не стандартная тема, нужна помощь в создание скрипта, из другого скрипта в одно целое.
Нашел один скрипт с телеграмм оповещением, но помимо всего этого, там много лишних функций которые мне не пригодятся, ниже прилагаю нужные мне функции из кода данного скрипта:
Для отправки информации о персонаже:
function sendStatusTg()
local response = ''
response = response .. 'Nick: ' .. userNick .. '\n'
if sampGetCurrentServerName() then
response = response .. 'Server: ' .. sampGetCurrentServerName() .. '\n'
end
response = response .. 'Online: ' .. getOnline() .. '\n'
sendTelegramNotification(response)
end
Ещё необходима информация о количестве денег у персонажа

Отправление информации о продаже/скупке на центральном рынке:
if tgconnect.v and sellbartg.v and text:match('%a+_%a+ купил у вас (.*)') and text:find('от продажи') then sendTelegramNotification('[ЦР-ПРОДАЖА] '..text) end
if tgconnect.v and sellbartg.v and text:match('Вы купили (.*)') and text:find('у игрока %a+_%a+ за') then sendTelegramNotification('[ЦР-ПОКУПКА] '..text) end
Создание скриншота экрана и отправка его в телеграмм:
function sendScreenTg()
if tgconnect.v and sellotvtg.v then
local d3dx9_43 = ffi.load('d3dx9_43.dll')
local pDevice = ffi.cast("struct d3ddevice*", 0xC97C28)
local CreateOffscreenPlainSurface = ffi.cast("long(__stdcall*)(void*, unsigned long, unsigned long, unsigned long, unsigned long, void**, void*)", pDevice.vtbl[0].CreateOffscreenPlainSurface)
local GetFrontBufferData = ffi.cast("long(__stdcall*)(void*, unsigned long, void*)", pDevice.vtbl[0].GetFrontBufferData)
local pSurface = ffi.cast("void**", ffi.new('unsigned long[1]'))
local sx = ffi.C.GetSystemMetrics(0);
local sy = ffi.C.GetSystemMetrics(1);
CreateOffscreenPlainSurface(pDevice, sx, sy, 21, 3, pSurface, ffi.cast("void*", 0))
if GetFrontBufferData(pDevice, 0, pSurface[0]) < 0 then
else
local Point = ffi.new("struct POINT[1]")
local Rect = ffi.new("struct RECT[1]")
local HWND = ffi.cast("int*", 0xC97C1C)[0]
ffi.C.ClientToScreen(HWND, Point)
ffi.C.GetClientRect(HWND, Rect)
Rect[0].left = Rect[0].left + Point[0].x
Rect[0].right = Rect[0].right + Point[0].x
Rect[0].top = Rect[0].top + Point[0].y
Rect[0].bottom = Rect[0].bottom + Point[0].y
d3dx9_43.D3DXSaveSurfaceToFileA("1.png", 3, pSurface[0], ffi.cast("void*", 0), Rect) -- second parameter(3) is D3DXIMAGE_FILEFORMAT, checkout https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dximage-fileformat
sendPhotoTg()
end

Информация о получение Payday:
if text:find("Депозит в банке: $%d") and not text:find("говорит") and tgconnect.v and pdmastertg.v then
depozpdtg = tonumber(text:match("Депозит в банке: $(%d+)"))
end
if text:find("Сумма к выплате: $%d") and not text:find("говорит") and tgconnect.v and pdmastertg.v then
zppdtg = tonumber(text:match("Сумма к выплате: $(%d+)"))
end
if text:find("В данный момент у вас %d") and not text:find("говорит") and tgconnect.v and pdmastertg.v then
lvlpdtg = tonumber(text:match("В данный момент у вас (%d+)"))
end
if text:find("Текущая сумма в банке: %d") and not text:find("говорит") and tgconnect.v and pdmastertg.v then
summabanktg = tonumber(text:match("Текущая сумма в банке: (%d+)"))
end
if text:find("Текущая сумма на депозите: %d") and not text:find("говорит") and tgconnect.v and pdmastertg.v then
summadeptg = tonumber(text:match("Текущая сумма на депозите: (%d+)"))
end


if string.find(today_time, '00:30') and tgconnect.v and pdmastertg.v then
sendTelegramNotification('%E2%9D%97 PayDay %E2%9D%97\n\nДепозит в банке: '..depozpdtg..'\nСумма к выплате: '..zppdtg..'\nВаш уровень на данный момент: '..lvlpdtg..'\nТекущая сумма в банке: '..summabanktg..'\nТекущая сумма на депозите: '..summadeptg)
depozpdtg = 0
zppdtg = 0
lvlpdtg = 0
summabanktg = 0
summadeptg = 0
wait(1000)
end
wait(0)
end
end

Я как не пытался, но разобраться в Луа всё же не смог.
Оригинальный код был взят со скрипта: Monotools
Кому не сложно, соберите это все в один скрипт, пожалуйста!
 
  • Злость
  • Эм
Реакции: Hinаta и qdIbp