Доработать скрипт

Я кавказец

Известный
Автор темы
440
110
вообщем мне надо чтобы скрипт делал несколько вещей:
1. Нажимал enter после каждого введения команды
2. Нажимал tab и зажимал на несколько секунд F5
3. Вводил в sampSetChatInputText('/id ') свой id.
Просто я новичок в луа и по этому нужна помощь людей, что-то на подобии скрипта скину ниже и не пишите пж "воспользуйся гуглом" я им пользовался, но еще раз говорю, я новичок и нихуя не понимаю пока что.
 
Решение
Код:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
        if isKeyJustPressed(90) and not sampIsDialogActive() then
            local result, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
            sampSendChat('/time')
            wait(1000)
            sampSendChat('/stats')
            wait(1500)
            sampSendChat('/skill')
            wait(1500)
            sampSendChat('/id '..id)
            setVirtualKeyDown(13)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(116, true)
            wait(3000)...

Я кавказец

Известный
Автор темы
440
110
недоскрипт:
local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
function main()
    repeat wait(0) until isSampAvailable()
    while true do
        wait(0)
        if isKeyJustPressed(90) and not sampIsDialogActive() then
            sampSetChatInputEnabled(true)
            sampSetChatInputText('/time')
            wait(1000)
            setCharKeyDown(13, true)
            sampSetChatInputEnabled(true)
            sampSetChatInputText('/stats')
            wait(1500)
            setCharKeyDown(13, true)
            sampSetChatInputEnabled(true)
            sampSetChatInputText('/skill')
            wait(1500)
            setCharKeyDown(13, true)
            sampSetChatInputEnabled(true)
            sampSetChatInputText('/id ')
        end
    end
end

function sampSetChatInputTextWithDelay(text, delay)
    local array = {}
    for i in text:gmatch('[^%z]') do
        wait(delay)
        table.insert(array, i)
        sampSetChatInputText(table.concat(array))
    end
end
 

Slent

Известный
293
174
Код:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
        if isKeyJustPressed(90) and not sampIsDialogActive() then
            local result, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
            sampSendChat('/time')
            wait(1000)
            sampSendChat('/stats')
            wait(1500)
            sampSendChat('/skill')
            wait(1500)
            sampSendChat('/id '..id)
            setVirtualKeyDown(13)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(116, true)
            wait(3000)
            setVirtualKeyDown(116, false)
        end
    end
end

function sampSetChatInputTextWithDelay(text, delay)
    local array = {}
    for i in text:gmatch('[^%z]') do
        wait(delay)
        table.insert(array, i)
        sampSetChatInputText(table.concat(array))
    end
end
 
  • Нравится
Реакции: Я кавказец

Я кавказец

Известный
Автор темы
440
110
Код:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
        if isKeyJustPressed(90) and not sampIsDialogActive() then
            local result, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
            sampSendChat('/time')
            wait(1000)
            sampSendChat('/stats')
            wait(1500)
            sampSendChat('/skill')
            wait(1500)
            sampSendChat('/id '..id)
            setVirtualKeyDown(13)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(9)
            wait(1000)
            setVirtualKeyDown(116, true)
            wait(3000)
            setVirtualKeyDown(116, false)
        end
    end
end

function sampSetChatInputTextWithDelay(text, delay)
    local array = {}
    for i in text:gmatch('[^%z]') do
        wait(delay)
        table.insert(array, i)
        sampSetChatInputText(table.concat(array))
    end
end
Еще мини вопрос, как получить координаты чтобы скрипт сам нажимал ЛКМ на определенно координате.