Ищу скрипт, который присылает выбитые ларцы в тг/дс

Игрок Аризонки

Участник
Автор темы
62
5
Ищу скрипт который присылает в дс/тг из каких авто выбили авто/чертеж
Пример ниже
1705676182547.png
 

крутыш йоши

Активный
148
39
Ищу скрипт который присылает в дс/тг из каких авто выбили авто/чертеж
Пример нижеПосмотреть вложение 229369
ну для начала нужно иметь ракбота или аккаунт на сервере 24/7 который чатлог весь пишет, а потом уже начинать бота писать
 

kiaostashi

Участник
47
9
хукай текст, используй вебхук
 

Игрок Аризонки

Участник
Автор темы
62
5
хукай текст, используй вебхук
вообще не шарю как это делать, можешь помочь если не впадлу?
 

ChromiusJ

PARΛDIGM ΛSS
Друг
4,913
3,201

Игрок Аризонки

Участник
Автор темы
62
5
на форуме есть тема(правда там вроде одна ошибка есть незначительная, не помню),в точности нужная тебе. не вижу смысла покупать что-либо когда есть готовое.
можешь скинуть если найдешь?
 

ChromiusJ

PARΛDIGM ΛSS
Друг
4,913
3,201
можешь скинуть если найдешь?
держи
 

plalkeo

Известный
522
190
Писал для себя, работало без проблем, функции не помню уже откуда брал, по идее до сих пор спокойно должен работать
Lua:
local sampev = require('lib.samp.events')
local effil = require("effil")
local encoding = require("encoding")
encoding.default = "CP1251"
local u8 = encoding.UTF8

local TOKEN = '123...'
local CHAT_ID = '1556..'

function url_encode(text)
    local text = string.gsub(text, "([^%w-_ %.~=])", function(c)
        return string.format("%%%02X", string.byte(c))
    end)
    local text = string.gsub(text, " ", "+")
    return text
end

function sendTelegram(text)
    local url = ('https://api.telegram.org/bot' .. TOKEN .. '/sendMessage?chat_id=' .. CHAT_ID .. '&text=' .. url_encode(u8(text):gsub('{......}', '')))
    asyncHttpRequest('POST', url, nil, function(resolve)
    end, function(err)
      msg('Ошибка при отправке сообщения в Telegram!')
    end)
end

function asyncHttpRequest(method, url, args, resolve, reject)
    local request_thread = effil.thread(function (method, url, args)
       local requests = require 'requests'
       local result, response = pcall(requests.request, method, url, args)
       if result then
          response.json, response.xml = nil, nil
          return true, response
       else
          return false, response
       end
    end)(method, url, args)
    if not resolve then resolve = function() end end
    if not reject then reject = function() end end
 
    lua_thread.create(function()
       local runner = request_thread
       while true do
          local status, err = runner:status()
          if not err then
             if status == 'completed' then
                local result, response = runner:get()
                if result then
                   resolve(response)
                else
                   reject(response)
                end
                return
             elseif status == 'canceled' then
                return reject(status)
             end
          else
             return reject(err)
          end
          wait(0)
       end
    end)
end

function msg(...) sampAddChatMessage(table.concat({...}, '  '), -1) end

function sampev.onServerMessage(color, text)
    if text:find('испытал удачу при открытии') or text:find('Удача улыбнулась игроку') and color == 833881343 then
        sendTelegram(text)
    end
end
 

Игрок Аризонки

Участник
Автор темы
62
5
Писал для себя, работало без проблем, функции не помню уже откуда брал, по идее до сих пор спокойно должен работать
Lua:
local sampev = require('lib.samp.events')
local effil = require("effil")
local encoding = require("encoding")
encoding.default = "CP1251"
local u8 = encoding.UTF8

local TOKEN = '123...'
local CHAT_ID = '1556..'

function url_encode(text)
    local text = string.gsub(text, "([^%w-_ %.~=])", function(c)
        return string.format("%%%02X", string.byte(c))
    end)
    local text = string.gsub(text, " ", "+")
    return text
end

function sendTelegram(text)
    local url = ('https://api.telegram.org/bot' .. TOKEN .. '/sendMessage?chat_id=' .. CHAT_ID .. '&text=' .. url_encode(u8(text):gsub('{......}', '')))
    asyncHttpRequest('POST', url, nil, function(resolve)
    end, function(err)
      msg('Ошибка при отправке сообщения в Telegram!')
    end)
end

function asyncHttpRequest(method, url, args, resolve, reject)
    local request_thread = effil.thread(function (method, url, args)
       local requests = require 'requests'
       local result, response = pcall(requests.request, method, url, args)
       if result then
          response.json, response.xml = nil, nil
          return true, response
       else
          return false, response
       end
    end)(method, url, args)
    if not resolve then resolve = function() end end
    if not reject then reject = function() end end
 
    lua_thread.create(function()
       local runner = request_thread
       while true do
          local status, err = runner:status()
          if not err then
             if status == 'completed' then
                local result, response = runner:get()
                if result then
                   resolve(response)
                else
                   reject(response)
                end
                return
             elseif status == 'canceled' then
                return reject(status)
             end
          else
             return reject(err)
          end
          wait(0)
       end
    end)
end

function msg(...) sampAddChatMessage(table.concat({...}, '  '), -1) end

function sampev.onServerMessage(color, text)
    if text:find('испытал удачу при открытии') or text:find('Удача улыбнулась игроку') and color == 833881343 then
        sendTelegram(text)
    end
end
ого, спасибо, но для тг получше все равно будет думаю ❤

Писал для себя, работало без проблем, функции не помню уже откуда брал, по идее до сих пор спокойно должен работать
Lua:
local sampev = require('lib.samp.events')
local effil = require("effil")
local encoding = require("encoding")
encoding.default = "CP1251"
local u8 = encoding.UTF8

local TOKEN = '123...'
local CHAT_ID = '1556..'

function url_encode(text)
    local text = string.gsub(text, "([^%w-_ %.~=])", function(c)
        return string.format("%%%02X", string.byte(c))
    end)
    local text = string.gsub(text, " ", "+")
    return text
end

function sendTelegram(text)
    local url = ('https://api.telegram.org/bot' .. TOKEN .. '/sendMessage?chat_id=' .. CHAT_ID .. '&text=' .. url_encode(u8(text):gsub('{......}', '')))
    asyncHttpRequest('POST', url, nil, function(resolve)
    end, function(err)
      msg('Ошибка при отправке сообщения в Telegram!')
    end)
end

function asyncHttpRequest(method, url, args, resolve, reject)
    local request_thread = effil.thread(function (method, url, args)
       local requests = require 'requests'
       local result, response = pcall(requests.request, method, url, args)
       if result then
          response.json, response.xml = nil, nil
          return true, response
       else
          return false, response
       end
    end)(method, url, args)
    if not resolve then resolve = function() end end
    if not reject then reject = function() end end
 
    lua_thread.create(function()
       local runner = request_thread
       while true do
          local status, err = runner:status()
          if not err then
             if status == 'completed' then
                local result, response = runner:get()
                if result then
                   resolve(response)
                else
                   reject(response)
                end
                return
             elseif status == 'canceled' then
                return reject(status)
             end
          else
             return reject(err)
          end
          wait(0)
       end
    end)
end

function msg(...) sampAddChatMessage(table.concat({...}, '  '), -1) end

function sampev.onServerMessage(color, text)
    if text:find('испытал удачу при открытии') or text:find('Удача улыбнулась игроку') and color == 833881343 then
        sendTelegram(text)
    end
end
заменить нужно только 7 8 и 19 строку?
 

plalkeo

Известный
522
190
ого, спасибо, но для тг получше все равно будет думаю ❤
это для тг

заменить нужно только 7 8 и 19 строку?
только 7, 8, вставив свой токен и либо айди чата либо свой собственный айди
 
  • Нравится
Реакции: Игрок Аризонки