Привязка

karsss

Участник
Автор темы
12
1
Версия MoonLoader
.027.0-preview
Lua:
requests = require('requests')

function getserial()
    local ffi = require("ffi")
    ffi.cdef[[
    int __stdcall GetVolumeInformationA(
    const char* lpRootPathName,
    char* lpVolumeNameBuffer,
    uint32_t nVolumeNameSize,
    uint32_t* lpVolumeSerialNumber,
    uint32_t* lpMaximumComponentLength,
    uint32_t* lpFileSystemFlags,
    char* lpFileSystemNameBuffer,
    uint32_t nFileSystemNameSize
    );
    ]]
    local serial = ffi.new("unsigned long[1]", 0)
    ffi.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)
    return serial[0]
end

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    checkKey()
    addkeytochat()
    wait(-1)
end

function checkKey()
        response = requests.get('https://cp.sprinthost.ru/auth.php?code=..getserial())
        if not response.text:match("<body>(.*)</body>"):find("-1") then -- Если ключ есть в бд
            if not response.text:match("<body>(.*)</body>"):find("The duration of the key has expired.") then -- Если сервер не ответил что ключ истек.
                sampAddChatMessage("До окончания лицензии осталось:"..response.text:match("<body>(.*)</body>"), -1) --  Выводим кол-во дней до конца лицензии
            else
                sampAddChatMessage("The duration of the key has expired.", -1)
            end
        else
            sampAddChatMessage("Ключ не активирован.", -1)
        end
end
function addkeytochat()
    sampAddChatMessage("Ключ:123123 "..getserial(), -1)
end
Брал https://www.blast.hk/threads/20881/
суть просто не работает
[11:28:33.683990] (debug) Module handle: 0x67600000
[11:28:33.684990] (info) Working directory: D:\gta 3500 by sakuraije\moonloader
[11:28:33.684990] (debug) FP Control: 0x0009001F
[11:28:33.684990] (debug) Windows: 6.1.7601 2
[11:28:33.684990] (debug) Game: GTA SA 1.0 US 'HoodLum'
[11:28:33.684990] (system) Installing pre-game hooks...
[11:28:33.686990] (system) Hooks installed.
[11:28:33.937004] (debug) Opcode handler table: 0x701f36f8
[11:28:33.937004] (debug) LUA_PATH = D:\gta 3500 by sakuraije\moonloader\libstd\?.lua;D:\gta 3500 by sakuraije\moonloader\libstd\?\init.lua;D:\gta 3500 by sakuraije\moonloader\lib\?.lua;D:\gta 3500 by sakuraije\moonloader\lib\?.luac;D:\gta 3500 by sakuraije\moonloader\lib\?\init.lua;D:\gta 3500 by sakuraije\moonloader\lib\?\init.luac
[11:28:33.937004] (debug) LUA_CPATH = D:\gta 3500 by sakuraije\moonloader\libstd\?.dll;D:\gta 3500 by sakuraije\moonloader\lib\?.dll
[11:28:33.994007] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\Antifreeze.lua"... (id:1)
[11:28:33.994007] (error) Antifreeze.lua: D:\gta 3500 by sakuraije\moonloader\Antifreeze.lua:31: unfinished string near ''https://cp.sprinthost.ru/auth.php?code=..getserial())'
[11:28:33.994007] (error) Antifreeze.lua: Script died due to an error. (id:1)
[11:28:33.994007] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\AutoReboot.lua"... (id:1)
[11:28:33.996007] (system) ML-AutoReboot: Loaded successfully.
[11:28:33.996007] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\check-moonloader-updates.lua"... (id:2)
[11:28:33.999008] (system) Check MoonLoader Updates: Loaded successfully.
[11:28:33.999008] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\reload_all.lua"... (id:3)
[11:28:34.001008] (system) ML-ReloadAll: Loaded successfully.
[11:28:34.001008] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\SF Integration.lua"... (id:4)
[11:28:34.004008] (system) SF Integration: Loaded successfully.
[11:28:36.107128] (system) Installing post-load hooks...
[11:28:36.107128] (system) Hooks installed.
[11:28:42.969521] (system) ML-ReloadAll: Script terminated. (id:3)
[11:28:42.977521] (system) ML-AutoReboot: Script terminated. (id:1)
[11:28:42.979521] (system) Check MoonLoader Updates: Script terminated. (id:2)
[11:28:42.982521] (system) SF Integration: Script terminated. (id:4)
[11:28:42.983521] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\Antifreeze.lua"... (id:1)
[11:28:42.983521] (error) Antifreeze.lua: D:\gta 3500 by sakuraije\moonloader\Antifreeze.lua:31: unfinished string near ''https://cp.sprinthost.ru/auth.php?code=..getserial())'
[11:28:42.983521] (error) Antifreeze.lua: Script died due to an error. (id:1)
[11:28:42.983521] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\AutoReboot.lua"... (id:1)
[11:28:42.986522] (system) ML-AutoReboot: Loaded successfully.
[11:28:42.986522] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\check-moonloader-updates.lua"... (id:2)
[11:28:42.988522] (system) Check MoonLoader Updates: Loaded successfully.
[11:28:42.988522] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\reload_all.lua"... (id:3)
[11:28:42.991522] (system) ML-ReloadAll: Loaded successfully.
[11:28:42.991522] (system) Loading script "D:\gta 3500 by sakuraije\moonloader\SF Integration.lua"... (id:4)
[11:28:42.993522] (system) SF Integration: Loaded successfully.
 

karsss

Участник
Автор темы
12
1
Lua:
response = requests.get("https://cp.sprinthost.ru/auth.php?code="..getserial())
Смотри а что туда писать
Lua:
        response = requests.get('сайт.ру/auth.php?code='..getserial())
По шаблону нужен сайт а где его взять free.sprinthost.ru я юзаю там его нет вроде