I am new to ahk and I need help with my script. I've been playing a game and I've created an autoclicker, but I want to make it so that when I press caps, it pauses the script and when I press it again, it starts the script. Here is my script:
*LButton::
IsLButtonDown := true
while IsLButtonDown
{
Click
Sleep 45
}
return
*LButton up::IsLButtonDown := false
Help would be appreciated! Thanks!
Need help completing my script/How to toggle??
Started by
Sixant789
, Oct 31 2015 03:25 PM
2 replies to this topic
#1
-
Posted 31 October 2015 - 03:25 PM
definitive toggle script:
; http://www.autohotkey.com/board/topic/89284-turn-all-scripts-on-and-off/ #SingleInstance FORCE WM_COMMAND := 0x111 CMD_RELOAD := 65400 CMD_EDIT := 65401 CMD_PAUSE := 65403 ;CMD_SUSPEND := 65404 ; DetectHiddenWindows, On Process, Exist this_pid := ErrorLevel control_id := WinExist("ahk_class AutoHotkey ahk_pid " this_pid) ; Press Home to toggle Pause & Suspend states for all scripts ;Home:: RIGHT:: WinGet, id, list, ahk_class AutoHotkey Loop, %id% { this_id := id%A_Index% If (this_id <> control_id) { PostMessage, WM_COMMAND, CMD_PAUSE,,, ahk_id %this_id% ;PostMessage, WM_COMMAND, CMD_SUSPEND,,, ahk_id %this_id% ; } } Return ^RIGHT::SUSPEND
#3
-
Posted 01 November 2015 - 10:45 PM