Sign in to follow this  
Followers 0
thatOneGuy

PixelSearch problems

2 posts in this topic

Hi All,

Thanks for reading! I have a script that Is reliable without a pixelsearch but, the program that the script runs is not always reliable. here is the code:

Do 
        
        Sleep(1000)
        
        $color11 = PixelGetColor(561, 89)

        Sleep(1)

        $color12 = PixelGetColor(561, 89)

        Sleep(1)

        $color13 = PixelGetColor(561, 89)

        Sleep(1)

        $color14 = PixelGetColor(561, 89)

        Sleep(1)

        $color15 = PixelGetColor(561, 89)

        Sleep(1)

        $color16 = PixelGetColor(561, 89)

        Sleep(1)

        $color17 = PixelGetColor(561, 89)

        Sleep(1)

        $color18 = PixelGetColor(561, 89)

        Sleep(1)

        $color19 = PixelGetColor(561, 89)

        Sleep(1)

        $color20 = PixelGetColor(561, 89)
        
        
        $colorAverage = ($color11 + $color12 + $color13 + $color14 + $color15 + $color16 + $color17 + $color18 + $color19 + $color20) / 10
        
        
        
        If $colorAverage = 2302755 Or $colorAverage = 2368548 Or $colorAverage = 2407204 Then
            
            $win = False

            ExitLoop
                        
        ElseIf $colorAverage = 16720675 Or $colorAverage = 16720932 Then
            
            $win = True

            ExitLoop
            
        EndIf
        
        
    Until $color = 0oÝ÷ Ù8b±¹hrJr^È+y«nØ¥¶©®+jkajØ­®éì¢x"½ë-ꮢÜ"x§«¨µÊ'v+b¢x§iØ}êÞÖ«y¤ájÙj{-«Zé
.ÚÞr'7ªê-Â)êºZÖµ§¢·b    rnëmë®*')h¢H§«hêbÅém¢Ç¶ªºpz®¢Ú+ªê-,ªê-jwl¢Ø^±Êâ¦×hzÉ÷öÖ¥Á¬¬±ç­ê®¢Ü"«¨µ©Ý¦ºyçljÈØZvZ,´è­×«¶r§µú+¶¬#
èµè§hø±zTj·!jëh×6Do 
        
        Sleep(1000)
        
        $color11 = PixelGetColor(561, 89)
        Sleep(1)
        $color12 = PixelGetColor(561, 89)
        Sleep(1)
        $color13 = PixelGetColor(561, 89)
        Sleep(1)
        $color14 = PixelGetColor(561, 89)
        Sleep(1)
        $color15 = PixelGetColor(561, 89)
        Sleep(1)
        $color16 = PixelGetColor(561, 89)
        Sleep(1)
        $color17 = PixelGetColor(561, 89)
        Sleep(1)
        $color18 = PixelGetColor(561, 89)
        Sleep(1)
        $color19 = PixelGetColor(561, 89)
        Sleep(1)
        $color20 = PixelGetColor(561, 89)
        
        
        
        $colorAverage = ($color11 + $color12 + $color13 + $color14 + $color15 + $color16 + $color17 + $color18 + $color19 + $color20) / 10
        
        
        
        If $colorAverage = 2302755 Or $colorAverage = 2368548 Or $colorAverage = 2407204 Then
            
            $coordY = PixelSearch( 695, 45, 780, 60, 0xF0D300 )
    
                If Not @error Then
            
                            $win = False
                ExitLoop
            Else
            
                    $coordG = PixelSearch( 695, 45, 780, 60, 0x50FF2F )
        
                        If Not @error Then
                    $win = False
                    ExitLoop
        
                        EndIf
            EndIf
        
                    If @error Then
         
                        $win = True
                ExitLoop
            EndIf
        
                ElseIf $colorAverage = 16720675 Or $colorAverage = 16720932 Then
                $coord = PixelSearch( 695, 45, 780, 60, 0xFF0000 )
        
                    If @error Then
                $win = True
                ExitLoop
            Else
                $win = False
                ExitLoop
            EndIf
        EndIf
        
        
    Until $color = 0

This change was supposed to make the script have fewer mistakes but, it seems even more buggy. I would like to keep the PixelSearch but I get worse results.

Thanks again for reading and for your help!!

Share this post


Link to post
Share on other sites



Maybe...

While 1
Sleep(1)
TrayTip("pixelgetcolor", _PixelGetColor(561, 89), 0, 1)
WEnd

Func _PixelGetColor($x, $y)
$pgc = PixelGetColor($x, $y)
Return $pgc
EndFunc

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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