Jump to content

Colour Dection Help


Recommended Posts

Try and insert your code in coding tags so we cna read it easier =)

While 1
   If PixelSearch( 0, 0, 1240, 768, 0x637542 ) Then
      Send("{CTRLDOWN}")
      While PixelSearch( 0, 0, 1240, 768, 0x637542 )
        ;wait until the pixel dissapears
      WEnd
      Send("{CTRLUP}")
   EndIf
Wend

That should work fine, there must be something in

;wait until the pixel dissapears

please post that code =)

qq

Link to comment
Share on other sites

lol. gah :) im not good at this explaing......i am using Xenogis code lol, i was just clarifying that it wasnt mine so, no one got mad at me :D

I want it to detect the pixel 0x637542 , then hold down ctrl or press it until the pixel disappears and for it to keep searching the pixel until it finds it again, then holds down ctrl or press it until it disappears again, i need it to loop forever :D

Link to comment
Share on other sites

While 1
If PixelSearch( 0, 0, 1240, 768, 0x637542 ) Then
      Send("{CTRLDOWN}")
      While PixelSearch( 0, 0, 1240, 768, 0x637542 )
      WEnd
      Send("{CTRLUP}")
Endif
Wend

That is it lol but it still doesnt loop i have read the Help File over and over but still i cannot work it out :) the script works one time around....then nothing.....:D

Link to comment
Share on other sites

ahhhh, whoops lol, it actually IS looping, but everything inside the while loop is an and if, its looping but the clour changes so it appears to do nothing

While 1
   If PixelSearch( 0, 0, 1240, 768, 0x637542 ) Then
      Send("{CTRLDOWN}")
; What is the use of the below loop
      While PixelSearch( 0, 0, 1240, 768, 0x637542 )
      WEnd
; What is the use of the above loop
      Send("{CTRLUP}")
   Endif
Wend

tell me what you want done cause there are many ways of doing this, and i think you might want somthing like

While PixelSearch( 0, 0, 1240, 768, 0x637542 ) <> 0x637542
Edited by burrup

qq

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...