zeffy Posted May 9, 2010 Posted May 9, 2010 (edited) Alright, I'm running a loop to check if a game is running, as the While loops, but it is using a lot my CPU (>45%). I was thinking maybe something that would check the current status to see if it is running, then based on that, check to see if it's running or not, and if its the same as the current status, just skip it. I've been trying to think of something to do that but i can't come up with anything.. Any ideas? While 1 $nMsg = GUIGetMsg() $iv_Pid = ProcessExists("game.exe") If $iv_Pid = 0 Then GUICtrlSetData($Label5, "The game is not running") GUICtrlSetColor(-1, 0xFF0000) Else $ah_Handle = _MemoryOpen($iv_Pid) If Not @error Then GUICtrlSetData($Label5, "The game is running") GUICtrlSetColor(-1, 0x008000) EndIf EndIf ; ... EndSwitch WEnd Edited May 9, 2010 by zeffy
Developers Jos Posted May 9, 2010 Developers Posted May 9, 2010 Put the following on the line before the Wend to let the script pause a little: Sleep(10) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now