Jump to content
AC Tool Forums
Sign in to follow this  
alistair

Get active window position.

Recommended Posts

Hi all,

I am trying to use AC tool to create some macros around a game where I have multiple copies open in virtual windows.   Is there a way to get the co-ordinates of an active window in any way – say the top left corner of a window or similar so I can offset the mousepos commands so that any changes in window position don’t affect the macro?

 

thanks

Share this post


Link to post
Share on other sites

@alistair My first question to you is this. Are you actually running the game a multiple VMs? If that is the case, then there is no way of actually getting the coordinates of the game window being displayed in a VM's window. All that you can do, is get the coordinates of the VM's windows.

 

Now if you are looking for a way to get the window coordinates of all the windows. All at once before doing so. Then the Answer to your question is NO.

The only way AC Tool will know the coordinates of a window, or any window, is once it makes it the Active Window.

 

In order to get the coordinates of the VM windows, you have to have each window have a different Title/Caption. (That bit of text at the top of the window.)

Once you have done that I would Read your AC Tool Help file, and pay particular attention to the Special Variables portion of it.

And then set the VM window as the active window before getting/using the windows coordinates.

Share this post


Link to post
Share on other sites

What VM program are you using? I find it interesting to try a few ideas by opening a few windows of a game I play and do some testing.

Opening each window and waiting for focus before the code continues is the way to do it as Wabbit suggested, that's how I use 2 windows in-game, but would like to try multiple windows in a VM.

Share this post


Link to post
Share on other sites

@The WABBIT sorry wasn't particularly clear there.  I am looking to get the coordinates of an active window, specifically a blue stacks instance.   Thanks for the pointer I found the special variables needed, not sure how I missed them.

@Ego   I am using bluestacks - minding farms on a mobile game.   Makes a change all previous macros were E&B. bluestacks.txt

Edited by alistair

Share this post


Link to post
Share on other sites

@Ego As I have stated, you can not get the window stats of a Window for a Game/App that is running in a VM. Because, all that AC Tool, and Divide for that matter, see is the VM's windows. Not what windows are being display in it. But, using GetColor, IsColor, and using Objects would still work. As that really does not work based on the Windows size and position. It is based on a specific Pixel, or set of pixels, that are being displayed on the Desktop. But, if you have the size and coordinates of the VM's window. then you can figure out the placement, just like E&B, of where to search.

 

@alistair as a reminder, those special variables will only have a value set for the Window that you want to work with. Only after using the SetActiveWindow command. So, they are updated every time the SetActiveWindow command is executed, no before.

As for the ScreenWidth and ScreenHeight Special Variables. The show the Desktop screen resolution's width & height. (In a Multi-Monitor system, this would be the current resolution of the monitor that is the Primary Monitor, or Monitor 1.) And just like the Window versions, these two will only be updated when the SetActiveWindow command is used.

 

And I also, know of BlueStacks! I just have not used it in years. It is just to resource hungry for even my best laptop. And most things run slow, in some cases too slow. Don't have a Desktop. 😭

Also, remember, each and every BlueStacks Window needs to have a different Caption/Title in order for you to change between them. Or else this will never work.

Share this post


Link to post
Share on other sites

Thanks for the info Wabbit.

I'm looking at just opening a few windows via VM/sandbox and moving between them, a modified version of the 6 player log in macro I coded ages ago.

E&B allows multi windows, ace online doesn't, so need to run sandboxs.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.