Jump to content

Multiple Pixelsearch


Guest dropthepen
 Share

Recommended Posts

Guest dropthepen

Hi i want to know how i can add another pixel color to search and click on, its been bugging me, i want to add a few more pixel colors for it to search for actually. Heres what i have so far, if anyone can help please help. thanks a bunch. I only have it search for Red = 0xff0000 . I want it to search for that and then search for another color and another one as well.

HotKeySet ("z", "MyExit")

While 1

$coord = PixelSearch( 522, 7, 665, 33, 0xff0000,10,1)

If Not @error Then

MouseClick("left", $coord[0],$coord[1],1)

EndIf

Sleep(1000)

WEnd

Func MyExit ()

Exit

EndFunc

Link to comment
Share on other sites

Hi i want to know how i can add another pixel color to search and click on, its been bugging me, i want to add a few more pixel colors for it to search for actually.  Heres what i have so far, if anyone can help please help. thanks a bunch.  I only have it search for Red = 0xff0000 .  I want it to search for that and then search for another color and another one as well.

<{POST_SNAPBACK}>

HotKeySet ("z", "MyExit")
While 1
   $red = PixelSearch( 522, 7, 665, 33, 0xff0000,10,1)
   If Not @error Then
       MouseClick("left", $red[0],$red[1],1) 
   EndIf
   $green = PixelSearch( 522, 7, 665, 33, 0x00ff00,10,1)
   If Not @error Then
       MouseClick("left", $green[0],$green[1],1) 
   EndIf
   $blue = PixelSearch( 522, 7, 665, 33, 0x0000ff,10,1)
   If Not @error Then
       MouseClick("left", $blue[0],$blue[1],1) 
   EndIf
   Sleep(1000)
WEnd

Func MyExit ()
   Exit
EndFunc

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Guest dropthepen

HotKeySet ("z", "MyExit")
While 1
   $red = PixelSearch( 522, 7, 665, 33, 0xff0000,10,1)
   If Not @error Then
       MouseClick("left", $red[0],$red[1],1) 
   EndIf
   $green = PixelSearch( 522, 7, 665, 33, 0x00ff00,10,1)
   If Not @error Then
       MouseClick("left", $green[0],$green[1],1) 
   EndIf
   $blue = PixelSearch( 522, 7, 665, 33, 0x0000ff,10,1)
   If Not @error Then
       MouseClick("left", $blue[0],$blue[1],1) 
   EndIf
   Sleep(1000)
WEnd

Func MyExit ()
   Exit
EndFunc

<{POST_SNAPBACK}>

WOW! YOU DID IT! :) It works perfectly, thank you so much i'm a noob to Autoit, so i really appreciate your help and everyone contributing to the forum. thanks again.
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...