|
-
January 7th, 2009, 07:44 PM
#1
Cout Statement Not Showing Up
I know that this is very sloppy coding, but all the lines here
Code:
int decision;
cout << "Enter 1 to Shoot CTs in the face" << endl;
cout << "Enter 2 to Find a Colour" << endl;
cin >> decision;
switch (decision){
case 1:
anumber = 2040097;
hover();
break;
case 2:
Don't show up when the project is compiled. The whole idea of the program is to click when you move your mouse over a certain colour (made for use with the game counter-strike in this case)
Here's the whole program, there are lots of errors but it still runs.
Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <winuser.h>
#include <math.h>
void hover();
using namespace std;
int anumber = 0;
int main(int argc, char *argv[])
{
int decision;
cout << "Enter 1 to Shoot CTs in the face" << endl;
cout << "Enter 2 to Find a Colour" << endl;
cin >> decision;
switch (decision){
case 1:
anumber = 2040097;
hover();
break;
case 2:
cout << "What colour do you want to find?" << endl; // CT head: 2040097
cin >> anumber;
hover();
}
}
void hover()
{
cout << "In hover";
HDC screen = GetDC(HWND_DESKTOP);
POINT cursorPos;
GetCursorPos(&cursorPos); // Get the cursor position
float x = 0;
x = cursorPos.x; // Access the variables
float y = 0;
y = cursorPos.y;
int *xint = round(x); // Convert to int
int *yint = round(y);
if (GetPixel(screen, xint, yint) == anumber){ // Compare the coords to the colour
mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0); // Click
mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0);
cout << "clicked." << endl;
hover(); // Repeat
}
else hover(); // Repeat
system("PAUSE");
}
-
January 8th, 2009, 11:48 AM
#2
Re: Cout Statement Not Showing Up
Just to make sure, are you compiling this as a console program or as a windows program? What subsystem do you tell the compiler to use as target?
-
January 10th, 2009, 04:52 PM
#3
Re: Cout Statement Not Showing Up
Pretty sure this guy's using Console windows. When compiling, try turn off "Do no show console window."
-
January 11th, 2009, 09:27 PM
#4
Re: Cout Statement Not Showing Up
I'm compiling using dev-c++, console app. And the display is
What colour do you want to find?
(enter prompt)
So the window does show up..
-
January 12th, 2009, 09:01 AM
#5
Re: Cout Statement Not Showing Up
Sounds to me like you're trying to create a Counter-Strike aimbot.
-
January 18th, 2009, 01:13 PM
#6
Re: Cout Statement Not Showing Up
similar to an aimbot, but a different idea
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|