gerbilbunny Posted March 26, 2008 Share Posted March 26, 2008 Hi, I'm trying to multiply the co-ordintes inside my Mouseclick() function so that i can use my script on many resolutions. Currently its configured for 1280x1024, but was hoping to use the following code to adjust it. CODE$height = IniRead($inilocation, "resoltion", "height", "NotFound") $width = IniRead($inilocation, "resoltuion", "width", "NotFound") ;Set up resoltuion changes $h = ($height/1280) $w = ($width/1024) Then use something like CODEMouseClickDrag("left", 1028 * $h, 333 * $w, 1028 * $h, 710 * $w) MouseClick("left", 612 * $h, 712 * $w) but currently as a bit stuck as it is not working. Thanks in advance Link to comment Share on other sites More sharing options...
junkew Posted March 26, 2008 Share Posted March 26, 2008 Below sample code works I am not sure but it could be that the arguments should be rounded to integers $top=1280 $left=1024 ;Initial settings $height=1280 $width=1024 ;Set up resoltuion changes $h = ($height/1280) $w = ($width/1024) $top = $h * $top $left= $w * $left mousemove($top,$left) ;second settings $height=800 $width=600 ;Set up resoltuion changes $h = ($height/1280) $w = ($width/1024) $top = $h * $top $left= $w * $left mousemove($top,$left) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now