Sign in to follow this  
Followers 0
BuzzBuzzYolk

PixelCheckSum find

6 posts in this topic

Ok here's what I'm trying to make: a bot that clicks on specific money-making structures in an online game and collects the money for me, something that would otherwise take me about 20 minutes. It isn't cheating btw.

So anyway, I already know how record and find pixel checksums (thanks to ofLight) and now I just have one problem: The script would only be able to target the top-left structure since in scans from left to right and up to down. How do I get it to progress and not target the same place more than once?

Thanks a lot. :)

Share this post


Link to post
Share on other sites



If the script works but only scans one area based on the coords, and you want it scan multiple areas.... sounds like you just need to have the script loop through those multiple coords. It that's not what you want please clarify.

Share this post


Link to post
Share on other sites

Ah, I get it. I didn't think you could do that. One last thing- how can I get it to work for flash games because right now it doesn't?

Share this post


Link to post
Share on other sites

how can I get it to work for flash games because right now it doesn't?

I'm not a gamer but from reading the forum there are some games (don't know the type: java, flash, etc) that block pixel scans. If you post your code and indicate where the script stops working, we might be able to help you more.

Share this post


Link to post
Share on other sites

I am currently rewriting my UDF to be more user friendly, but this is a rip from my LastChaos script.

;=================================   PixelCheckSumFindAll   =====================
; Function Name:    _PixelCheckSumFindAll
; Description:      Finds all instances of Checksum within a given area and returns array with Total and all locations X and Y.
; Requires:                         None
; Parameters:       $Pixel          Colour value of pixel to find (in decimal or hex).
;                   $chksum         Previously generated checksum value of the region per(PixelChecksum)
;                   $CS_l           left coordinate of rectangle. (amount to subtract)
;                   $CS_t           Top coordinate of rectangle. (amount to subtract)
;                   $CS_r           Right coordinate of rectangle. (amount to add)
;                   $CS_b           Bottom coordinate of rectangle. (amount to add)
;                   $SB_l           left coordinate of total area to search. Default is 0 (far left side of screen)
;                   $SB_t           top coordinate of total area to search. Default is 0 (top most Side of screen)
;                   $SB_r           Right coordinate of total area to search. Default is @DesktopWidth (Far Right side of screen)
;                   $SB_b           Bottom coordinate of total area to search. Default is @DesktopHeight (Bottom most side of screen)
; Syntax:           _PixelCheckSumFindAll($pixel,$chksum,$CS_l,$CS_t,$CS_r,$CS_b[, $SB_l, $SB_t, $SB_r, $SB_b])
; Author(s):        ofLight
; Returns:          $Array[0] = 0 on failure, $Array on success
;===============================================================================
Func _PixelCheckSumFindAll($pixel,$chksum,$CS_l,$CS_t,$CS_r,$CS_b,$SB_l=0,$SB_t=0,$SB_r=@DesktopWidth,$SB_b=@DesktopHeight)
    $SB_b_Max = $SB_b
    $SB_l_Max = $SB_l
    Dim $Array[2][2]
    $Array[0][0] = "0"
    $Count = "0"
    While 1
        $xy = PixelSearch($SB_l,$SB_t,$SB_r,$SB_b,$pixel, 0)
        If @error And $SB_b = $SB_b_Max Then
            SetError(1)
            Return $Array
        ElseIf @error Then
            $SB_t = $SB_b + 1
            $SB_b = $SB_b_Max
            $SB_l = $SB_l_Max
        ElseIf $chksum = PixelCheckSum($xy[0]-$CS_l, $xy[1]-$CS_t, $xy[0]+$CS_r, $xy[1]+$CS_B) Then 
            $Count = $Count+1
            $Array[0][0] = $Count
            ReDim $Array[$Count+1][2]
            $Array[$Count][0] = $xy[0]
            $Array[$Count][1] = $xy[1]
            $SB_t = $xy[1]
            $SB_b = $SB_t
            $SB_l = $xy[0] + 1
        Else
            $SB_t = $xy[1]
            $SB_b = $SB_t
            $SB_l = $xy[0] + 1
        EndIf
    WEnd
EndFunc;=========================   PixelCheckSumFindAll   =====================oÝ÷ ØpY_wZX§²Ö§që(~Ø^
˦Êyçbµ©Ý+Þʪëk*¶¢¬*­ÛÅ©©å,y«­¢+Ø¥¹±Õ±ÐíÉÉä¹ÔÌÐì)M±À ÈÀÀÀ¤(ÀÌØí½½Éô}A¥á±
¡­MÕµ¥¹±° ÔääÄÔàÄ°ÈÔÄÌäÀØÈÔä°È°È°È°È¤)%%ÍÉÉä ÀÌØí½½É¤Q¡¸}ÉÉå¥ÍÁ±ä ÀÌØí½½É¤

As far as the java and flashgames, the problem is that your program is double buffering the display. The program probably used a ScreenBuffer1 and a ScreenBuffer2 and then displays from one buffer while rendering the next frame in the other buffer. Then it switches the buffers to display the one just rendered and starts work on the next frame in the other one. This is a standard technique from rendering displays and gives the illusion of seamless motion. This effectively doubles the program's framerate. Also, some programs use a blanking field where they erase the current image with black prior to displaying the next frame buffer. AutoIT does not seem to be able to work around this as it is currently implemented. However, if you truely want a workaround you can use the same method I outlined in the Gameguard Bypass Thread.


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

@ofLight - talk about a gold nugget! Thanks for the function and the low down!

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