Results 1 to 12 of 12
  1. #1
    woodz's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    i dunno, i can't remember
    Posts
    230
    Reputation
    11
    Thanks
    93
    My Mood
    Sleepy

    [help]key trigger

    hi, i'm almost done with my first c++ project, a glitch-tool
    i just haven't found a way to trigger my program with a keyboard
    can you help me?
    epic dubstep mix



    Quote Originally Posted by Woods View Post
    woodz, u should be my junior

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Code:
    if(GetAsyncKeyState(VK_NUMPAD0)&1)
    {
        //code goes here
    }
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    kronus980's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Long Beach, California
    Posts
    44
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive
    Yeah that's just about it






    [IMG]https://i931.photobucke*****m/albums/ad158/kronus980/bg_logo.png[/IMG]



  4. #4
    woodz's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    i dunno, i can't remember
    Posts
    230
    Reputation
    11
    Thanks
    93
    My Mood
    Sleepy
    is this good (correct my errors plz)
    Code:
    #include <windows.h>
    
    int main()
    if(GetAsyncKeyState(VK_NUMPAD1)&1)
    	bool Project = true
    else 
    	if (GetAsyncKeyState (VK_NUMPAD0)&1)
    		bool Project = false
    if Project = true
    	{
    		for(;;){
    			Sleep(100);
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,0,0);
    		}
    		return 0;
    	}
    if Project = false
    	{	
    		for(;;){
    			Sleep(100);
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,0,0);
    		}
    	}
    epic dubstep mix



    Quote Originally Posted by Woods View Post
    woodz, u should be my junior

  5. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by woodz View Post
    is this good (correct my errors plz)
    The Problem isn't so much ur logic as it just seems you don't know how to write code. This will not even compile. You should be able to fix the compile errors u get for yourself. It's going to say something along the lines of:
    "in function main int val is not returned."
    That is because you did not put all of the lines of execution in brackets. Therefore only the first line will be executed o_O... and that line does not return an int. Also its incorrect. You did not put a semicolon on the line after ur if statement. The problem is you don't know how to program, and ur failure at these points reveals a weak grasp on the elementary concepts such as control, flow, and structure. However ur logic is there. I recommend reading the first chapter of any programming book and completing the first program, usually called: "hello world". It's a shame your going get stuck on little details when ur logic is very sound for someone just starting out. You have potential...

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. The Following User Says Thank You to why06 For This Useful Post:

    woodz (04-24-2010)

  7. #6
    woodz's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    i dunno, i can't remember
    Posts
    230
    Reputation
    11
    Thanks
    93
    My Mood
    Sleepy
    Quote Originally Posted by why06 View Post
    The Problem isn't so much ur logic as it just seems you don't know how to write code. This will not even compile. You should be able to fix the compile errors u get for yourself. It's going to say something along the lines of:
    "in function main int val is not returned."
    That is because you did not put all of the lines of execution in brackets. Therefore only the first line will be executed o_O... and that line does not return an int. Also its incorrect. You did not put a semicolon on the line after ur if statement. The problem is you don't know how to program, and ur failure at these points reveals a weak grasp on the elementary concepts such as control, flow, and structure. However ur logic is there. I recommend reading the first chapter of any programming book and completing the first program, usually called: "hello world". It's a shame your going get stuck on little details when ur logic is very sound for someone just starting out. You have potential...
    i did the hello world, i just need to reread my code next time to look for those errors.
    thanx for the compliments btw
    epic dubstep mix



    Quote Originally Posted by Woods View Post
    woodz, u should be my junior

  8. #7
    woodz's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    i dunno, i can't remember
    Posts
    230
    Reputation
    11
    Thanks
    93
    My Mood
    Sleepy
    i fixed it,
    now there is this:

    what do i do? (my first dll)
    epic dubstep mix



    Quote Originally Posted by Woods View Post
    woodz, u should be my junior

  9. #8
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    hit f7 instead of f5.... there's no need to debug it. Well there is but I would just test it by injecting it into ur game manually.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  10. The Following User Says Thank You to why06 For This Useful Post:

    woodz (04-24-2010)

  11. #9
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Oh god, that looks like a mix of C++, VB and brainphuck >.>
    Do as why says(no idea what he says, but im sure it contains valuable information)
    Ah we-a blaze the fyah, make it bun dem!

  12. #10
    danng4280's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    4
    Quote Originally Posted by woodz View Post
    is this good (correct my errors plz)
    Code:
    #include <windows.h>
    
    int main()
    if(GetAsyncKeyState(VK_NUMPAD1)&1)
    	bool Project = true
    else 
    	if (GetAsyncKeyState (VK_NUMPAD0)&1)
    		bool Project = false
    if Project = true
    	{
    		for(;;){
    			Sleep(100);
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,0,0);
    		}
    		return 0;
    	}
    if Project = false
    	{	
    		for(;;){
    			Sleep(100);
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,0,0);
    		}
    	}
    Fixed and added comments for you
    Code:
    #include <windows.h>
    
    bool Running;
    
    int main(){
    	while (true){ //infinite loop
    		if(GetAsyncKeyState(VK_NUMPAD1)&1)//if numpad1 is pressed start pressing keys
    			Running = true;
    		while (Running) { //as long as Running == true, will continue to press buttons
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('z'),0,KEYEVENTF_KEYUP,0);//lifts up z key
    			keybd_event(VkKeyScan('s'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,KEYEVENTF_KEYUP,0); //lifts up s key
    			Sleep(100);
    			if (GetAsyncKeyState(VK_NUMPAD0)&1)
    				Running = false; // if you press numpad0 it will stop pressing buttons
    		}
    	}
    	return 1; //although this will never be reached because of the infinite loop, it is necessary...
    }

  13. #11
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    Quote Originally Posted by danng4280 View Post
    Fixed and added comments for you
    Code:
    #include <windows.h>
    
    bool Running;
    
    int main(){
    	while (true){ //infinite loop
    		if(GetAsyncKeyState(VK_NUMPAD1)&1)//if numpad1 is pressed start pressing keys
    			Running = true;
    		while (Running) { //as long as Running == true, will continue to press buttons
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('z'),0,KEYEVENTF_KEYUP,0);//lifts up z key
    			keybd_event(VkKeyScan('s'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,KEYEVENTF_KEYUP,0); //lifts up s key
    			Sleep(100);
    			if (GetAsyncKeyState(VK_NUMPAD0)&1)
    				Running = false; // if you press numpad0 it will stop pressing buttons
    		}
    	}
    	return 1; //although this will never be reached because of the infinite loop, it is necessary...
    }

    intialize running as false o.O?
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  14. The Following User Says Thank You to zhaoyun333 For This Useful Post:

    woodz (05-08-2010)

  15. #12
    danng4280's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    4
    Quote Originally Posted by zhaoyun333 View Post
    intialize running as false o.O?
    Lol oops, I'm used to java where it is initialized as false nice catch
    Code:
    #include <windows.h>
    
    bool Running;
    
    int main(){
    	Running = false;
    	while (true){ //infinite loop
    		if(GetAsyncKeyState(VK_NUMPAD1)&1)//if numpad1 is pressed start pressing keys
    			Running = true;
    		while (Running) { //as long as Running == true, will continue to press buttons
    			keybd_event(VkKeyScan('z'),0,0,0);
    			keybd_event(VkKeyScan('z'),0,KEYEVENTF_KEYUP,0);//lifts up z key
    			keybd_event(VkKeyScan('s'),0,0,0);
    			keybd_event(VkKeyScan('s'),0,KEYEVENTF_KEYUP,0); //lifts up s key
    			Sleep(100);
    			if (GetAsyncKeyState(VK_NUMPAD0)&1)
    				Running = false; // if you press numpad0 it will stop pressing buttons
    		}
    	}
    	return 1; //although this will never be reached because of the infinite loop, it is necessary...
    }

  16. The Following User Says Thank You to danng4280 For This Useful Post:

    woodz (05-08-2010)

Similar Threads

  1. [need Help] Key Events
    By ryski123 in forum Programming Tutorial Requests
    Replies: 0
    Last Post: 12-16-2010, 05:31 AM
  2. [Help]Key File[Solved]
    By MJLover in forum Visual Basic Programming
    Replies: 7
    Last Post: 03-21-2010, 11:38 AM
  3. Key Gen Help
    By SethKrieg24 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 6
    Last Post: 03-28-2008, 04:35 PM
  4. I get error key code already in use some one can help???
    By aprill27 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 6
    Last Post: 01-11-2008, 09:37 PM
  5. Kingz Of Key's V2.0 Need Help With Release!
    By Redbull in forum WarRock - International Hacks
    Replies: 13
    Last Post: 08-27-2007, 10:35 AM