Jump to content

Resolution Issue with Script


Recommended Posts

  • Moderators

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

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.

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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.

Link to comment
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

Link to comment
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

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