Jump to content

Moving the mouse in a 3D game window


Yaunny
 Share

Recommended Posts

Hey, I've been learning AutoIt, but I've run into an issue...

I have a 3D offline game ( so it isnt cheating) that I'm trying to automate to do something. For anyone who may have played, the game is Portal.

The issue here is that none of the Mouse Move commands work in the game window, in fact, it always returns the coordinates at the center, ie: if I have res=1280x1024, and the game is windowed, both of my coords are 640x512, all the time.

My theory is that the game has a mouse movement system like an fps.

The mouse is trapped at the center of the screen.

There is a software cursor. When the mouse is moved, it gets sent back to the center and the software cursor is updated with the amount the mouse moved.

If this is the case, how can I get the position of the software cursor?

I hope you understood all that.

TL;DR

The mouse in the game is "trapped" at the center of the screen, so i cant figure out how to automate the mouse movement to turn the screen where I want it.

the Window Info always says position: 640,512.

Link to comment
Share on other sites

Look into "Opt("MouseCoordMode" ,2)"

and

AutoITWindowInfor / options / coordmode / client

Btw. I am not sure that game isnt offline, but i dont care :D

That may work, but I still cant find the coordinates of where I need to click in-game

Even with setting coordmode to client, the position: on Window Info stays the same..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...