Jump to content
Sign in to follow this  
bennyvo

Simple script

Recommended Posts

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 by bennyvo

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...