Lua Autologin+Autoreconnect

Rei

Известный
Друг
1,590
1,621
декомипльнул и скинул какие вопросы? не понимаю
если уж решил заниматься тем, что НИКТО не просил, то заюзай хотя бы декомпил более адекватный
Lua:
script_name("Autologin")
script_author("Perg")
script_version("1.0")
slot0, slot1 = pcall(require, "lib.samp.events")
slot5 = false
slot6 = false
require("lib.moonloader")
pass = require("inicfg").load(nil, slot3).config.pass
pin = require("inicfg").load(nil, slot3).config.pin
require("sampfuncs")
function slot1.onShowDialog(slot0, slot1, slot2, slot3, slot4, slot5)
   print(pass)
   if slot0 == 1 then
      lua_thread.create(function ()
         wait(1000)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 2 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 10 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 991 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pin)
      end)
      return false
   end
end
function cmd_rec(slot0)
   if not tonumber(slot0) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /rec [sec]", 16777215)
      return
   end
   if rec_thread then
      rec_thread:terminate()
   end
   rec_thread = lua_thread.create(function ()
      sampSetGamestate(GAMESTATE_DISCONNECTED)
      sampDisconnectWithReason(0)
      while true do
         wait(0)
         if uv0 - (os.clock() - os.clock()) >= 0 then
            printStringNow("Reconnect in " .. math.ceil(slot1) .. " sec")
         else
            break
         end
      end
      sampSetGamestate(GAMESTATE_WAIT_CONNECT)
   end)
end
function cmd_name(slot0)
   if not slot0:match("%w") then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname]", 16777215)
      return
   end
   sampSetLocalPlayerName(slot1)
   slot5, slot6 = sampGetCurrentServerAddress()
   sampConnectToServer(slot2, slot3)
end
function cmd_pass(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pass [password]", 16777215)
      return
   end
   uv0.config.pass = slot0
   pass = uv0.config.pass
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пароль сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пароль", 16777215)
   end
end
function cmd_pin(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pin [pincode]", 16777215)
      return
   end
   uv0.config.pin = slot0
   pin = uv0.config.pin
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пинкод сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пинкод", 16777215)
   end
end
function main()
   if not isSampfuncsLoaded() or not isSampLoaded() then
      return
   end
   while not isSampAvailable() do
      wait(100)
   end
   sampRegisterChatCommand("rec", cmd_rec)
   sampRegisterChatCommand("name", cmd_name)
   sampRegisterChatCommand("pass", cmd_pass)
   sampRegisterChatCommand("pin", cmd_pin)
   sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname] | /rec [sec] | /pass [password] | /pin [pincode]", 16777215)
   while true do
      wait(1)
      if sampGetChatString(99) == "Server closed the connection." or slot0 == "You are banned from this server." then
         sampDisconnectWithReason(false)
         sampAddChatMessage("Wait reconnecting...", 11125988)
         wait(15500)
         sampSetGamestate(GAMESTATE_WAIT_CONNECT)
      end
   end
end
 

fistforflirt

Участник
46
2
если уж решил заниматься тем, что НИКТО не просил, то заюзай хотя бы декомпил более адекватный
Lua:
script_name("Autologin")
script_author("Perg")
script_version("1.0")
slot0, slot1 = pcall(require, "lib.samp.events")
slot5 = false
slot6 = false
require("lib.moonloader")
pass = require("inicfg").load(nil, slot3).config.pass
pin = require("inicfg").load(nil, slot3).config.pin
require("sampfuncs")
function slot1.onShowDialog(slot0, slot1, slot2, slot3, slot4, slot5)
   print(pass)
   if slot0 == 1 then
      lua_thread.create(function ()
         wait(1000)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 2 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 10 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 991 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pin)
      end)
      return false
   end
end
function cmd_rec(slot0)
   if not tonumber(slot0) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /rec [sec]", 16777215)
      return
   end
   if rec_thread then
      rec_thread:terminate()
   end
   rec_thread = lua_thread.create(function ()
      sampSetGamestate(GAMESTATE_DISCONNECTED)
      sampDisconnectWithReason(0)
      while true do
         wait(0)
         if uv0 - (os.clock() - os.clock()) >= 0 then
            printStringNow("Reconnect in " .. math.ceil(slot1) .. " sec")
         else
            break
         end
      end
      sampSetGamestate(GAMESTATE_WAIT_CONNECT)
   end)
end
function cmd_name(slot0)
   if not slot0:match("%w") then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname]", 16777215)
      return
   end
   sampSetLocalPlayerName(slot1)
   slot5, slot6 = sampGetCurrentServerAddress()
   sampConnectToServer(slot2, slot3)
end
function cmd_pass(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pass [password]", 16777215)
      return
   end
   uv0.config.pass = slot0
   pass = uv0.config.pass
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пароль сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пароль", 16777215)
   end
end
function cmd_pin(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pin [pincode]", 16777215)
      return
   end
   uv0.config.pin = slot0
   pin = uv0.config.pin
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пинкод сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пинкод", 16777215)
   end
end
function main()
   if not isSampfuncsLoaded() or not isSampLoaded() then
      return
   end
   while not isSampAvailable() do
      wait(100)
   end
   sampRegisterChatCommand("rec", cmd_rec)
   sampRegisterChatCommand("name", cmd_name)
   sampRegisterChatCommand("pass", cmd_pass)
   sampRegisterChatCommand("pin", cmd_pin)
   sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname] | /rec [sec] | /pass [password] | /pin [pincode]", 16777215)
   while true do
      wait(1)
      if sampGetChatString(99) == "Server closed the connection." or slot0 == "You are banned from this server." then
         sampDisconnectWithReason(false)
         sampAddChatMessage("Wait reconnecting...", 11125988)
         wait(15500)
         sampSetGamestate(GAMESTATE_WAIT_CONNECT)
      end
   end
end
чел декомпил взял от FYP'a с форума
 

fistforflirt

Участник
46
2
Да хоть откуда. С хуя ли ты это называешь исходником?
1. Я тебя не оскорблял.
2. Не виду смысла продолжать диалог.
3. Сделал я это для того что бы люди которые обучаются и смотрят коды не скачивали файл и не декомпилировали, не тратили свое время. Ты бы лучше спасибо написал а не матюки.
 
  • Злость
Реакции: Perg

Perg

Активный
Автор темы
227
32
1. Я тебя не оскорблял.
2. Не виду смысла продолжать диалог.
3. Сделал я это для того что бы люди которые обучаются и смотрят коды не скачивали файл и не декомпилировали, не тратили свое время. Ты бы лучше спасибо написал а не матюки.
СУКА ТЫ КАК ПОНЯТЬ НЕ МОЖЕШЬ? это не исходный код луа скрипта .lua,так тебе понятно?
 
Последнее редактирование:

Rei

Известный
Друг
1,590
1,621
1. Я тебя не оскорблял.
2. Не виду смысла продолжать диалог.
3. Сделал я это для того что бы люди которые обучаются и смотрят коды не скачивали файл и не декомпилировали, не тратили свое время. Ты бы лучше спасибо написал а не матюки.
Что вообще новичок может понять из байт кода?
 

Perg

Активный
Автор темы
227
32
если уж решил заниматься тем, что НИКТО не просил, то заюзай хотя бы декомпил более адекватный
Lua:
script_name("Autologin")
script_author("Perg")
script_version("1.0")
slot0, slot1 = pcall(require, "lib.samp.events")
slot5 = false
slot6 = false
require("lib.moonloader")
pass = require("inicfg").load(nil, slot3).config.pass
pin = require("inicfg").load(nil, slot3).config.pin
require("sampfuncs")
function slot1.onShowDialog(slot0, slot1, slot2, slot3, slot4, slot5)
   print(pass)
   if slot0 == 1 then
      lua_thread.create(function ()
         wait(1000)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 2 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 10 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pass)
      end)
      return false
   end
   if slot0 == 991 then
      lua_thread.create(function ()
         wait(500)
         sampSendDialogResponse(uv0, 1, -1, pin)
      end)
      return false
   end
end
function cmd_rec(slot0)
   if not tonumber(slot0) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /rec [sec]", 16777215)
      return
   end
   if rec_thread then
      rec_thread:terminate()
   end
   rec_thread = lua_thread.create(function ()
      sampSetGamestate(GAMESTATE_DISCONNECTED)
      sampDisconnectWithReason(0)
      while true do
         wait(0)
         if uv0 - (os.clock() - os.clock()) >= 0 then
            printStringNow("Reconnect in " .. math.ceil(slot1) .. " sec")
         else
            break
         end
      end
      sampSetGamestate(GAMESTATE_WAIT_CONNECT)
   end)
end
function cmd_name(slot0)
   if not slot0:match("%w") then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname]", 16777215)
      return
   end
   sampSetLocalPlayerName(slot1)
   slot5, slot6 = sampGetCurrentServerAddress()
   sampConnectToServer(slot2, slot3)
end
function cmd_pass(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pass [password]", 16777215)
      return
   end
   uv0.config.pass = slot0
   pass = uv0.config.pass
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пароль сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пароль", 16777215)
   end
end
function cmd_pin(slot0)
   if slot0 == "" then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /pin [pincode]", 16777215)
      return
   end
   uv0.config.pin = slot0
   pin = uv0.config.pin
   if uv1.save(uv0, uv2) then
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Пинкод сохранен", 16777215)
   else
      sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} Не удалось сохранить пинкод", 16777215)
   end
end
function main()
   if not isSampfuncsLoaded() or not isSampLoaded() then
      return
   end
   while not isSampAvailable() do
      wait(100)
   end
   sampRegisterChatCommand("rec", cmd_rec)
   sampRegisterChatCommand("name", cmd_name)
   sampRegisterChatCommand("pass", cmd_pass)
   sampRegisterChatCommand("pin", cmd_pin)
   sampAddChatMessage("• {FFC800}[Autologin]{FFFFFF} /name [nickname] | /rec [sec] | /pass [password] | /pin [pincode]", 16777215)
   while true do
      wait(1)
      if sampGetChatString(99) == "Server closed the connection." or slot0 == "You are banned from this server." then
         sampDisconnectWithReason(false)
         sampAddChatMessage("Wait reconnecting...", 11125988)
         wait(15500)
         sampSetGamestate(GAMESTATE_WAIT_CONNECT)
      end
   end
end
можешь скинуть декомп?