Problem in making auto clicker

So the prob is that my auto clicker working out of the game but inside i can only write "2" not use the skill that set on the "2" key
dis is the bugged part i guess:
1
2
3
4
5
6
7
    while (true) {
        if (GetAsyncKeyState(VK_MBUTTON))
        {

         
            keybd_event(0x32, 0, 0, 0);
            keybd_event(0x32, 0, KEYEVENTF_KEYUP, 0);


Ty in advance !
Last edited on
I don't know how the keybd_event function works. It looks like the function may be deprecated or at least superseded by SendInput.

A simple left-click (down + up) can be done with the following code:
http://www.cplusplus.com/forum/windows/24162/#msg129336
Last edited on
Ty Friend for the fast comment, i will learn in RN
still didnt work i tried everything... i can spam "2" on the chat but cant trigger the skill

dis is the whole code take a look
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#define WINVER 0x0500
#include <Windows.h>
#include <iostream>
#include <winuser.h>
using namespace std;


int main() {

   

    float x;
    system("title Auto Clicker");
b:
   

    cout << "Choose click delay(seconds)\n";
    cin >> x;
    system("cls");
    cout << "==============================\n" << "Credits: \n"<< "\n" << "Auto Clicker by Omri and David\n" << "\n" <<"            ------            \n" << "\n" << "DEL >> Choose new clicker delay\n" << "\n" << "END >> Exit Auto clicker\n"<< "\n" << "Current CPS: " << 1000/ (x*1000) << "\n" << "==============================\n";
    x = x * 1000;
    if (x < 1) {
        x = 1;
    }
a:
    system("pause");


    while (true) {
        if (GetAsyncKeyState(VK_MBUTTON))
        {

            INPUT ip[1];
            ZeroMemory(ip, sizeof(ip));
            ip[0].type = INPUT_KEYBOARD;
            ip[0].ki.wVk = 0x32;

         
            ip[1].ki.dwFlags = KEYEVENTF_KEYUP;

            UINT uSent = SendInput(ARRAYSIZE(ip), ip, sizeof(INPUT));
           
        }
         

            Sleep(x);

        }
        if (GetAsyncKeyState(VK_END)) {
            return 0;
        }
        if (GetAsyncKeyState(VK_DELETE)) {
            goto b;
        }
         
      
      
    

    goto a;
    return 0;
}
the fixed source if anyone need

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#define WINVER 0x0500
#include <Windows.h>
#include <iostream>
#include <winuser.h>
using namespace std;


int main() {

    
    //char touched;
    //int X, Y;
    //SetCursorPos(X = 1280, Y = 720);
   //touched = false;
   

    float x;
    system("title Auto Clicker");
b:
   

    cout << "Choose click delay(seconds)\n";
    cin >> x;
    system("cls");
    cout << "==============================\n" << "Credits: \n"<< "\n" << "Auto Clicker by Omri and David\n" << "\n" <<"            ------            \n" << "\n" << "DEL >> Choose new clicker delay\n" << "\n" << "END >> Exit Auto clicker\n"<< "\n" << "Current CPS: " << 1000/ (x*1000) << "\n" << "==============================\n";
    x = x * 1000;
    if (x < 1) {
        x = 1;
    }
a:
    system("pause");


    while (true) {
        if (GetAsyncKeyState(VK_MBUTTON))
        {
            INPUT ip;
            WORD vkey = 0x32;
            ip.type = INPUT_KEYBOARD;
            ip.ki.wScan = MapVirtualKey(vkey, MAPVK_VK_TO_VSC);
            ip.ki.time = 0;
            ip.ki.dwExtraInfo = 0;
            ip.ki.wVk = vkey;
            ip.ki.dwFlags = 0;
            SendInput(1, &ip, sizeof(INPUT));

            ip.ki.dwFlags = KEYEVENTF_KEYUP;
            SendInput(1, &ip, sizeof(INPUT));

        }


        Sleep(x);


        if (GetAsyncKeyState(VK_END)) {
            return 0;
        }
        if (GetAsyncKeyState(VK_DELETE)) {
            goto b;
        }

    }
      
    

    goto a;
    return 0;
}
Last edited on
Topic archived. No new replies allowed.