Stoping the Sleep Function?

Posts 16 of 6 · Page 1 of 1
Stoping the Sleep Function?
In my code I have the Sleep at 60000 or 1 minute.
How can I stop the sleep function while the function is sleeping?
Like after 30 seconds of sleeping I want the sleep to stop and activate a code.
Why not just change the sleep function to 30 seconds?
not sure, but maybe you could do something like
[php]int Sleep = 100;
if(GetAsyncKeyState(VK_))
{
Sleep = 30000;
}else{
Sleep = 60000
}
[/php]
Just a guess?
There is no way I know of other than this :

Code:
for(int i = 0; i < 60000; i++){

    if(GetAsyncKeyState(...)&1){
        break;
    }
    Sleep(1);

}
It will sleep for 60 seconds or until you press a key.
could you do that for speedhack???
Before you call Sleep(), get the handle to the thread you're pausing and in another thread, call ResumeThread() whenever you want it to resume execution.

Not sure if this will work, just assuming Sleep() calls suspendThread() to pause for a certain amount of time.
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?