I've been trying to add a hotkey to a script but I only started out earlier today and I am already struggling with the basics (not a big surprise for starting new) anyway I was hoping someone could give me an example on how to make a simple On/Off Hotkey
#include <Misc.au3>
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d
$dll = DllOpen("user32.dll")
Dim $coord[3]
Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Script is "Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TogglePause
While 1
If _IsPressed("1[", $dll) Then ExitLoop
For $i = 0 To 1024 Step 1
$coord = PixelSearch( 0, 0, $i, 768, 0xFF0000, 10 )
If Not @error Then
MouseMove($coord[0],$coord[1])
EndIf
If _IsPressed("1[", $dll) Then ExitLoop
Next
WEnd