• Advertisement
Sign in to follow this  

C++ Auto Clicker Macro

This topic is 3341 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Happy Holidays. :P I've been making autoclicker macros for my vid games using .ahk for about a year now, and I thought I need to try and learn a language that is more commonly used. :) This is what a basic .ahk looks like. _______________________________________________________________ ; <COMPILER: v1.0.46.7> ; SetBatchLines -1 Numlock:: Suspend Var:=!Var ; Toggles between 0 and 1 If Var { SoundBeep, 750, 100 SoundBeep, 750, 100 } Else SoundBeep,1000 , 300 Return ; SetBatchLines -1 $*LButton:: { Loop { MouseClick, Left,,, 1, 0 SetMouseDelay, 47 GetKeyState, state, LBUTTON, P if state = U { Break } } } Return _______________________________________________________________ Now, I'm trying to structure something in C++ that is similar. I want the program/macro to auto click when you hold down the left mouse button in the current window you are in, and I want to suspend the hotkey using the numlock key. Can anyone help me please? this is what I have so far... I think.:( _______________________________________________________________ BOOL RegisterHotKey( HWND hWnd, // window to receive hot-key notification int id, // identifier of hot key UINT fsModifiers, // key-modifier flags UINT vk // virtual-key code ); RegisterHotKey(hWndA, 200, WM_LBUTTONDOWN , 'R'); //Simulate left mouse click SendInput(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); Sleep .47 _______________________________________________________________ Sorry in advance at being fail. :(

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement