I am trying to figure out how to reduce the CPU usage of a script like this:
#include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 If WinActive("[CLASS:MYWIN]") Then function() EndIf Sleep(80) ; keep the CPU cool WEnd Func function() If _IsPressed("30", $hDLL) Then ... ... ... EndIf EndFunc
It relies on key pressing so i suppose i cannot go high with "Sleep" (which, i suppose, could reduce the usage by reducing the number of cycles per second). Any idea?
Thanks





