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 


Auto Clicker crashes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
TehBlue
Newbie cheater
Reputation: 0

Joined: 14 Jul 2008
Posts: 10

PostPosted: Tue Nov 18, 2008 4:17 pm    Post subject: Auto Clicker crashes Reply with quote

Im makeing a simple auto clicker but once i press the hotkey to start it the auto clicker crashes. heres the code:

Code:


if(GetAsyncKeyState(VK_F11) && AC == false){
               AC = true;
               cout << "AC on\n";
                           while( AC == true ){
                  HWND msWin = FindWindow( L"MapleStoryClass", NULL );
                  PostMessageX(msWin, WM_LBUTTONDOWN, NULL, NULL );
                  PostMessageX(msWin, WM_LBUTTONUP, NULL, NULL );
                  Sleep(250);
                  if(GetAsyncKeyState(VK_F12)){
                     AC = false;
                     cout << "AC off\n";
                     break;
                  }
               }


Does anyone know whats wrong?


Last edited by TehBlue on Tue Nov 18, 2008 4:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Nov 18, 2008 4:20 pm    Post subject: Reply with quote

Well first off you need a wParam+lParam for your PostMessageX. If you want to click where the mouse is, try using GetCursorPos and fill in a POINT structure and put the x/y into the LOWORD and HIWORD of lParam respectively.

I have a feeling there is something else fundamentally wrong though since it crashes. I can't help any further though since I don't code C++.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Tue Nov 18, 2008 4:24 pm    Post subject: Reply with quote

HWND msWin = FindWindow( L"MapleStoryClass", NULL );

WHY DO PEOPLE DO THIS IN A LOOP?
Back to top
View user's profile Send private message MSN Messenger
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Tue Nov 18, 2008 4:48 pm    Post subject: Reply with quote

noz3001 wrote:
HWND msWin = FindWindow( L"MapleStoryClass", NULL );

WHY DO PEOPLE DO THIS IN A LOOP?

Cuz they dont care about performance, they just want it to work :?
And most of them don't even know why it would make any diff outside the loop.

_________________
Gone
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