ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1965

Need help with an autoclicker I am creating for roblox

by sharfooth - 09-13-2018 - 09:26 PM
#1
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);

           }
}
}
Reply
#2
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.
Reply
#3
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
Reply

Users browsing: 4 Guest(s)