Jump to content

Recommended Posts

Posted

I am new to autoit is there a way to detect resolution and if i  move my script to another computer with different graphics card and resolution within my screen the mouse will move to same area of screen?

  • Developers
Posted
51 minutes ago, coder007 said:

is there a way to detect resolution

Sure and guess you didn't search the helpfile first? ;) 
In the macro's section you will find:

@DesktopHeight Height of the primary display in pixels. (Vertical resolution) 
@DesktopWidth Width of the primary display in pixels. (Horizontal resolution)

 

52 minutes ago, coder007 said:

mouse will move to same area of screen

That is something you will need to figure out as that heavily depends on what you are trying to do.
...so what exactly is the plan?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Simple math :

#include <Constants.au3>

Global Const $BaseX = 800, $BaseY = 600
MouseClickEX ("left",250,150,1)

Func MouseClickEX ($sButton, $iPosX, $iPosY, $iClicks = 1, $iSpeed = 10)
  $iPosX = int ($iPosX/$BaseX*@DesktopWidth)
  $iPosY = int ($iPosY/$BaseY*@DesktopHeight)
  ConsoleWrite ("Clicking now " & $iPosX & "/" & $iPosY & @CRLF)
  MouseClick ($sButton, $iPosX, $iPosY, $iClicks, $iSpeed)
EndFunc

 

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
  • Recently Browsing   0 members

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