beans Posted January 23, 2007 Share Posted January 23, 2007 Hello All,My first message on the board!Found Autoit and was amaised at its capabilities and simplicity but as a starter struggling at even simplest thing I am trying to create.I made a small window with a button which is when clicked suppose to trigger two successive mouse clicks in different parts of the screen.Just moving cursor was easy enough and it went precisely where I wanted it to go relative my Autoit button window. When it came to adding clicks to the script a different story:after moving cursor to the needed location it would click, but after that cursor would move to a different location relative the screen (not my button window).Anyone has any idea on how to do successive clicks on the screen relative the autoit window?here is bit of sript:---------------------------------------#include <GUIConstants.au3>GUICreate ("button clicks",220,50) Opt("GUICoordMode",2)$Button_1 = GUICtrlCreateButton ("activeate 1", 10, 10, 80)GUISetState () ; will display an dialog box with button; Run the GUI until the dialog is closedWhile 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Opt("MouseCoordMode", 0) MouseMove ( 50, 100 , 5 );move relative to window Opt("MouseCoordMode", 0) MouseClick ( "left" );click MouseMove ( 100, 100 , 3 );move to to second location EndSelectWend----------------------------------------- Link to comment Share on other sites More sharing options...
NutherNoob Posted January 23, 2007 Share Posted January 23, 2007 Try MouseCoordMode from the Help file Link to comment Share on other sites More sharing options...
beans Posted January 24, 2007 Author Share Posted January 24, 2007 (edited) Try MouseCoordMode from the Help file Hi NutherNoob,This is what I tried in the script. Is there any other way that MouseCoordMode can be used that fixes the issue? Edited January 24, 2007 by beans Link to comment Share on other sites More sharing options...
beans Posted January 25, 2007 Author Share Posted January 25, 2007 Found the solution. I used WinActivate command since mouse calculates its coordinates from active window! 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