Toggle Hold to start the script Topic is solved

Ask gaming related questions (AHK v1.1 and older)
navysonar2

Toggle Hold to start the script

13 Aug 2017, 00:18

Hi,


I have a simple recoil script but I want it to only be active when holding shift.

Code: Select all

#NoEnv
SendMode Input
MsgBox 

*~$Shift:: Hotkey, *~$LButton, Toggle
*~$End:: Hotkey ,*~$LButton, Toggle
*~$LButton::
    while GetKeyState("LButton")
    {    
        DllCall("mouse_event", uint, 1, int, 0, int, 12, uint, 0, int, 0)
        Sleep, 15
        DllCall("mouse_event", uint, 1, int, 0, int, 12w, uint, 0, int, 0)
        Sleep, 5
    }
Return
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Toggle Hold to start the script  Topic is solved

13 Aug 2017, 03:09

Code: Select all

#NoEnv
SendMode Input
MsgBox 

*~$End:: Hotkey ,*~$LButton, Toggle

#IF GetKeyState("Shift")

*~$LButton::
    while GetKeyState("LButton")
    {    
        DllCall("mouse_event", uint, 1, int, 0, int, 12, uint, 0, int, 0)
        Sleep, 15
        DllCall("mouse_event", uint, 1, int, 0, int, 12w, uint, 0, int, 0)
        Sleep, 5
    }
Return

#IF
HTH

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: DiegoSouto and 74 guests