Need help with an autoclicker I am creating for roblox

by sharfooth - 09-13-2018 - 09:26 PM
Posts:
3

Reputation:
0

Credits:

Rookie User
Posts:
3

Threads:
1

Joined:
Sep 2018

Likes:
0

Credits:

Reputation:
0

Warning Level:

#1
OP
Posted: 09-13-2018 - 09:26 PM
I am creating an auto-clicker for Roblox that clicks whenever you  hold down the left click. I can't use getasynckeystate for an obvious reason, so I tried sending the click message whenever left click was held. This works for all the games I play except Roblox. I started thinking maybe it was RawInput, so I tried to send a WM_INPUT. I figured each time it's clicking I need to get the data put it into the mouse structure, and that is what would make the hrawinput change and actually properly define the click. I've been trying to figure this out for sometime, but I am stuck on this. The hrawinput is staying the same regardless which doesn't make sense to me. I thought I knew what decides the hrawinput code, but I guess I was wrong. This is wrote as the code.
Code:
#ifdef __MINGW32__
#define _WIN32_WINNT 0x0501
#endif // __MINGW32__
#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
LPVOID mousedown {


};
int main()
{
   int delay,x,y,clickboost,spin,times;
   bool tehee = false;
   bool hey = false;
   RAWMOUSE mouse;
   PUINT numdevices;
   POINT C;
   HWND hwnd;
   while (0==0) {
           if (GetAsyncKeyState(VK_LBUTTON)) {
                   //getting the mouse cursor position to put into the message
                   GetCursorPos(&C);
                   hwnd = GetForegroundWindow();
                   PostMessage(hwnd,WM_LBUTTONDOWN,0,MAKELPARAM(C.x,C.y));
                   //starting to set the parameters in the structure so I can put it into a WM_INPUT and try to fool Roblox into thinking it's a real click
                   mouse.usFlags =MOUSE_MOVE_ABSOLUTE;
                   mouse.usButtonFlags=MOUSEEVENTF_LEFTDOWN;
                   mouse.lLastX = C.x;
                   mouse.lLastY = C.y;
                   PostMessage(hwnd,WM_INPUT,RIM_INPUT,(LPARAM)&mouse);
                   Sleep(20);
                   PostMessage(hwnd,WM_LBUTTONUP,0,MAKELPARAM(C.x,C.y));
                   mouse.usFlags =MOUSE_MOVE_ABSOLUTE;
                   mouse.usButtonFlags=MOUSEEVENTF_LEFTUP;
                   mouse.lLastX = C.x;
                   mouse.lLastY = C.y;
                   PostMessage(hwnd,WM_INPUT,RIM_INPUT,(LPARAM)&mouse);
                   Sleep(20);

           }
}
}

Posts:
3

Reputation:
0

Credits:

Rookie User
Posts:
3

Threads:
1

Joined:
Sep 2018

Likes:
0

Credits:

Reputation:
0

Warning Level:

#2
OP
Posted: 09-13-2018 - 09:48 PM
I am hoping someone can help me, and they can get this to work. I am still trying to get it work right now. I am just trying to see if someone can give me a quick answer because after I solve this problem I'm going to move onto something else.
Posts:
3

Reputation:
0

Credits:

Rookie User
Posts:
3

Threads:
1

Joined:
Sep 2018

Likes:
0

Credits:

Reputation:
0

Warning Level:

#3
OP
Posted: 09-13-2018 - 10:13 PM
Never mind. I should have done more testing before I come here, and the things I am affecting after the second comment have no effect on the hrawinput




USERS BROWSING THIS THREAD:  1 Guest(s)
"Join for the content, stay for the community."
© All Rights Reserved DemonForums.
© 2015-2018 / DemonForums
Server time: 09-20-2018, 06:31 PM (1061 Days Online)