SRL Archive - Help

Moving Mouse


Ransty

2012-09-02 07:07:35

Ok, so i have this script and it works perfectly, but the mouse seems to move to a diffrent spot every time. How can i fix this problem? How can i get it to its exact spot and make it stay there?

CephaXz

2012-09-02 07:09:23

Is it moving slightly downwards? Your y axis need to -50

Failure

2012-09-02 07:17:14

-50 for Runescape or else -22. Talking about Y axis.

Ransty

2012-09-02 07:27:18

Do you mind explaining what you mean by -50? Im sort of confused. This is what i have

MoveMouse(279, 249);

EDIT: Im brand new to simba and programming :\ so sorry for sounding like a noob

Another EDIT: How the hell do i free DTM's? Ive tried the syntax at the bottom but it does nothing. I may aswell post my code here

riwu

2012-09-02 07:35:24

From: Ransty
Do you mind explaining what you mean by -50? Im sort of confused. This is what i have

MoveMouse(279, 249);

EDIT: Im brand new to simba and programming :\ so sorry for sounding like a noob

Another EDIT: How the hell do i free DTM's? Ive tried the syntax at the bottom but it does nothing. I may aswell post my code here

If you are not scripting for RS, call MouseSpeed:=15; instead of SetupSRL;
The coordinates would then be accurate as to what u get with the color picker.
Make sure u target the client with the green crosshair too.

TheDtm:=DTMFromString(blabla);
//after using it…
FreeDTM(TheDTM);

Failure

2012-09-02 07:37:03

If on another application.
MoveMouse(279, 249-22);

If using SMART client.
MoveMouse(279, 249-50);

It's due the bar up Runescape with Forums etc.

Freeing an DTM.

FreeDTM(NAME);

riwu

2012-09-02 07:39:49

From: Failure
If on another application.
MoveMouse(279, 249-22);

If using SMART client.
MoveMouse(279, 249-50);

It's due the bar up Runescape with Forums etc.

Freeing an DTM.

FreeDTM(NAME);

Why would there be an offset on non-RS application?
22 is actually for the login screen, while 50 is for ingame screen. And you have to take it into account as long as you call SetupSRL (which contains SRL_DisableNavBar), whether it's SMART doesn't make a difference.

Ransty

2012-09-02 07:41:54

Thankyou riwu!!! That made sense and it worked :). Respect 4 u

Ransty

2012-09-02 07:48:36

Ok mouse working perfectly but some reason the DMT's wont all free :l Some do but some dont. Before it said 200 DTM's not freed and now it said 70 :D

Failure

2012-09-02 08:29:59

From: riwu
Why would there be an offset on non-RS application?
22 is actually for the login screen, while 50 is for ingame screen. And you have to take it into account as long as you call SetupSRL (which contains SRL_DisableNavBar), whether it's SMART doesn't make a difference.


The 22 is needed when using for something else then Runescape. Like your desktop or something. Atleast for me.

riwu

2012-09-02 08:57:49

From: Failure
The 22 is needed when using for something else then Runescape. Like your desktop or something. Atleast for me.

Well..that's because you called SetupSRL. And since FoundBar would return false on non-RS window it's assuming you are at login screen. Basically dont call SetupSRL at all if not scripting for RS and you won't need any manual offset.

Failure

2012-09-02 13:44:00

From: riwu
Well..that's because you called SetupSRL. And since FoundBar would return false on non-RS window it's assuming you are at login screen. Basically dont call SetupSRL at all if not scripting for RS and you won't need any manual offset.


Ohh oke, thanks explained why. Though I use some functions from SRL on non-RS applications :)

NKN

2012-09-02 13:46:18

You can use SetupSRL

IIRC, MoveMouse isn't a SRL Function, so it shouldn't be affected?

riwu

2012-09-02 20:37:20

From: Failure
Ohh oke, thanks explained why. Though I use some functions from SRL on non-RS applications :)

You can still use the SRL include w/o calling SetupSRL. SetupSRL sets booleans like CheckHPFirst,LoadSRLFonts,SRL_DisableIPLog etc, all of which are quite irrelevant in a PS (except MouseSpeed if you prefer to not to use MoveMouse). If you still want to call SetupSRL, you can call SRL_EnableNavBar right after it to cancel the offset. (Hence achieving the same effect of not calling SetupSRL except that you still load the RS fonts etc).

From: NKN
You can use SetupSRL

IIRC, MoveMouse isn't a SRL Function, so it shouldn't be affected?

Yeah it isn't. But SetupSRL calls SRL_DisableNavBar, which in turn calls ImageSetClientArea & MouseSetClientArea which are simba functions (only added recently in 0.98/99), that affects all mouse functions, search area etc. The previous approach by ggzz does not affect mouse functions as the offset is manually added to srl functions/constants like MSCY (hence all scripts involving hard coded coordinates will break unless updated).