UncleLouie909 Posted September 28, 2018 Share Posted September 28, 2018 First let me say I am used to programming in Java but learning AutoIt so far has been a blast! My Problem: I have a list of coordinates, for argument sake lets say they are as follows: Coord1 is (100,100) Coord2 is (200,200) Coord3 is (300,300) I want to click all three of these coordinates with Mouseclick func. I want the order of the clicks to be random...For example First loop through it clicks: 1, 3, 2 Second loop through it clicks: 3, 1, 2 Third loop through it clicks: 2, 1, 3 and so on and so on. Any leads, hints, tips, and pointers would be very helpful. Thank you in advance! Link to comment Share on other sites More sharing options...
jdelaney Posted September 28, 2018 Share Posted September 28, 2018 (edited) #include <Array.au3> Local $a[3][2] = [[100,100],[200,200],[300,300]] While True $aTemp = $a While UBound($aTemp) $iRandom = Random(0,UBound($aTemp)-1,1) ConsoleWrite($iRandom & @CRLF) MouseClick("left",$aTemp[$iRandom][0],$aTemp[$iRandom][1]) _ArrayDelete($aTemp,$iRandom) WEnd MsgBox(1,1,1) WEnd Edited September 28, 2018 by jdelaney UncleLouie909 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
UncleLouie909 Posted September 28, 2018 Author Share Posted September 28, 2018 Ill give it a try! Good looks. I didnt know how different it was to make an array/list in autoit. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 28, 2018 Moderators Share Posted September 28, 2018 As you progress with AutoIt, I would suggest moving soon from inconsistent methods like mouseclicks to using controlclick. That way, it doesn't matter if the window is visible or not, or where on the screen the control is. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
UncleLouie909 Posted September 28, 2018 Author Share Posted September 28, 2018 Can you explain a tad more about the differences in the presence of the window. That could end up being extremely useful for me. So you can have the program minimized and still have the clicks clicking away? If you don't feel like explaining, you can Link me and ill do some light reading. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted September 28, 2018 Share Posted September 28, 2018 @UncleLouie909 In short, there are several ways to automate a window. You can do it via mouse clicks, which is the "immediate" and easiest method, but, not the best one, since, if the window moves, or another window appears, or any other message which "interferes" with you script, your script will fail. To avoid all of these, there are Control* functions ( you can take a look in the Help file about those ), which let you use directly the titles, handles, classnames... of the windows/controls you are automating, making things "easier", since, even if your window moves, or lost focus, you can set in with Win* functions, to let your script work at its best. Then, to work with controls, there are a tons of functions which will let you click, send, set data... almost every control in your window. To get the titles, handles, and all of the information needed to automate your windows/controls, there's a tool which comes with AutoIt, called AutoItWindowInfoTool; open it, and have fun! And then, in some other special cases, when you are not able to use Control* functions to automate you windows, there is another one "tool" which is called UIAutomation. Take a look in the forum, especially the post of @junkew, which made a very good explanation of UIAutomation, and when it should be used. Hope I made you things a little bit clearer now Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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