авто ввод команд

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,776
11,226
i - пробить свой ид
j - пробить тайм
Lua:
require 'lib.moonloader'

function main()
    while not isSampAvailable() do wait(0) end
  
    while true do
        wait(0)
        if not sampIsCursorActive() then
            if wasKeyPressed(VK_I) then
                setChatinputWithRandomDelay('/id '..select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)), 10, 50)
            end
            if wasKeyPressed(VK_J) then
                setChatinputWithRandomDelay('/time', 10, 50)
            end
        end
    end
end

function setChatinputWithRandomDelay(text, min, max)
    lua_thread.create(function()
        if not sampIsChatInputActive() then sampSetChatInputEnabled(true) end
        sampSetChatInputText('')
        for i = 1, #text do
            sampSetChatInputText(sampGetChatInputText()..text:sub(i, i))
            math.randomseed(os.clock())
            wait(math.random(min, max))
        end
        sampSendChat(text)        
        sampSetChatInputText('')
    end)
end
 
  • Нравится
Реакции: Bramble

Bramble

Известный
Автор темы
1,203
190
i - пробить свой ид
j - пробить тайм
Lua:
require 'lib.moonloader'

function main()
    while not isSampAvailable() do wait(0) end
 
    while true do
        wait(0)
        if not sampIsCursorActive() then
            if wasKeyPressed(VK_I) then
                setChatinputWithRandomDelay('/id '..select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)), 10, 50)
            end
            if wasKeyPressed(VK_J) then
                setChatinputWithRandomDelay('/time', 10, 50)
            end
        end
    end
end

function setChatinputWithRandomDelay(text, min, max)
    lua_thread.create(function()
        if not sampIsChatInputActive() then sampSetChatInputEnabled(true) end
        sampSetChatInputText('')
        for i = 1, #text do
            sampSetChatInputText(sampGetChatInputText()..text:sub(i, i))
            math.randomseed(os.clock())
            wait(math.random(min, max))
        end
        sampSendChat(text)       
        sampSetChatInputText('')
    end)
end
Сам написал или из темы взял?