China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 05:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] [NT] How can I distinguish different mouse cursor shapes in a game? Using API functions View 894 Replies 1
Original Poster Posted 2007-04-18 22:43 ·  中国 江苏 泰州 兴化市 电信
新手上路
Credits 8
Posts 2
Joined 2007-04-18 18:24
19-year member
UID 85635
Gender Male
Status Offline
I'd like to ask everyone for some advice.

I'm learning to write a script with AutoIt, and I want to tell apart the different mouse cursor shapes in a game. Games all have their own mouse cursor files. When the mouse is moved onto a monster, it has one shape; when it's placed on an NPC, it changes to another shape. What I want is that while the script is running, different values can be assigned to a variable according to different cursor shapes. For example, in the first case, when fighting monsters, it gets CursorID=1; in the second case, when talking to an NPC, it gets CursorID=2. That way, the corresponding statements can be run according to different values.

AutoIt does have MouseGetCursor(), which can recognize 16 kinds of mouse cursor shapes, but only system ones. For non-system ones such as those in games, it can't do it. Why is there no function for recognizing non-system mouse cursors? I don't understand programming, so this question may be pretty newbie-level, but I really hope some expert who knows can clear this up for me.

It seems everyone recommends using screenshot software. Is there no other way? My hardware specs are low, so it'd be best not to rely on third-party software. Can this be done with API functions? Or by modifying the registry, because when a game is installed, it always adds some things to the registry, right? So maybe some cursor information gets added too? Change that a bit, and maybe it'll work? I'm just guessing. Or would VBS work? Anyway, if there's any good method, please teach me.

Also, if there is a way to do it, please explain it in as much detail as possible, because I'm pretty newbie-level. I'm not very familiar with VBS, API, the registry, and so on.

And one more question: a script can read the color of pixels on the screen, but not the mouse cursor, while screenshot software can capture the cursor shape. What's the principle behind that?
Floor 2 Posted 2007-04-19 09:59 ·  中国 广东 广州 黄埔区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
VBS can handle this kind of function. If you're interested, you can look online for the latest version of Key Wizard; it comes with tutorials, including visual recognition.
Forum Jump: