Jump to content
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
Link to comment
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.

Link to comment
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...

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...