toggle script off on with one key and script kill

Ask gaming related questions (AHK v1.1 and older)
slider244
Posts: 6
Joined: 29 Aug 2020, 08:10

toggle script off on with one key and script kill

Post by slider244 » 31 Aug 2020, 17:26

Hi,
i use this script in a game:

Code: Select all

q::
    MouseGetPos, , , win
    maxWindow("ahk_id " win)
return

maxWindow(title) {
    WinMove, % title, , 0, 0, % A_ScreenWidth, % A_ScreenHeight
    WinActivate, % title
    WinSet, Style, -0xC00000, % title
    WinSet, Style, -0x40000, % title
    WinSet, AlwaysOnTop, Off, % title
}

c::
Send {RButton Down}
Send {LButton Down}
Sleep, 60
Send {LButton Up}
Send {RButton Up}

v::
Send {RButton Down}
Send {MButton Down}
Sleep, 60
Send {MButton Up}
Send {RButton Up}


ExitApp
[Mod edit: [code][/code] tags added.]

how can i make the q key to toggle its script on/off, and also how to make a key to kill\exit the all script?
thanks:)

Rohwedder
Posts: 7768
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: toggle script off on with one key and script kill

Post by Rohwedder » 01 Sep 2020, 02:14

Hallo,
1. you have already used the Q key elsewhere.
2. The C and V keys already kill\exit your script.

Post Reply

Return to “Gaming Help (v1)”