Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need help completing my script/How to toggle??


  • Please log in to reply
2 replies to this topic
Sixant789
  • Members
  • 1 posts
  • Last active: Oct 31 2015 03:35 PM
  • Joined: 31 Oct 2015
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!

Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Try

 

CapsLock::Suspend



bruno
  • Members
  • 635 posts
  • Last active: Nov 04 2015 02:26 PM
  • Joined: 07 Mar 2011

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