Помогите пожалуйста

D0glian

Новичок
Автор темы
13
0
Как сделать бота который будет прожимать альт потом ентер потом будет ждать пока рулетка докрутиться и вот так много раз .
Вот видео -
 
Решение
alt - setgamekeystate
enter - sampsenddialogresponse
Lua:
local samp = require('samp.events')
local state = false
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('koleso', function ()
        state = not state
        printStringNow(state and '~g~enabled' or '~r~disabled', 2000)
    end)
    while true do
        wait(0)
        if state then
            setGameKeyState(21, 1)
            wait(100)
        end
    end
end
function samp.onShowDialog(id, _, title)
    if state and title:find('Колесо фортуны') then
        sampSendDialogResponse(id, 1, 0, '')
        return false
    end
end

MrDorlik

Известный
977
392
alt - setgamekeystate
enter - sampsenddialogresponse
Lua:
local samp = require('samp.events')
local state = false
function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('koleso', function ()
        state = not state
        printStringNow(state and '~g~enabled' or '~r~disabled', 2000)
    end)
    while true do
        wait(0)
        if state then
            setGameKeyState(21, 1)
            wait(100)
        end
    end
end
function samp.onShowDialog(id, _, title)
    if state and title:find('Колесо фортуны') then
        sampSendDialogResponse(id, 1, 0, '')
        return false
    end
end
 
  • Нравится
Реакции: D0glian