АХК скрипт, не могу остановить

Georgine

Новичок
Автор темы
3
0
В игре надо нажимать поочерёдно кнопки чтобы пройти. Я решил зажать все, что бы они сами нажимались. Программа запускается и всё получается (кроме стрелочек), но она не останавливается продолжает нажимать всё подряд, таймер нельзя потому, что есть длинные уровни, есть короткие. Помогите)





Или так:
vk54::
    T := !T
Loop:

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x26 Up}                  ;
    }
    KeyWait 1                       ;
    return


    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x27 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x28 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x25 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {z Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {s Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {l Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {k Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {j Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {h Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {f Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {d Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {Space Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {Shift Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {b Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {v Up}                  ;
    }
    KeyWait 1                       ;
    return

SendA:
    Send {0x26 Down}
    Send {0x27 Down}
    Send {0x28 Down}
    Send {0x25 Down}
    Send {z Down}
    Send {s Down}
    Send {l Down}
    Send {k Down}
    Send {j Down}
    Send {h Down}
    Send {f Down}
    Send {d Down}
    Send {Space Down}
    Send {Shift Down}
    Send {b Down}
    Send {v Down}
    return

If !T
        Return
    SetTimer, Loop, -1
    Return




Никак не выключается:
vk54::
   
vk54::
    T := !T 
    SetTimer, Loop, -1
    return

Loop:
    While T
    { 
    Send, {0x26 Down}
    Send, {0x28 Down}
    Send, {0x25 Down}
    Send, {z Down}
    Send, {s Down}
    Send, {l Down}
    Send, {k Down}
    Send, {j Down}
    Send, {h Down}
    Send, {f Down}
    Send, {d Down}
    Send, {Space Down}
    Send, {Shift Down}
    Send, {b Down}
    Send, {v Down} 
    }
    return

2:: pause

Как сделать чтобы нажимались эти 16 клавиш одновременнно включая их через кнопку
 
Последнее редактирование:

Pizduk2277

Активный
292
33
В игре надо нажимать поочерёдно кнопки чтобы пройти. Я решил зажать все, что бы они сами нажимались. Программа запускается и всё получается (кроме стрелочек), но она не останавливается продолжает нажимать всё подряд, таймер нельзя потому, что есть длинные уровни, есть короткие. Помогите)





Или так:
vk54::
    T := !T
Loop:

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x26 Up}                  ;
    }
    KeyWait 1                       ;
    return


    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x27 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x28 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {0x25 Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {z Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {s Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {l Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {k Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {j Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {h Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {f Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {d Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {Space Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {Shift Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {b Up}                  ;
    }
    KeyWait 1                       ;
    return

    If isKeyPressed := !isKeyPressed    ;
        SetTimer, SendA, 40             ;
    Else
    {
        SetTimer, SendA, Off            ;
        Send {v Up}                  ;
    }
    KeyWait 1                       ;
    return

SendA:
    Send {0x26 Down}
    Send {0x27 Down}
    Send {0x28 Down}
    Send {0x25 Down}
    Send {z Down}
    Send {s Down}
    Send {l Down}
    Send {k Down}
    Send {j Down}
    Send {h Down}
    Send {f Down}
    Send {d Down}
    Send {Space Down}
    Send {Shift Down}
    Send {b Down}
    Send {v Down}
    return

If !T
        Return
    SetTimer, Loop, -1
    Return




Никак не выключается:
vk54::
  
vk54::
    T := !T
    SetTimer, Loop, -1
    return

Loop:
    While T
    {
    Send, {0x26 Down}
    Send, {0x28 Down}
    Send, {0x25 Down}
    Send, {z Down}
    Send, {s Down}
    Send, {l Down}
    Send, {k Down}
    Send, {j Down}
    Send, {h Down}
    Send, {f Down}
    Send, {d Down}
    Send, {Space Down}
    Send, {Shift Down}
    Send, {b Down}
    Send, {v Down}
    }
    return

2:: pause

Как сделать чтобы нажимались эти 16 клавиш одновременнно включая их через кнопку
1. Кривой Loop абсолютно
2. Кривые нажатия/зажатия клавиш
 

alex1223321

Участник
41
0
Может так лучше?

t::
while(Getkeystate("t", "P"))
{
Sendinput, {0x26 Down}{0x28 Down}{0x25 Down}{z Down}{s Down}{l Down}{k Down}{j Down}{h Down}{f Down}{d Down}{Space Down}{Shift Down}{b Down}{v Down}
sleep 10
Sendinput, {0x26 Up}{0x28 Up}{0x25 Up}{z Up}{s Up}{l Up}{k Up}{j Up}{h Up}{f Up}{d Up}{Space Up}{Shift Up}{b Up}{v Up}
}
 
Последнее редактирование: