почему скрипт не жмет enter? нужна помощ

rertlop

Участник
Автор темы
47
3
Версия MoonLoader
Другое
код:
function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('cg', function()
        bool = not bool
        sampAddChatMessage(bool and ('{F1C232}Скрипт включен.') or ('{F1C232}Скрипт выключен.'), -1)
    end)
    while true do wait(0)
        if bool then
            for i = 0, 2048 do
                if sampIs3dTextDefined(i) then
                    local pp = {sampGet3dTextInfoById(i)}
                    if pp[1]:match('слово') then
                        if not sampIsCursorActive() then                     
                            setVirtualKeyDown(20, true)
                            wait(150)
                            setVirtualKeyDown(13, true)
                            wait(300)
                            setVirtualKeyDown(27, true)
                            wait(200)
                            setVirtualKeyDown(20, false)
                            wait(150)
                        setVirtualKeyDown(13, false)
                            wait(300)
                setVirtualKeyDown(27, false)
                            wait(200)
                        end
                    end
                end
            end
        end
    end
end


---20capslock
---13enter
---27esc
 

YarikVL

Известный
Проверенный
4,783
1,807
код:
function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('cg', function()
        bool = not bool
        sampAddChatMessage(bool and ('{F1C232}Скрипт включен.') or ('{F1C232}Скрипт выключен.'), -1)
    end)
    while true do wait(0)
        if bool then
            for i = 0, 2048 do
                if sampIs3dTextDefined(i) then
                    local pp = {sampGet3dTextInfoById(i)}
                    if pp[1]:match('слово') then
                        if not sampIsCursorActive() then                    
                            setVirtualKeyDown(20, true)
                            wait(150)
                            setVirtualKeyDown(13, true)
                            wait(300)
                            setVirtualKeyDown(27, true)
                            wait(200)
                            setVirtualKeyDown(20, false)
                            wait(150)
                        setVirtualKeyDown(13, false)
                            wait(300)
                setVirtualKeyDown(27, false)
                            wait(200)
                        end
                    end
                end
            end
        end
    end
end


---20capslock
---13enter
---27esc
Lua:
function main()
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('cg', function()
        bool = not bool
        sampAddChatMessage(bool and ('{F1C232}Скрипт включен.') or ('{F1C232}Скрипт выключен.'), -1)
    end)
    while true do wait(0)
        if bool then
            for i = 0, 2048 do
                if sampIs3dTextDefined(i) then
                    local pp = {sampGet3dTextInfoById(i)}
                    if pp[1]:match('слово') then
                        if not sampIsCursorActive() then                     
                            setVirtualKeyDown(20, true)
                            wait(30)
                            setVirtualKeyDown(20, false)
                            wait(300)
                            setVirtualKeyDown(13, true)
                            wait(30)
                            setVirtualKeyDown(13, false)
                            wait(300)
                            setVirtualKeyDown(27, true)
                            wait(30)
                            setVirtualKeyDown(27, false)
                            wait(300)
                        end
                    end
                end
            end
        end
    end
end


---20capslock
---13enter
---27esc