Sign in to follow this  
Followers 0
sumkid

multiple pixel search with same function bah!

4 posts in this topic

#1 ·  Posted (edited)

well this is my code:

Sleep(2000)
HotKeySet("{ESC}","qt")
While 1
$c=PixelSearch(405,265,875,580,(hidden due to use))
If IsArray($c) Then MouseMove($c[0],$c[1],0)
If IsArray($c) Then MouseClick("right")
If IsArray($c) Then Sleep (1000)
If IsArray($c) Then MouseMove (38,177)
If IsArray($c) Then MouseClick("right")
If IsArray($c) Then MouseMove (33,217)
If IsArray($c) Then MouseClick("right")
If IsArray($c) Then Send ("{1}")
WEnd
Func qt()
Exit
EndFunc

what i want to do is add multiple searches that will do the same thing so i can search for about 3 different pixel colors instead of one. what i have been doing is making more codes with different pixels but it makes major lag. please help? anyone!

PS: the reason i hid the pixel was because of what im using the code for is private sorry :)

Edited by sumkid

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Okay, give this a try.

This will search for one colour, if it doesn't find it, searches for the next one, then the next one, etc. If it does find it, it does all the clicking and moving and stuff.

Local $colors[3] = [ 0xff0000, 0x00ff00, 0x0000ff ]

Sleep(2000)
HotKeySet("{ESC}","qt")
While 1
    For $i = 0 To 2
        $c=PixelSearch(405,265,875,580,$colors[$i])
        If IsArray($c) Then
            MouseMove($c[0],$c[1],0)
            MouseClick("right")
            Sleep (1000)
            MouseMove (38,177)
            MouseClick("right")
            MouseMove (33,217)
            MouseClick("right")
            Send ("{1}")
            ExitLoop
        EndIf
    Next
WEnd

Func qt()
    Exit
EndFunc
Edited by Saunders

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

umm what im looking for is a way to search more pixels that will do the same functions whitch would be:

If IsArray($c) Then
        MouseMove($c[0],$c[1],0)
        MouseClick("right")
        Sleep (1000)
        MouseMove (38,177)
        MouseClick("right")
        MouseMove (33,217)
        MouseClick("right")
        Send ("{1}")

i want it to keep doing that except with more pixels then 1 so i dont have to run multiple programs

Edited by sumkid

Share this post


Link to post
Share on other sites

Oh, okay, then just take my example above and remove the ExitLoop. I think that might do what you're looking for.

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  
Followers 0