прэкол с ChatGPT

gostrunner

Новичок
Автор темы
15
5
Карочи,написал я значит ChatGPT чтобы он написал простой скрипт который при определенном тексте нажимает Alt Enter Enter Enter вот че он мне выдал
script:
function main()
    while true do
        wait(0)
        if isKeyDown(VK_RETURN) and isKeyDown(VK_MENU) then
            sendChat("/paydaydep")
        end
        local chat = getChatText()
        if string.match(chat, "определенный текст") then
            sendKeys(VK_MENU, VK_RETURN)
            wait(100)
            sendKeys(VK_RETURN)
            wait(100)
            sendKeys(VK_RETURN)
            wait(100)
            sendKeys(VK_RETURN)
        end
    end
end

function sendChat(text)
    sampSendChat(text)
    wait(100)
end

function getChatText()
    return sampGetChatStringResult()
end

function wait(ms)
    local start = os.clock()
    repeat until os.clock() - start >= ms/1000
end

function isKeyDown(key)
    return isKeyDownAsync(key) or isCharKeyDown(key)
end

function sendKeys(...)
    for i, key in ipairs({...}) do
        keyDown(key)
        wait(50)
        keyUp(key)
        wait(50)
    end
end

function onScriptTerminate(script, quitGame)
end

function onScriptLoad()
    sampRegisterChatCommand("paydaydep", main)
end
Правда он не воркает у меня,пишет нужен какой то isKeyDown.Кому не лень,можете адаптировать скрипт чтобы он воркал,заранее благодарен
 
Решение
даже четверка делает хуйню, зачем ждать от него написания луашек, если можно юзать его с большей пользой
1680552962451.png


Lua:
require 'moonloader'
local sampev = require 'samp.events'

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

    math.randomseed(os.time())

    wait(-1)
end

function goKeyPressed(key)
    setVirtualKeyDown(key, true)
    wait(math.random(50, 100))
    setVirtualKeyDown(key, false)
end

function sampev.onServerMessage(color, text)
    if text:find("определенный текст") then
        lua_thread.create(function()
            goKeyPressed(VK_MENU) -- Alt
            for i = 1, 3 do
                goKeyPressed(VK_RETURN) --...

moreveal

Известный
Проверенный
857
536
даже четверка делает хуйню, зачем ждать от него написания луашек, если можно юзать его с большей пользой
1680552962451.png


Lua:
require 'moonloader'
local sampev = require 'samp.events'

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

    math.randomseed(os.time())

    wait(-1)
end

function goKeyPressed(key)
    setVirtualKeyDown(key, true)
    wait(math.random(50, 100))
    setVirtualKeyDown(key, false)
end

function sampev.onServerMessage(color, text)
    if text:find("определенный текст") then
        lua_thread.create(function()
            goKeyPressed(VK_MENU) -- Alt
            for i = 1, 3 do
                goKeyPressed(VK_RETURN) -- Enter
            end
        end)
    end
end
 
  • Нравится
Реакции: MLycoris

gostrunner

Новичок
Автор темы
15
5
даже четверка делает хуйню, зачем ждать от него написания луашек, если можно юзать его с большей пользой


Lua:
require 'moonloader'
local sampev = require 'samp.events'

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

    math.randomseed(os.time())

    wait(-1)
end

function goKeyPressed(key)
    setVirtualKeyDown(key, true)
    wait(math.random(50, 100))
    setVirtualKeyDown(key, false)
end

function sampev.onServerMessage(color, text)
    if text:find("определенный текст") then
        lua_thread.create(function()
            goKeyPressed(VK_MENU) -- Alt
            for i = 1, 3 do
                goKeyPressed(VK_RETURN) -- Enter
            end
        end)
    end
end
Спасибо большое! скрипт работает как швейцарские часы! лучший