Jump to content

Check sum


Recommended Posts

What checksum function?

HotKeySet("`","_find")
HotKeySet("~","record")
HotKeySet('{esc}', '_Exit')

Global $msg =   "Press Shift+tilde to Record " & @LF & _
                "Press tilde to Find " & @LF & _
                "info saved in Pixel.ini"
Global $xy,$currentpixel

While 1
    $xy = MouseGetPos()
    $currentpixel = PixelGetColor($xy[0],$xy[1])
    ToolTip("Pixel color = " & $currentpixel & @LF & $msg)
    Sleep(100)
WEnd

Func record()
    MouseMove($xy[0]+100, $xy[1]+100,40)
    sleep(1500)
    IniWrite(".\Pixel.ini","Main","PixelColor",PixelGetColor($xy[0],$xy[1]))
    Local $chksum = PixelChecksum($xy[0]-4, $xy[1]-20, $xy[0]+4, $xy[1]+20)
    IniWrite(".\Pixel.ini","Main","PixelCheckSum",$chksum)
    ToolTip("SAVED")
    Sleep(1000)
    ;Exit
EndFunc

Func _find()
    Local $pixel =  Int(IniRead(".\Pixel.ini","Main","PixelColor","-1"))
    Local $chksum = Int(IniRead(".\Pixel.ini","Main","PixelCheckSum","-1"))

    $x = 5 ;LEFT pixel of Total Area to Search for $pixel
    $y = 5 ;TOP
    $xpixel = @DesktopWidth - 5 ;Right
    $ypixel = @DesktopHeight - 5 ;Bottom

    While 1
        $xy = PixelSearch($x,$y,$xpixel,$ypixel,$pixel, 0)

        If @error And $ypixel = (@DesktopHeight - 5)Then
            MsgBox(4096,"@Error ","Could not find Checksum" & @LF & '     Finished Searching all of Screen', 4)
            exit
        ElseIf @error Then
            $y = $ypixel + 1
            $ypixel = (@DesktopHeight - 5)
            $x = 0
        ElseIf $chksum = PixelCheckSum($xy[0]-4, $xy[1]-20, $xy[0]+4, $xy[1]+20) Then
            ToolTip("Found Checksum")
            MouseMove($xy[0],$xy[1], 20)
            MouseClick("Left",$xy[0],$xy[1])
            Sleep(1000)
            Exit
        Else
            $y = $xy[1]
            $ypixel = $y
            $x = $xy[0] + 1
        EndIf
    WEnd
EndFunc

Func _Exit()
    ToolTip('          '&@CRLF&'  EXITING  '&@CRLF&'          ')
    Sleep(500)
    Exit
EndFunc
Link to comment
Share on other sites

PixelChecksum?

Do a search for it and you'll get MASSIVE amount of posts.

Also, how can a checksum be inside/outside a script?

I'm speaking in regards to when I test. It works fine when I test but when I place the numbers in the _findChecksum('145077','718721344') area, it doesn't find it. I'll do a search, thanks.
Link to comment
Share on other sites

I'm speaking in regards to when I test. It works fine when I test but when I place the numbers in the _findChecksum('145077','718721344') area, it doesn't find it. I'll do a search, thanks.

Mate I will try and help you out, if you can link me to this _findChecksum function.

I could do with it myself.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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...