BryceTheCoder Posted January 10, 2018 Share Posted January 10, 2018 (edited) Hello everyone! Just out of curiosity how does Scar simulate your mouse actually left clicking. I am attempting to make my own custom bot in C# and currently have mouse movement pretty damn human. However, whenever I use this mouse_event methods and try to simulate a left-click, it will work ANYWHERE on my actual computer, but when I try to click on the OSRS client, it won't actually click??? [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo); private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; private const int MOUSEEVENTF_RIGHTDOWN = 0x08; private const int MOUSEEVENTF_RIGHTUP = 0x10; public void DoMouseClick() { uint X = (uint)Cursor.Position.X; uint Y = (uint)Cursor.Position.Y; mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); } Does anyone know why it isn't working only for osrs? Also, would love to see some code on how scar does left clicking :] Edited January 10, 2018 by BryceTheCoder Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted January 10, 2018 Author Share Posted January 10, 2018 Also, does the OSI's Mouse actually click and the OSRS client will allow it to click? Or it just simply the way i'm trying to click the mouse??? Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted January 10, 2018 Author Share Posted January 10, 2018 Not sure where the edit button is...... but wow!!!! Even the OSI's Mouse button won't click on the OSRS client!! Sooo jagex is blocking fake mouse clicks now!?!? HOW! And how can we combat this?? Quote Link to comment Share on other sites More sharing options...
Wanted Posted January 11, 2018 Share Posted January 11, 2018 SCAR is coded in Delphi, I assume the mouse controls are done through Delphi's 'abilities'. Haven't heard anything about rs blocking clicks or whatever that is about, are you running OSbuddy, osrs official client, browser, something else? Haven't confirmed this or tested etc. will check in about 10 hours. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted January 11, 2018 Author Share Posted January 11, 2018 9 hours ago, Wanted said: SCAR is coded in Delphi, I assume the mouse controls are done through Delphi's 'abilities'. Haven't heard anything about rs blocking clicks or whatever that is about, are you running OSbuddy, osrs official client, browser, something else? Haven't confirmed this or tested etc. will check in about 10 hours. Extremely weird results I just found....... 0.o If I run a script that just simply clicks somewhere, it will NOT click the mouse on the real osrs client. If I run that same script on the browser client in IE, it will actually click... WTF They blocking fake clicks on real osrs client????????? How... Quote Link to comment Share on other sites More sharing options...
Wanted Posted January 17, 2018 Share Posted January 17, 2018 OSI's mouse functions are working fine in OSBuddy and the OSR client for me. Are you on Windows 10? Quote Link to comment Share on other sites More sharing options...
ti.teg.tnod.I Posted March 19, 2018 Share Posted March 19, 2018 On 1/11/2018 at 1:34 PM, BryceTheCoder said: Extremely weird results I just found....... 0.o If I run a script that just simply clicks somewhere, it will NOT click the mouse on the real osrs client. If I run that same script on the browser client in IE, it will actually click... WTF They blocking fake clicks on real osrs client????????? How... It's probably the way the clicks are done. I believe there's a way to simulate a mouse click in a control, which fails for many 3D applications (DirectX), but SCAR's controls simulate a global mouse click. I can't see your code though, so I couldn't say for sure. Quote Link to comment Share on other sites More sharing options...
ti.teg.tnod.I Posted March 19, 2018 Share Posted March 19, 2018 Oof, can't edit my post. I was really sleepy, I see the code. My question would be how user32.dll handles mouse clicks. Or you could just look for something open-source which actually works, and see how they do mouse clicks. Quote Link to comment Share on other sites More sharing options...