Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ Autoclicker

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
KK1
How do I cheat?
Reputation: 0

Joined: 27 Nov 2009
Posts: 2

PostPosted: Fri Nov 27, 2009 8:47 am    Post subject: C++ Autoclicker Reply with quote

Hello,

first off all, i already used the search function Very Happy

but well, i do not know anything about C++ so i thought about asking you Smile

I know it's cocky to just come here and request help, but you would really do me a favor if you could help me..

I just need a simple clicker for BF 2 (shooting attack choppers TV missiles) which starts clicking when i hold left mousebutton and stops when i release.

ofc as fast as possible Razz

please don't flame me too hard ^^ maybe someone of you could help me out Smile

cheers
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Fri Nov 27, 2009 2:01 pm    Post subject: Reply with quote

i got one

Code:

int _tmain(int argc, _TCHAR* argv[])
{
   INPUT input[2];
   input[0].type = INPUT_MOUSE;
   input[0].mi.dx = 0;
   input[0].mi.dy = 0;
   input[0].mi.mouseData = 0;
   input[0].mi.time = 0;

   puts("Clickkk will start when you press F12");

   while(!GetAsyncKeyState(VK_F12)){ Sleep(1); }

   puts("Starting...");
   Sleep(100);

   for(;!GetAsyncKeyState(VK_F12);Sleep(10)){
      input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
      SendInput(1, input, sizeof(INPUT));
   
      input[0].mi.dwFlags = MOUSEEVENTF_LEFTUP;
      SendInput(1, input, sizeof(INPUT));
   }

   puts("Done");
   system("PAUSE");
   return 0;
}

_________________
+~
Back to top
View user's profile Send private message
KK1
How do I cheat?
Reputation: 0

Joined: 27 Nov 2009
Posts: 2

PostPosted: Fri Nov 27, 2009 2:42 pm    Post subject: Reply with quote

Thank you alot that far Smile

What do i have to do with this script now? I downloaded the Dev compiler, do i just have to insert and compile it?

Sorry for my noobiness Very Happy

Thank you Smile
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Fri Nov 27, 2009 4:34 pm    Post subject: Reply with quote

That is not a script, that is a C source code.

I guess you can compile it with Dev-C... but i made this for visual C++. Download Visual C++ express since is free, or Visual Studio with a crack.

_________________
+~
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Nov 27, 2009 4:41 pm    Post subject: Reply with quote

igoticecream wrote:
i got one

Code:

int _tmain(int argc, _TCHAR* argv[])
{
   INPUT input[2];
   input[0].type = INPUT_MOUSE;
   input[0].mi.dx = 0;
   input[0].mi.dy = 0;
   input[0].mi.mouseData = 0;
   input[0].mi.time = 0;

   puts("Clickkk will start when you press F12");

   while(!GetAsyncKeyState(VK_F12)){ Sleep(1); }

   puts("Starting...");
   Sleep(100);

   for(;!GetAsyncKeyState(VK_F12);Sleep(10)){
      input[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
      SendInput(1, input, sizeof(INPUT));
   
      input[0].mi.dwFlags = MOUSEEVENTF_LEFTUP;
      SendInput(1, input, sizeof(INPUT));
   }

   puts("Done");
   system("PAUSE");
   return 0;
}


why are you calling SendInput twice?
also system calls are evil.
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Fri Nov 27, 2009 8:47 pm    Post subject: Reply with quote

yea, i always use _getch(), but no this time lol

twice, push mouse button and then release it

_________________
+~
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Nov 27, 2009 9:21 pm    Post subject: Reply with quote

Code:
INPUT ip[2]   = { 0 };

   ip[0].type          = INPUT_MOUSE;
   ip[0].mi.dwFlags    = MOUSEEVENTF_LEFTDOWN;
   ip[1].type          = INPUT_MOUSE;
   ip[1].mi.dwFlags    = MOUSEEVENTF_LEFTUP;
...

SendInput(2, ip, sizeof(INPUT));


magic.

oh the wonders of what can be accomplished from reading the functions MSDN page:
http://msdn.microsoft.com/en-us/library/ms646310%28VS.85%29.aspx
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Sat Nov 28, 2009 9:20 am    Post subject: Reply with quote

Oh nice, thanks Very Happy didn't know that
_________________
+~
Back to top
View user's profile Send private message
Fendaril
Cheater
Reputation: 0

Joined: 08 Nov 2009
Posts: 27

PostPosted: Sat Nov 28, 2009 11:03 am    Post subject: Reply with quote

MSDN Owns.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites