i need help with my ahk

Ask gaming related questions
seba16201620
Posts: 17
Joined: 13 Mar 2020, 11:15

i need help with my ahk

22 Mar 2020, 17:11

hello how are you ?, I need my ahk to have a default sleep of 852, but when I press F4 or F5, add that variable in the program. Is this possible?

Code: Select all


Mynumber= 852 

*Numpad5:: 

Send {Numpad5 down}

if GetKeyState("Numpad5")  ; The button has been released.
{   
    
    Sleep, Mynumber
    Send {Numpad5 up}  ; Release the spacebar.    
    return
}
return



F4::
Mynumber = Mynumber - 4
msgbox Mynumber

F5::
Mynumber = Mynumber + 4
msgbox Mynumber


F1::ExitApp
Rohwedder
Posts: 2702
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: i need help with my ahk

27 Mar 2020, 00:25

Hallo,
just to test the sleep I have added a short chirp:

Code: Select all

Mynumber= 852
*Numpad5::
Send {Numpad5 down}
KeyWait, Numpad5 ;waits until the button has been released.
Sleep, Mynumber
SoundBeep, 5000, 20 ; short chirp
Send {Numpad5 up}  ; Release the button.
return
F4::
Mynumber := Mynumber - 4
msgbox,% Mynumber
Return
F5::
Mynumber := Mynumber + 4
msgbox,% Mynumber
Return
F1::ExitApp

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 88 guests