Log in

View Full Version : Moving Mouse



Ransty
09-02-2012, 11:07 AM
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
09-02-2012, 11:09 AM
Is it moving slightly downwards? Your y axis need to -50

Failure
09-02-2012, 11:17 AM
-50 for Runescape or else -22. Talking about Y axis.

Ransty
09-02-2012, 11:27 AM
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
09-02-2012, 11:35 AM
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
09-02-2012, 11:37 AM
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
09-02-2012, 11:39 AM
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
09-02-2012, 11:41 AM
Thankyou riwu!!! That made sense and it worked :). Respect 4 u

Ransty
09-02-2012, 11:48 AM
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
09-02-2012, 12:29 PM
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
09-02-2012, 12:57 PM
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
09-02-2012, 05:44 PM
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
09-02-2012, 05:46 PM
You can use SetupSRL

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

riwu
09-03-2012, 12:37 AM
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).


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).