Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Sign in to follow this  
BryceTheCoder

[C#] OSRS blocking my mouse clicks??

Recommended Posts

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 by BryceTheCoder

Share this post


Link to post
Share on other sites

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???

Share this post


Link to post
Share on other sites


Not sure where the edit button is......

but wow!!!! Even the OSI's Mouse button won't click on the OSRS client!! :o

Sooo jagex is blocking fake mouse clicks now!?!? HOW!

And how can we combat this?? :o

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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 :o They blocking fake clicks on real osrs client????????? How...

Share this post


Link to post
Share on other sites

OSI's mouse functions are working fine in OSBuddy and the OSR client for me. Are you on Windows 10?

Share this post


Link to post
Share on other sites
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 :o 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×