Zwettenduvel Posted September 25, 2019 Share Posted September 25, 2019 (edited) Hello, I want to make a function that loops untill one pixel in a group of pixels meets a certain condition (being red). I have this for now and it works but I want to make the code more compact: While 1 If pixelgetcolor(258,200) =0xFF0000 then ExitLoop If pixelgetcolor(258,201) =0xFF0000 then ExitLoop If pixelgetcolor(258,202) =0xFF0000 then ExitLoop If pixelgetcolor(258,203) =0xFF0000 then ExitLoop If pixelgetcolor(258,204) =0xFF0000 then ExitLoop If pixelgetcolor(259,200) =0xFF0000 then ExitLoop If pixelgetcolor(259,201) =0xFF0000 then ExitLoop If pixelgetcolor(259,202) =0xFF0000 then ExitLoop If pixelgetcolor(259,203) =0xFF0000 then ExitLoop If pixelgetcolor(259,204) =0xFF0000 then ExitLoop If pixelgetcolor(260,200) =0xFF0000 then ExitLoop If pixelgetcolor(260,201) =0xFF0000 then ExitLoop If pixelgetcolor(260,202) =0xFF0000 then ExitLoop If pixelgetcolor(260,203) =0xFF0000 then ExitLoop If pixelgetcolor(260,204) =0xFF0000 then ExitLoop If pixelgetcolor(261,200) =0xFF0000 then ExitLoop If pixelgetcolor(261,201) =0xFF0000 then ExitLoop If pixelgetcolor(261,202) =0xFF0000 then ExitLoop If pixelgetcolor(261,203) =0xFF0000 then ExitLoop If pixelgetcolor(261,204) =0xFF0000 then ExitLoop If pixelgetcolor(262,200) =0xFF0000 then ExitLoop If pixelgetcolor(262,201) =0xFF0000 then ExitLoop If pixelgetcolor(262,202) =0xFF0000 then ExitLoop If pixelgetcolor(262,203) =0xFF0000 then ExitLoop If pixelgetcolor(262,204) =0xFF0000 then ExitLoop Wend I changed it too this, but it don't understand why it doesn't work. Local $y=-1 Local $i=-1 Local $t=0 Do Do $y + 1 Do $i + 1 sleep(10) If pixelgetcolor(259+$i,200+$y) = 0xFF0000 Then $t+=1 Until $t=1 or $i=4 Until $t=1 or $y=4 Until $t=1 Thanks in advance Edited September 25, 2019 by Zwettenduvel Link to comment Share on other sites More sharing options...
Zwettenduvel Posted September 25, 2019 Author Share Posted September 25, 2019 (edited) nvm I found it Edited September 25, 2019 by Zwettenduvel Link to comment Share on other sites More sharing options...
Danp2 Posted September 25, 2019 Share Posted September 25, 2019 2 hours ago, Zwettenduvel said: I want to make the code more compact Take a look at PixelSearch in the help file. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
junkew Posted September 27, 2019 Share Posted September 27, 2019 Search for bitblt in the forum that can speed up things. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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