Thread: Timer

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    gayguy911's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    Uranus
    Posts
    133
    Reputation
    10
    Thanks
    378
    My Mood
    Angelic

    Angry Timer

    How would I make a timer that would Write an Integer for unlimited ammo every 1 second?

    Sorry if im asking im still a little noobies at coding btw this is c# im talking about.
    Last edited by gayguy911; 12-30-2012 at 02:02 PM.

  2. #2
    aIW|Convery's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    2,875
    Reputation
    124
    Thanks
    604
    My Mood
    Cynical
    while(1)
    {
    Sleep(1000);
    // Do shit..
    }


  3. The Following User Says Thank You to aIW|Convery For This Useful Post:

    Jorndel (12-30-2012)

  4. #3
    hmrneves's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    118
    My Mood
    Sneaky
    jesus .. 1 sec? its consumes too much processing. For ammo, put every 1 minut (still too much but ok).

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by hmrneves View Post
    jesus .. 1 sec? its consumes too much processing. For ammo, put every 1 minut (still too much but ok).
    This is soon 2013. Not 1998 or so
    If your PC have problems with that, well.
    Don't play the game


    (Use a Timer in the ToolBox, it won't make your program that "laggy")

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. #5
    hmrneves's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    36
    Reputation
    10
    Thanks
    118
    My Mood
    Sneaky
    [MPGH]Jorndel hahaha, I know that the computers nowadays has MUCH processing power. But, things like that confuse me.

    Why we wrote lines of code that will consumes unnecessary processing while we can spend that power in the game? everything counts to delivery a good performance.

    In this case, 1 second is an absurd lol


    But, keep in mind, its only a opinion from a mortal guy

  7. #6
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by hmrneves View Post
    its only a opinion from a mortal guy
    We all are.
    Well, for all I would say then.
    Go C++, do ASM. and increase ammo or just ignore it

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  8. #7
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,920
    Reputation
    574
    Thanks
    5,050
    My Mood
    Twisted
    Quote Originally Posted by hmrneves View Post
    [MPGH]Jorndel hahaha, I know that the computers nowadays has MUCH processing power. But, things like that confuse me.

    Why we wrote lines of code that will consumes unnecessary processing while we can spend that power in the game? everything counts to delivery a good performance.

    In this case, 1 second is an absurd lol


    But, keep in mind, its only a opinion from a mortal guy
    My Dream Hack has 18 timers all with a delay of 100-200 ms.
    Noone is complaining over here
    But ontopic :
    Toolbox
    Drag timer to project
    properties
    enable it
    double click the icon of the added timer
    you should be brought to your Form1.cs
    start adding things to the freshly added code
    Last edited by Horror; 12-31-2012 at 01:55 AM.
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  9. #8
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Isaakske View Post
    My Dream Hack has 18 timers all with a delay of 100-200 ms.
    Well, I can complain
    Because 1-3 timers can most of the times do the job for 18 times without any problems at all.
    Instead of taking all cores of the CPU with 18 Timers

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  10. #9
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,920
    Reputation
    574
    Thanks
    5,050
    My Mood
    Twisted
    Quote Originally Posted by Jorndel View Post
    Well, I can complain
    Because 1-3 timers can most of the times do the job for 18 times without any problems at all.
    Instead of taking all cores of the CPU with 18 Timers
    Blablabla
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  11. #10
    rileyjstrickland's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Florida
    Posts
    649
    Reputation
    90
    Thanks
    4,008
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post


    This is soon 2013. Not 1998 or so
    If your PC have problems with that, well.
    Don't play the game


    (Use a Timer in the ToolBox, it won't make your program that "laggy")
    Or use a background worker .
    With a background worker everything in run in a separate thread, and can show progress.
    Worse case, just manually run it on a separate thread. For this though, a timer is ok.

    If You Like My Releases, Hit The Thanks button!
    Follow the rules.

    Successful Purchases: 2
    @The403
    @sundy42
    Successful Sales: 1
    @wZ. Gali
    Scammed: 1

    Favorite Quotes:
    Quote Originally Posted by Doc View Post
    Who cares about simplified mandarin. The only problem here is that Cantonese (and Hokkien) is no longer being taught, but guess what, times change. There have been thousands of languages that have been lost to the ages, you'd be pissing in the wind to try and stop that.

  12. #11
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by rileyjstrickland View Post
    Or use a background worker .
    With a background worker everything in run in a separate thread, and can show progress.
    Worse case, just manually run it on a separate thread. For this though, a timer is ok.
    Well, that is if you don't want to stop the current process and apply new values to it

    Anywayz, I suppose it's a better way to do the timer tho
    (I won't say to much but, I think there is a way to just nop the Ammo function, via Memory. NOT sure!!!)

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  13. #12
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,920
    Reputation
    574
    Thanks
    5,050
    My Mood
    Twisted
    Quote Originally Posted by Jorndel View Post
    (I won't say to much but, I think there is a way to just nop the Ammo function, via Memory. NOT sure!!!)
    For beginners, just writing 9999999 to it once will do the trick
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  14. #13
    gteuk's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    248
    Reputation
    15
    Thanks
    696
    Quote Originally Posted by Isaakske View Post
    For beginners, just writing 9999999 to it once will do the trick
    I think that has been fixed in some of the values, Timers do not cause much of a problem because although there may be 18 in the program my guess is only about 4 are running at any one time.

    I use a timer for force host, 1 for ammo, 1 for health. everybody has a different way of doing it and it depends how the foundation is set in the first place.

    but getting the timer to check a value seems to be my prefered way i.e.
    Code:
    if p1ammo = 1 then
         do stuff
    end if
    very basic and long winded but it does save on timers.
    Last edited by gteuk; 01-01-2013 at 06:45 AM.

  15. #14
    MaxSvett's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    41
    Reputation
    10
    Thanks
    888
    My Mood
    Angelic
    C# pseudo code

    Code:
    volatile bool isRunning = true;
    Thread t;
    
    void StartWriting()
    {
        isRunning = true;
        t = new Thread(() =>
            {
                while(isRunning)
                {
                    // Write to memory here
                    Thread.Sleep(1000); // Sleep thread for 1 second (1000 milliseconds)
                }
            });
        t.Start();
    }
    
    void StopWriting()
    {
        isRunning = false;
        t.Join();
    }
    You should create a wrapper class for this
    Last edited by MaxSvett; 01-01-2013 at 11:46 AM.

  16. #15
    rileyjstrickland's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    Florida
    Posts
    649
    Reputation
    90
    Thanks
    4,008
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post
    Well, that is if you don't want to stop the current process and apply new values to it

    Anywayz, I suppose it's a better way to do the timer tho
    (I won't say to much but, I think there is a way to just nop the Ammo function, via Memory. NOT sure!!!)
    Ah, but that is where you are wrong my good sir! A Background worker supports canceling the current action (which would allow you to run it again with new values)

    If You Like My Releases, Hit The Thanks button!
    Follow the rules.

    Successful Purchases: 2
    @The403
    @sundy42
    Successful Sales: 1
    @wZ. Gali
    Scammed: 1

    Favorite Quotes:
    Quote Originally Posted by Doc View Post
    Who cares about simplified mandarin. The only problem here is that Cantonese (and Hokkien) is no longer being taught, but guess what, times change. There have been thousands of languages that have been lost to the ages, you'd be pissing in the wind to try and stop that.

Page 1 of 2 12 LastLast

Similar Threads

  1. How to code a timer in visual C++ 6.0
    By nukeist_ in forum C++/C Programming
    Replies: 5
    Last Post: 12-12-2007, 02:18 PM
  2. [C++] SpeedHacking Using Timer API
    By radnomguywfq3 in forum C++/C Programming
    Replies: 4
    Last Post: 12-01-2007, 02:38 AM
  3. HELP again :[ [with timer]
    By w00t? in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-05-2007, 02:09 PM
  4. vb6 timer problem
    By juppeli in forum Visual Basic Programming
    Replies: 6
    Last Post: 07-09-2007, 10:30 PM
  5. [Help]VB6 Trainer - buttons/timers
    By Ephemera in forum Visual Basic Programming
    Replies: 5
    Last Post: 07-05-2007, 06:58 PM