Results 1 to 6 of 6
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    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.

  2. #2
    CodeDemon's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    vagina
    Posts
    1,074
    Reputation
    50
    Thanks
    936
    My Mood
    Fine
    Why not just change the sleep function to 30 seconds?

  3. #3
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    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?
    Dont ban me

  4. #4
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    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.

  5. #5
    speedforyou's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    741
    Reputation
    -59
    Thanks
    108
    My Mood
    Happy
    could you do that for speedhack???

    steel o-o's sig =
    = Done , = Not Done

    Leecher 0 =
    Newbie 25 =
    Member 50 =
    Advanced Member 100 =
    H4X0R Member 150 =
    Dual-Keyboard Member 250 =
    Expert Member 500 =
    's Trainer 750 =
    MPGH Expert 1000 =
    Synthetic Hacker 1250 =
    Blackhat Hacker 1500 =
    Whitehat Hacker 2000 =
    's Guardian 2500 =
    Upcoming MPGHiean 3000 =
    MPGH Addict 3500 =
    MPGHiean 4000 =
    MPGH Knight 4500 =
    MPGH Lord 5000 =
    MPGH Champion 5500 =
    MPGH King 6000 =
    MPGH Legend 6500 =
    MPGH God 7000 =
    MPGH God II 7500 =
    MPGH God III 8000 =
    MPGH God IV 8500 =
    MPGH God V 9000 =
    Arun's Slave 9500 =
    Dave's Slave 10000 =

  6. #6
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,193
    Reputation
    205
    Thanks
    1,438
    My Mood
    Mellow
    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.

Similar Threads

  1. [Help Request] Where is the setEMPjammed() function?
    By sepehrlaal in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 29
    Last Post: 08-04-2011, 06:58 AM
  2. [Discussion] How to remove the updater function??
    By SkynetVirus in forum Mission Against Terror Discussions
    Replies: 39
    Last Post: 07-22-2011, 10:36 AM
  3. May I please get the PrintText function?
    By nucks in forum Combat Arms Coding Help & Discussion
    Replies: 2
    Last Post: 05-29-2011, 03:31 PM
  4. [Tip] Avoid too much sleep function
    By ppl2pass in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 18
    Last Post: 08-24-2010, 02:11 AM
  5. [Help] Sleep Function
    By Alroundeath in forum Visual Basic Programming
    Replies: 22
    Last Post: 04-25-2010, 08:39 PM