jackiemagpie Posted June 27, 2020 Share Posted June 27, 2020 Hi I'm new in programming and when I try to wait colour to continue the action, I get this error. Variable used without being declared.: $waitpixel=PixelSearch (673,154,842,302, $WaitPixelColor,0xF8F4F8) $waitpixel=PixelSearch (673,154,842,302, ^ ERROR And That's my code. Anyone knows why getting error ? While 1 $waitpixel=PixelSearch (673,154,842,302, $WaitPixelColor,0xF8F4F8) If Not @error Then ExitLoop Sleep(10) WEnd Link to comment Share on other sites More sharing options...
water Posted June 27, 2020 Share Posted June 27, 2020 Welcome to AutoIt and the forum! The error message perfectly explains what causes the error 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 Link to comment Share on other sites More sharing options...
Musashi Posted June 27, 2020 Share Posted June 27, 2020 Local $WaitPixelColor = 0xF8F4F8, $waitpixel While 1 $waitpixel=PixelSearch (673,154,842,302, $WaitPixelColor) If Not @error Then ExitLoop Sleep(10) WEnd jackiemagpie 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
jackiemagpie Posted June 27, 2020 Author Share Posted June 27, 2020 1 minute ago, water said: Welcome to AutoIt and the forum! The error message perfectly explains what causes the error yeah but how can I declare the variable, that what I want to know ? Link to comment Share on other sites More sharing options...
Zedna Posted June 27, 2020 Share Posted June 27, 2020 While 1 PixelSearch(673,154,842,302,0xF8F4F8) If Not @error Then ExitLoop Sleep(10) WEnd jackiemagpie 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
jackiemagpie Posted June 27, 2020 Author Share Posted June 27, 2020 1 minute ago, Musashi said: Local $WaitPixelColor = 0xF8F4F8, $waitpixel While 1 $waitpixel=PixelSearch (673,154,842,302, $WaitPixelColor) If Not @error Then ExitLoop Sleep(10) WEnd Thanks it works Link to comment Share on other sites More sharing options...
jackiemagpie Posted June 27, 2020 Author Share Posted June 27, 2020 This works too thanks Link to comment Share on other sites More sharing options...
water Posted June 27, 2020 Share Posted June 27, 2020 17 minutes ago, jackiemagpie said: yeah but how can I declare the variable, that what I want to know ? Declaring variables is one of the basic steps when starting to write scripts in AutoIt and is perfectly explained in the help file! 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 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