Jump to content

Any screen any resolution n00bie question


foolove
 Share

Recommended Posts

I know there is a way to do this maybe it is pixelchecksuming the screen

I want to do a series of mouseclicks that will work on any screen/video card/ etc

if there isnt a sure fire way from my research pixelchecksum is the most accurate maybe?

Link to comment
Share on other sites

  • Developers

Doubt somebody can clear up anything until you be much clearer in what you really want.

Be exact, be precise, be clear when you ask questions.

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.
  :)

Link to comment
Share on other sites

Intentionally vague questions are vague. And usually they're vague for a reason the rules would frown on.

As for detecting screen resolution, have you looked at the selection of @macros in the help file?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

cool man so it appears for a given script maybe i can do as such be kind im new

@DesktopHeight Height of the desktop screen in pixels. (vertical resolution) @DesktopWidth Width of the desktop screen in pixels. (horizontal resolution)

pass the parameters for those then how would i specify a mouse click and have it autoadjust so if i give my script to a friend it will work on their resolution

Link to comment
Share on other sites

how would i specify a mouse click and have it autoadjust so if i give my script to a friend it will work on their resolution

Math

Have a default resolution, then subtract or add depending on the new size

For simplicity sake

Say your default is 5 Width (@DesktopWidth = 5)

but your friends is 10

you would need an if/then (probably the easiest to start with)

If @DesktopWidth = 5 Then

$mouseX = 2.5 (1/2 of 5, center of screen)

ElseIf @DesktopWidth = 10 Then

$mouseX = 5

EndIf

But that would be a lot of If's

So you could do percentage of Desktop or find the difference between the "default" resolution and the user's resolution and adjust the click position based on the ratio

again, Math

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

$default_resolutionX = 800
$default_resolutionY = 600
$x_ratio = $default_resolutionX / @desktopwidth
$y_ratio = $default_resolutionY / @desktopheight
MouseMove(Round(400 * $x_ratio) , Round(300 * $y_ratio),15)

No If statments required. If the monitor's in 800x600 ... it equals out to "1"

May get into some rounding issues if single pixel precision is required though.

Edit: Fixed a parentheses issue

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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...