xCausxn Posted February 9, 2013 Share 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:) Link to comment Share on other sites More sharing options...
Bowmore Posted February 9, 2013 Share 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 Link to comment Share on other sites More sharing options...
xCausxn Posted February 9, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 9, 2013 Share 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. Link to comment Share on other sites More sharing options...
water Posted February 9, 2013 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
xCausxn Posted February 9, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted February 9, 2013 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
xCausxn Posted February 9, 2013 Author Share 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 Link to comment Share on other sites More sharing options...
water Posted February 9, 2013 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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