Script that detects aspect ratio automatically

Recommended Posts

ags911 0

ags911 0

H guys, I have a script that uses mouse clicks at different positions on the screen but I realised every UI changes depeding on aspect ratio. I have solved the problem of scaling to different resolutions by using percentages @desktopwidth @desktopheight so now the main issue is making one script that automatically detects aspect ratio like this:

Share this post

Link to post

Share on other sites

ags911 0

ags911 0

Is my script not using control*functions already? ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y]]]] ). Mine is in percentages though to keep it compatible with different screen resolutions in the same aspect ratio so far. My script is used for automatically clicking buttons inside a web app continuously and uses shift+1 to pause and shift+2 to exit.

Share this post

Link to post

Share on other sites

martin 68

martin 68

It is incorrect to say that MouseClick uses relative coordinates (jdelaney). The X,Y coordinates are interpreted according to the MouseCoordMode setting.

If the buttons are drawn rather than being actual controls then Control.... functions won't be any help.

I would expect that if the browser window aspect ratio changed, whether because of the screen dimensions or because someone resized it, then the positions of the buttons, images and text will be difficult to predict. So although I know next to nothing about the IE functions, and nothing about the web page you are interested in, I would expect that as jdelaney says, the IE functions would be the most reliable way to deal with your problem.

Share this post

Link to post

Share on other sites

jdelaney 264

jdelaney 264

It is incorrect to say that MouseClick uses relative coordinates (jdelaney). The X,Y coordinates are interpreted according to the MouseCoordMode setting.

If the buttons are drawn rather than being actual controls then Control.... functions won't be any help.

I would expect that if the browser window aspect ratio changed, whether because of the screen dimensions or because someone resized it, then the positions of the buttons, images and text will be difficult to predict. So although I know next to nothing about the IE functions, and nothing about the web page you are interested in, I would expect that as jdelaney says, the IE functions would be the most reliable way to deal with your problem.

Yes, i was stating in general. Regardless of the option you select, it will be relative within those bounds. I was trying to tell him of a direct, non relative route. I was unaware that the gui was painted, until one of the more recent posts. As most painted applications I know of are games, I stopped responding.

Share this post

Link to post

Share on other sites

ags911 0

ags911 0

It is incorrect to say that MouseClick uses relative coordinates (jdelaney). The X,Y coordinates are interpreted according to the MouseCoordMode setting.

If the buttons are drawn rather than being actual controls then Control.... functions won't be any help.

I would expect that if the browser window aspect ratio changed, whether because of the screen dimensions or because someone resized it, then the positions of the buttons, images and text will be difficult to predict. So although I know next to nothing about the IE functions, and nothing about the web page you are interested in, I would expect that as jdelaney says, the IE functions would be the most reliable way to deal with your problem.

Yes, i was stating in general. Regardless of the option you select, it will be relative within those bounds. I was trying to tell him of a direct, non relative route. I was unaware that the gui was painted, until one of the more recent posts. As most painted applications I know of are games, I stopped responding.

Share this post

Link to post

Share on other sites

Melba23 2,661

Melba23 2,661

That site appears to be a game. If so then you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why this thread will now be locked.

Of course if it is not a game then by all means PM me (with an explanation) and the thread will be reopened.

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort---- Sort arrays on multiple columnsChooseFileFolder---- Single and multiple selections from specified path treeview listingDate_Time_Convert-- Easily convert date/time formats, including the language usedExtMsgBox--------- A highly customisable replacement for MsgBoxGUIExtender-------- Extend and retract multiple sections within a GUIGUIFrame---------- Subdivide GUIs into many adjustable framesGUIListViewEx------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx------ Check/clear parent and child checkboxes in a TreeViewMarquee----------- Scrolling tickertape GUIsNoFocusLines------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify------------- Small notifications on the edge of the displayScrollbars----------Automatically sized scrollbars with a single commandStringSize---------- Automatically size controls to fit textToast-------------- Small GUIs which pop out of the notification area