Sign in to follow this  
Followers 0
zeffy

While...WEnd Loop

2 posts in this topic

#1 ·  Posted (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 by zeffy

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0