xCausxn Posted February 9, 2013 Posted February 9, 2013 Description says it all. $coord = PixelSearch(744, 157, 758, 225, 0x181919, 10) If $coord Then MouseClick("left", 894, 169, 1, 20) sleep(526) MouseClick("left", 803, 79, 1, 20) sleep(200) MouseClick("left", 70, 545, 1, 20) EndIf This is what i attempted but didnt seem to work i am a noob so please help:)
Bowmore Posted February 9, 2013 Posted February 9, 2013 Have a look in the help file and check what the return value of PixelSearch() is you will then realize why If $coord Then is not working as you expect it to. "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
xCausxn Posted February 9, 2013 Author Posted February 9, 2013 Ok thanks so if i changed coord to Array[0] would that work. I am a real newbie thanks for the quick response
somdcomputerguy Posted February 9, 2013 Posted February 9, 2013 Have a look again, and see the working example code at the bottom. Just about every function in the Help file has working example code. That should help you understand how it works. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
water Posted February 9, 2013 Posted February 9, 2013 Another question: Which program to you try to automate? Pixelsearch is very, very slow. So there might be a better solution. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
xCausxn Posted February 9, 2013 Author Posted February 9, 2013 Ok so if i change $coord = PixelSearch(744, 157, 758, 225, 0x181919, 10) If $coord Then MouseClick("left", 894, 169, 1, 20) sleep(526) MouseClick("left", 803, 79, 1, 20) sleep(200) MouseClick("left", 70, 545, 1, 20) EndIf$coord = PixelSearch(744, 157, 758, 225, 0x181919, 10) If $coord[0] Then MouseClick("left", 894, 169, 1, 20) sleep(526) MouseClick("left", 803, 79, 1, 20) sleep(200) MouseClick("left", 70, 545, 1, 20) EndIf TO Would it work
water Posted February 9, 2013 Posted February 9, 2013 Please check the help file again (and the examples at the end of the help file). Not the coordinates are checked but macro @error to see if the specified color was found. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
xCausxn Posted February 9, 2013 Author Posted February 9, 2013 Ok i think im interpreting the help file wrong, If i set "If Not @error Then" it will run the mouseclick whereas if it set doesnt match it will not run
water Posted February 9, 2013 Posted February 9, 2013 Correct, that's how the script is supposed to work. But my question is still unanswered: Which application do you try to automate? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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