Results 1 to 13 of 13
  1. #1
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed

    [UPDATED] lol Some codes that can be useful!

    These are some codes that you "might" find useful to use in your hacks!

    Random Number Picking:
    This can be used to pick random speeds for speedhacks / rgb colors for chams /or almost anything!

    Code:
    #include <windows.h> 
    #include <stdio.h> 
    #include <iostream>
    #include "time.h"
    
    using namespace std;
    
    int RandomNumber,Hotkey;
    
    int main()
    {
        srand(time(NULL));
        RandomNumber = (int)(rand()%100);
        cout << "RandomNumber: " << RandomNumber << endl;
    }
    Here is another example off of a website that Music_King posted:
    Code:
    /* srand example */
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    
    int main ()
    {
      printf ("First number: %d\n", rand() % 100);
      srand ( time(NULL) );
      printf ("Random number: %d\n", rand() % 100);
      srand ( 1 );
      printf ("Again the first number: %d\n", rand() %100);
    
      return 0;
    }
    Code:
    Output:
    
    First number: 41
    Random number: 13
    Again the first number: 41
    Code:
    RandomNumber = (int)(rand()%100);
    Saying Random Number from 1 - 100.

    Like For maybe chams
    Code:
    (A,R,G,B)
    (rand()%255,rand()%255,rand()%255,rand()%255);
    Something like that.

    for SpeedHack... lol maybe
    Code:
    SpeedHackNumber = (int)(rand()%100);
    Code:
    if(speedhack)
    {
        *(float*) Speed_Address  =  SpeedHackNumber * 5;
    }
    *SpeedHackNumber * 5 -> Means The random speedhacknumber multiplied by 5.
    *Just an example

    May have errors, Fix them and have fun.
    Besides if this is going to be used in your hack you don't need the random project that i just wrote up

    All for now.. I had more in my mind but I forgot! ok haha bye!
    I'm bored and having fun Thanks and comment with your snippets hehe
    Last edited by Nubzgetkillz; 03-10-2011 at 09:29 PM.

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Oh this code is so Pro Nubz

  3. #3
    MiNT's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    551
    Reputation
    266
    Thanks
    2,559
    My Mood
    Psychedelic
    the numbers in ur example will not give u true random numbers,
    each time u run ur program u will get the same set of numbers.
    do this to fix the problem

    Code:
    //top
    #include "time.h"
    
    //in code
    srand(time(NULL));
    
    ..
    ..
    // all of ur calls to rand()

  4. #4
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    Quote Originally Posted by whit View Post
    Oh this code is so Pro Nubz
    I kno right? Proist in this whole section
    hehe thanks

    *Whit's Penis --> Huge

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  5. #5
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,006
    Reputation
    202
    Thanks
    2,944
    My Mood
    Twisted
    Actually this could be used for hook. Go search it.

    Current Works:
    ---Horror Game





    [IMG]https://i645.photobucke*****m/albums/uu180/drgnforce9/Siggys/signature3.jpg[/IMG]
    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  6. #6
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    Quote Originally Posted by MuSiC_kInG View Post
    the numbers in ur example will not give u true random numbers,
    each time u run ur program u will get the same set of numbers.
    do this to fix the problem

    Code:
    //top
    #include "time.h"
    
    //in code
    srand(time(NULL));
    
    ..
    ..
    // all of ur calls to rand()
    Hehe I added it for teh nubz

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  7. #7
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by MuSiC_kInG View Post
    the numbers in ur example will not give u true random numbers,
    each time u run ur program u will get the same set of numbers.
    do this to fix the problem

    Code:
    //top
    #include "time.h"
    
    //in code
    srand(time(NULL));
    
    ..
    ..
    // all of ur calls to rand()
    Depends Really what you want the Random number for..
    I would use srand() for random cham color as nubz said but i use about the same code he post for my spammer to add a ramdon number to the end of the text ingame so it dont block it out..So it dont really matter in that situation as i just need any number even if it is the same every time you run..

  8. #8
    MiNT's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    551
    Reputation
    266
    Thanks
    2,559
    My Mood
    Psychedelic
    Quote Originally Posted by whit View Post


    Depends Really what you want the Random number for..
    I would use srand() for random cham color as nubz said but i use about the same code he post for my spammer to add a ramdon number to the end of the text ingame so it dont block it out..So it dont really matter in that situation as i just need any number even if it is the same every time you run..
    please dont act like you know more than me :P
    cuz u dont .

    srand() is for seeding the values that rand() uses to collect
    srand - C++ Reference

  9. #9
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,006
    Reputation
    202
    Thanks
    2,944
    My Mood
    Twisted


    D3D FPS


    Code:
    #include "time.h"
    
    float fFps = NULL;
    float fLastTickCount = NULL;
    float fCurrentTickCount;
    char cFrameRate[50] = {NULL};
    char *GetFrameRate()
    {
    fCurrentTickCount = clock() * 0.001f;
    ++fFps;
    if((fCurrentTickCount - fLastTickCount) > 1.0f)
    {
    fLastTickCount = fCurrentTickCount;
    sprintf( cFrameRate, "[ Your FPS = %d ]", int( fFps ) );
    fFps = 0;
    }
    return cFrameRate;
    }
    to use:

    Code:
    Directx.DrawString(10, 2, D3DCOLOR_XRGB( 255, 255, 0 ), Directx.pFont,  GetFrameRate());


    EDIT: Credits to someone.. i think ac1d_burn?

    Current Works:
    ---Horror Game





    [IMG]https://i645.photobucke*****m/albums/uu180/drgnforce9/Siggys/signature3.jpg[/IMG]
    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  10. #10
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by MuSiC_kInG View Post
    please dont act like you know more than me :P
    cuz u dont .

    srand() is for seeding the values that rand() uses to collect
    srand - C++ Reference
    Woe if you wanna Get cocky about it
    Ya Know that Purple name dont make you Big and Bad

    I know what srand is..A function that is hardly ever used, same with rand
    Last edited by whit; 03-10-2011 at 05:15 PM.

  11. #11
    MiNT's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    551
    Reputation
    266
    Thanks
    2,559
    My Mood
    Psychedelic
    another note,
    only seed rand() 1 time or u will start getting the same numbers u got again

  12. #12
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    Quote Originally Posted by whit View Post


    Woe if you wanna Get cocky about it
    Ya Know that Purple name dont make you Big and Bad

    I know what srand is..A function that is hardly ever used, same with rand
    Actually he's right, but its only needed to be called on initialization, Its same as "Randomize" in delphi.. its creates the seed which is then used by "Random" functions. And its always used with random(should be always used anyway) otherwise as he said, random will not be so random if you don't use it.


    //Edit
    didn't see post above, but yeah call it only once on initialization
    Last edited by Departure; 03-10-2011 at 07:04 PM.

  13. #13
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Quote Originally Posted by Departure View Post
    Actually he's right, but its only needed to be called on initialization, Its same as "Randomize" in delphi.. its creates the seed which is then used by "Random" functions. And its always used with random(should be always used anyway) otherwise as he said, random will not be so random if you don't use it.


    //Edit
    didn't see post above, but yeah call it only once on initialization
    Oh i know he was right lol
    I think he misunderstood me..
    I was saying i didnt really care for a completely new set of number on start up for my spammer just as long as theres a different number for every line spammed