getcursorpos, with always the same mouse coordinates

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
extra
Newbie
Posts: 3
Joined: Wed Jun 25, 2008 4:10 pm

getcursorpos, with always the same mouse coordinates

Post by extra » Wed Jun 25, 2008 4:40 pm

Hi all,

Im writing a script for a game, and I want to get the mouse coords in a certain game option. To do this im using getcursorpos, but the script always gives me the same coords: 320, 200. Always.

I wrote the following script:

Code: Select all

GetCursorPos>X,Y

Message>Current Position : %X%,%Y%
Anyone can help me with this? thanks.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jun 25, 2008 5:23 pm

Game cursors are sometimes NOT the real cursor. Games need to work at a lower level so the cursor you see is probably custom built and not related in any way to the Windows cursor. So GetCursorPos won't retrieve the position of the game cursor. I suspect this is the issue here, although I could be wrong.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

extra
Newbie
Posts: 3
Joined: Wed Jun 25, 2008 4:10 pm

Post by extra » Wed Jun 25, 2008 10:27 pm

hm yes it looks like thats the problem.. Altough I can make the mouse move with:

Code: Select all

MouseMove>+20,+20
Isn't any other way to get the mouse coords?

Thanks for replying.

offtopic: this program is really good, been using it for a long time.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jun 26, 2008 4:33 am

If the game cursor is actually just a regular graphic then you could use FindImagePos. This won't work for true cursors.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts