Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v1) • I have a script but I want to add ability to pause it and run it again if I click ESC button

$
0
0
here is my script

CODE:

br := 255    ; brightness, in the range of 0 - 255, where 128 is normal
sleep, 2000 ; Start sleep 2s
VarSetCapacity(gr, 5123)
Loop {
Loop, 256
{
If (nValue:=(br+128)(A_Index-1))>65535
nValue:=65535
NumPut(nValue, gr, 2(A_Index-1), "Ushort")
NumPut(nValue, gr, 512+2(A_Index-1), "Ushort")
NumPut(nValue, gr, 1024+2*(A_Index-1), "Ushort")
}
hDC := DllCall("GetDC", "Uint", 0)
DllCall("SetDeviceGammaRamp", "Uint", hDC, "Uint", &gr)
DllCall("ReleaseDC", "Uint", 0, "Uint", hDC)
sleep, 2000 ; 2s internal between brighness fix, change it for faster refresh
}
return


when script is running I want to be able to click ESC to pause it and ESC to continue it running. tried 10 different ways but still was not able to get it to work, can someone help?

Statistics: Posted by zemaitis — Today, 05:34



Viewing all articles
Browse latest Browse all 579

Trending Articles