foolove Posted October 5, 2011 Share Posted October 5, 2011 (edited) the mouse click at the bottom doesnt seem to work not really sure the other code is right either #include "misc.au3" While 1 = 1 if _ispressed("0d") then exitloop; press the ENTER key to exit the loop $coord1 = PixelSearch( 538, 463, 626, 479, 0xE7E7E7 ) If Not @error Then MouseClick("left", $coord1[0], $coord1[1], 1) EndIf ;sleep(1000) $FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE ) If Not @error Then MouseClick("left", $FindDock[0], $FindDock[1], 1) Else $FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE ) If Not @error Then MouseClick("left", $FindDock2[0], $FindDock2[1], 1) EndIf EndIf $FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE ) If Not @error Then MouseClick("left", $FindDock3[0], $FindDock3[1], 1) Else $FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE ) If Not @error Then MouseClick("left", $FindDock4[0], $FindDock4[1], 1) EndIf EndIf WEnd MouseClick("left", 1124, 591, 1, 0) Send("Welcome testing 123!!!") Send("{ENTER}") Edited October 5, 2011 by foolove Link to comment Share on other sites More sharing options...
foolove Posted October 5, 2011 Author Share Posted October 5, 2011 Tried this getting error in expression on ElseIf line $FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE )If Not @error Then MouseClick("left", $FindDock[0], $FindDock[1], 1)ElseIf $FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE )If Not @error Then MouseClick("left", $FindDock2[0], $FindDock2[1], 1)ElseIf$FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE )If Not @error Then MouseClick("left", $FindDock3[0], $FindDock3[1], 1)Else $FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE )If Not @error Then MouseClick("left", $FindDock4[0], $FindDock4[1], 1)EndIfEndIfEndIfEndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 5, 2011 Moderators Share Posted October 5, 2011 foolove, When using _IsPressed you will only detect the {ENTER} key being pressed if it is actually pressed at the moment your script calls the function. Did you keep it pressed long enough? By the way if you are using _IsPressed in a loop like that, you should open user32.dll and pass the handle as explained in the Help file. However if you want to avoid keeping the {ENTER} key pressed for such a long time then I suggest using a HotKey along these lines:HotKeySet("{ENTER}", "On_ExitLoop") $fFlag = True While $fFlag ; This keeps the loop active untilt you set the flag to False Sleep(10) WEnd MsgBox(0, "Hi", "Here") Func On_ExitLoop() $fFlag = False EndFuncAs to the rest of your script, it seems to work as far as I can tell. I do not have the same image as you to test the PixelSearch returns, but substituting dummy position and error values makes it work as I expect. What do you think is going wrong? M23 P.S. When you post code please use Code tags. Put [autoit] before and [/autoit] after your posted code. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see 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 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