Sign in to follow this  
Followers 0
Rajveer

Resolution Issue with Script

17 posts in this topic

I have created script on the resolution of 1280X720 but when I try to run the same script on the system whose resolution is 1024X768 then script won't work properly...please suggest what to do...

Share this post


Link to post
Share on other sites



I have created script on the resolution of 1280X720 but when I try to run the same script on the system whose resolution is 1024X768 then script won't work properly...please suggest what to do...

Well... what would you like us to do exactly? You already know what you did, and you know the difference... seems like you have 2 choices.

1. A total re-write adjusting for each type of resolution (or subtraction/addition if you want) there could be.

2. A total re-write using Client Coords rather than Screen Coords (The safer bet).


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I have created script on the resolution of 1280X720 but when I try to run the same script on the system whose resolution is 1024X768 then script won't work properly...please suggest what to do...

I want some method which made my script able to run on both the resolutions without any re-write of script for different resolution

Share this post


Link to post
Share on other sites

I want some method which made my script able to run on both the resolutions without any re-write of script for different resolution

I just gave that to you in "2.", regardless of what you do, you are going to need to do "Math" or New coords (Client ones).

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I just gave that to you in "2.", regardless of what you do, you are going to need to do "Math" or New coords (Client ones).

If you don't mind, can you give me a simple example ...plz

Share this post


Link to post
Share on other sites

I just gave that to you in "2.", regardless of what you do, you are going to need to do "Math" or New coords (Client ones).

You could use this: http://msdn.microsoft.com/en-us/library/ms533179(VS.85).aspx as a dllcall, pass all your current coordinates you are using to it, and mark the changes, then make those changes in your script.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

You could use this: http://msdn.microsoft.com/en-us/library/ms533179(VS.85).aspx as a dllcall, pass all your current coordinates you are using to it, and mark the changes, then make those changes in your script.

can't we do it without changing the co-ordinates.....actually I want a method that automatically adjust the co-ordinates according to the screen resolution.......can we do this in autoIT script Edited by Rajveer

Share this post


Link to post
Share on other sites

can't we do it without changing the co-ordinates.....actually I want a method that automatically adjust the co-ordinates according to the screen resolution.......can we do this ..?

No... not without writing a custom function to do it, and then wrapping all your current coordinates in a function call that will do the math for you... and you can't really get any help, as you've failed to provide anything to help with.

Things for future/current use to look at:

About Coordinates: http://msdn.microsoft.com/en-us/library/ms229598.aspx

Things in autoit to look up when using coordinates:

Help file: Index + Opt + PixelCoordMode and MouseCoordMode

AutoItInfo.exe: Options + Coord Mode


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

No... not without writing a custom function to do it, and then wrapping all your current coordinates in a function call that will do the math for you... and you can't really get any help, as you've failed to provide anything to help with.

Things for future/current use to look at:

About Coordinates: http://msdn.microsoft.com/en-us/library/ms229598.aspx

Things in autoit to look up when using coordinates:

Help file: Index + Opt + PixelCoordMode and MouseCoordMode

AutoItInfo.exe: Options + Coord Mode

The below are lines from my script which is written according to the 1280X720 Resolution but pls tell me how can I run the same below lines without changing the coordinates manually on the screen resolution 1024X768

MouseClick("Left",237,503,1)

Sleep ($const2)

MouseClick("Left",196,528,1)

Sleep ($const2)

MouseClick("Right",300,500,1) ;To Save

MouseClick("Left",330,564,1) ;Saved

Sleep ($const3)

MouseClick("Left",257,278,1)

Edited by Rajveer

Share this post


Link to post
Share on other sites

using mouseclicks with "absolute" coordinates only work for the specific resolutions that you have setup, other than that you will have to CALCULATE according to the screen resolution where to click

Share this post


Link to post
Share on other sites

using mouseclicks with "absolute" coordinates only work for the specific resolutions that you have setup, other than that you will have to CALCULATE according to the screen resolution where to click

That I know very well.....I want a custom function that do it automatically rather than calculating manually

Share this post


Link to post
Share on other sites

That I know very well.....I want a custom function that do it automatically rather than calculating manually

It's sad... I've told you many ways to do it... You just seem to lazy to put any thought or effort into doing it.

The easiest for you would be math...

Look at @DesktopWidth and @DesktopHeight ... you should be able to get what you want with some addition and or subtraction from what you've already used.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I have created script on the resolution of 1280X720 but when I try to run the same script on the system whose resolution is 1024X768 then script won't work properly...please suggest what to do...

Would this be of any use to you - ChangeResolution (assuming of course you are happy changing the 1024x768 system)?

Share this post


Link to post
Share on other sites

You know that 1024 is 80% of 1280. Keeping the same proportions, calculate 80% of your x-axis coords. Then do the same thing for the vertical. I don't say it works 100% sure, and this only my personal thought about the solution. Try it and see if it works.

Share this post


Link to post
Share on other sites

You know that 1024 is 80% of 1280. Keeping the same proportions, calculate 80% of your x-axis coords. Then do the same thing for the vertical. I don't say it works 100% sure, and this only my personal thought about the solution. Try it and see if it works.

That trick is not at all working....please suggest some other way

Share this post


Link to post
Share on other sites

The below are lines from my script which is written according to the 1280X720 Resolution but pls tell me how can I run the same below lines without changing the coordinates manually on the screen resolution 1024X768

MouseClick("Left",237,503,1)

Sleep ($const2)

MouseClick("Left",196,528,1)

Sleep ($const2)

MouseClick("Right",300,500,1) ;To Save

MouseClick("Left",330,564,1) ;Saved

Sleep ($const3)

MouseClick("Left",257,278,1)

Just take that 5 damn coordinates again !!! muttley

Share this post


Link to post
Share on other sites

its a useless topic now - we already told this guy 5 times how to solve his problem but he refuses to take advice - so its useless..

Share this post


Link to post
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
Sign in to follow this  
Followers 0