bennyvo Posted March 1, 2005 Share Posted March 1, 2005 (edited) can anyone tell me what's wrong with the code below. If the background($color) is white then it will write in notepad "color white" it will keep writing until the background is not white. It work fine if the background is white but when the background is not white, it won't stop writing in notepad. what i need is for it to stop imediately after the bacground is not white anymore and start wrting again if the background is white again. Assume the bacground is a slideshow where it show different color all the time. And I think it doesn't do live update thanks if anyone can help me this. =========================== Dim $color ;declare variable $color = PixelGetColor( 350 , 617 ) ;Store location's color While 1 ; Do infinite loops If $color = 0xFFFFFF Then ;assume your BG is white WinWaitActive("Untitled - Notepad") ;In Notepad send ("color white") ;Write color white sleep (1000) else do nothing EndIf Wend ================ Edited March 1, 2005 by bennyvo Link to comment Share on other sites More sharing options...
JoeyJoeJOe Posted March 1, 2005 Share Posted March 1, 2005 Stick the line $color = PixelGetColor( 350 , 617 ) ;Store location's color inside the while loop, as it is it'll only check the pixel colour once when the script first executes. Link to comment Share on other sites More sharing options...
bennyvo Posted March 1, 2005 Author Share Posted March 1, 2005 thanks...i think back the loop cycle and realize the $color only get read once so i put the while 1 on the very first line and it work. thanks for you post too. 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