Jump to content

Here we go again, Comparing PixelCheckSum's


Recommended Posts

Alrihgt, here we go again. this time with pixel checksums.

I have the pixel checks i need set out. When i use my checker. (see bleow) It returns the basic premis i am trying to prove.

$1 = PixelChecksum(383,273,395,277)
$2 = PixelChecksum(483,273,495,277)
$3 = PixelChecksum(583,273,595,277)

$4 = PixelChecksum(383,373,395,377)
$5 = PixelChecksum(483,373,495,377)
$6 = PixelChecksum(583,373,595,377)

$7 = PixelChecksum(383,473,395,477)
$8 = PixelChecksum(483,473,495,477)
$9 = PixelChecksum(583,473,595,477)

While 1
ToolTip("Pixel color = " & @lf & $1 & @lf & $2 & @lf & $3 & @lf & $4 & @lf & $5 & @lf & $6 & @lf & $7 & @lf & $8 & @lf & $9)
wend

If shows all the pixelchecksums. It returns the numbers i want it to.. 3 numbers for each box i am searching, and 1 odd number. like this

12345

12345

12345

56789

56789

56789

23456

23456

34256 ---- Odd one out. But it could be anywhere. it could be the first line, it could be the second box in the first row. I need ot figure out which it is.. anyone have any idea how to do it.. I tried lots of ways. as this isnt the first was i tried it.. Still cant get anything to work.. Help?

Link to comment
Share on other sites

You get something different because simply, there is something in that area which changes the pixel checksum.

Try to play with your desktop icons and see how the checksum changes when you move an icon to that area.

Use this for your play:

While 1
$1 = PixelChecksum(383,273,395,277)
$2 = PixelChecksum(483,273,495,277)
$3 = PixelChecksum(583,273,595,277)

$4 = PixelChecksum(383,373,395,377)
$5 = PixelChecksum(483,373,495,377)
$6 = PixelChecksum(583,373,595,377)

$7 = PixelChecksum(383,473,395,487)
$8 = PixelChecksum(483,473,495,487)
$9 = PixelChecksum(583,473,595,487)

Sleep(300)

ToolTip("Pixel color = " & @lf & $1 & @lf & $2 & @lf & $3 & @lf & $4 & @lf & $5 & @lf & $6 & @lf & $7 & @lf & $8 & @lf & $9)
wend

I've only put the checksum inside while loop so you can see the changes. (while running this your computer may slow down a bit)

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

  • Moderators

Haven't you been down this road before? ...

;First, create an array instead of $1, $2 etc, so you can send it to a func that singles it out

Global $aPixSums[10]
$aPixSums[1] = PixelChecksum(383,273,395,277)
$aPixSums[2] = PixelChecksum(483,273,495,277)
$aPixSums[3] = PixelChecksum(583,273,595,277)

$aPixSums[4] = PixelChecksum(383,373,395,377)
$aPixSums[5] = PixelChecksum(483,373,495,377)
$aPixSums[6] = PixelChecksum(583,373,595,377)

$aPixSums[7] = PixelChecksum(383,473,395,477)
$aPixSums[8] = PixelChecksum(483,473,495,477)
$aPixSums[9] = PixelChecksum(583,473,595,477)

Global $aCheck = _FindUnique($aPixSums, 1)
If IsArray($aCheck) Then
    MsgBox(64, "Info", "Unique Value: " & $aCheck[0] & @CRLF & _
                       "Position Found: " & $aCheck[1])
Else
    MsgBox(16, "Error", "No unique values found.")
EndIf

;Params:
;       1. Is the array of the sums
;       2. Is the base  you started at (ie... 0 or 1, in this case we started at 1, default is 0
;       3. Is the delimiter for the string, it's optional, one is set already
;Return:
;       1 dimensional array
;       array[0] ... [0] = Value that was unique
;       array[1] ... [1] = Number it was found on
Func _FindUnique($aSums, $nBase = 0, $vDelim = "");Quick version, will only find one instance of a unique val
    If $vDelim = "" Then $vDelim = Chr(1)
    ; We need to make a string from the array with a delimiter
    Local $sSums = $vDelim
    For $i = $nBase To UBound($aSums) - 1
        $sSums &= $aSums[$i] & $vDelim
    Next
    
    Local $aReturn[2] ; Our return array
    ;Now we can simply loop through, use StringReplace
    For $i = $nBase To UBound($aSums) - 1
        StringReplace($sSums, $vDelim & $aSums[$i] & $vDelim, "")
        If @extended = 1 Then ; Only 1 replacement means it was unique, no need to go further
            $aReturn[0] = $aSums[$i]
            $aReturn[1] = $i
            Return $aReturn
        EndIf
    Next
    Return SetError(1, 0, "")
EndFunc

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Ye, in theory that hould work. But it ALWAYS says posistion one is unique. but it isnt always. thats where i got snuagged up before...

Why would it say pos 1 is uniqe when its not?

Weird, in theory I thought it should work... this one is tested and it does work:
;First, create an array instead of $1, $2 etc, so you can send it to a func that singles it out

Global $aPixSums[10]
$aPixSums[1] = 3258324049;PixelChecksum(383,273,395,277)
$aPixSums[2] = 3258324049;PixelChecksum(483,273,495,277)
$aPixSums[3] = 3258324049;PixelChecksum(583,273,595,277)

$aPixSums[4] = 238434759;PixelChecksum(383,373,395,377)
$aPixSums[5] = 238434759;PixelChecksum(483,373,495,377)
$aPixSums[6] = 239434759;PixelChecksum(583,373,595,377)

$aPixSums[7] = 2844348207;PixelChecksum(383,473,395,477)
$aPixSums[8] = 2844348207;PixelChecksum(483,473,495,477)
$aPixSums[9] = 2844348207;PixelChecksum(583,473,595,477)

Global $aCheck = _FindUnique($aPixSums, 1)
If IsArray($aCheck) Then
    MsgBox(64, "Info", "Unique Value: " & $aCheck[0] & @CRLF & _
                       "Position Found: " & $aCheck[1])
Else
    MsgBox(16, "Error", "No unique values found.")
EndIf

;Params:
;       1. Is the array of the sums
;       2. Is the base  you started at (ie... 0 or 1, in this case we started at 1, default is 0
;Return:
;       1 dimensional array
;       array[0] ... [0] = Value that was unique
;       array[1] ... [1] = Number it was found on
Func _FindUnique($aSums, $nBase = 0, $vDelim = "");Quick version, will only find one instance of a unique val
    If $vDelim = "" Then $vDelim = Chr(1)
    Local $sDelim = $vDelim
    $vDelim &= $vDelim
    ; We need to make a string from the array with a delimiter
    Local $sSums = $vDelim
    For $i = $nBase To UBound($aSums) - 1
        $sSums &= $aSums[$i] & $vDelim
    Next
    
;   ConsoleWrite($sSums & @CRLF)
    
    Local $aReturn[2] ; Our return array
    Local $nUbound
    ;Now we can simply loop through, use StringReplace
    For $i = $nBase To UBound($aSums) - 1
        #cs
        StringReplace($sSums, $vDelim & $aSums[$i] & $vDelim, "")
        If @extended = 1 Then ; Only 1 replacement means it was unique, no need to go further
            Local $aReturn[2] = [$aSums[$i], $i]
            Return $aReturn
        EndIf
        #ce
        $nUbound = UBound(StringRegExp($sSums, $sDelim & $aSums[$i] & $sDelim, 3))
        If $nUbound = 1 Then ; Only 1 replacement means it was unique, no need to go further
            Local $aReturn[2] = [$aSums[$i], $i]
            Return $aReturn
        EndIf
    Next
    Return SetError(1, 0, "")
EndFuncoÝ÷ ØGb´zz0ܲØ^uéb+,¹ëaÊ'y©l£
+Ë(¶­ê+ˬ²§t6®¶­sc´f'7BÂ7&VFRâ'&ç7FVBöbb33c³Âb33c³"WF2Â6ò÷R6â6VæBBFògVæ2FB6ævÆW2B÷W@ ¤vÆö&Âb33c¶7V×5³Ð¢b33c¶7V×5³ÒÒ3#S3#CCµVÄ6V6·7VÒ32Ã#s2Ã3RÃ#sr¢b33c¶7V×5³%ÒÒ3#S3#CCµVÄ6V6·7VÒC2Ã#s2ÃCRÃ#sr¢b33c¶7V×5³5ÒÒ3#S3#CCµVÄ6V6·7VÒS2Ã#s2ÃSRÃ#sr ¢b33c¶7V×5³EÒÒ#3C3CsSµVÄ6V6·7VÒ32Ã3s2Ã3RÃ3sr¢b33c¶7V×5³UÒÒ#3C3CsSµVÄ6V6·7VÒC2Ã3s2ÃCRÃ3sr¢b33c¶7V×5³eÒÒ#3C3CsSµVÄ6V6·7VÒS2Ã3s2ÃSRÃ3sr ¢b33c¶7V×5³uÒÒ#CC3C#sµVÄ6V6·7VÒ32ÃCs2Ã3RÃCsr¢b33c¶7V×5³ÒÒ#CC3C#sµVÄ6V6·7VÒC2ÃCs2ÃCRÃCsr¢b33c¶7V×5³ÒÒ#CC3C#sµVÄ6V6·7VÒS2ÃCs2ÃSRÃCsr ¤vÆö&Âb33c¶6V6²ÒôfæEVæVRb33c¶7V×2¤b4'&b33c¶6V6²FVà ×6t&÷cBÂgV÷C´æfògV÷C²ÂgV÷CµVæVRfÇVS¢gV÷C²fײb33c¶6V6µ³Òfײ5$Äbfײð gV÷Cµ÷6Föâf÷VæC¢gV÷C²fײb33c¶6V6µ³Ò¤VÇ6P ×6t&÷bÂgV÷C´W'&÷"gV÷C²ÂgV÷C´æòVæVRfÇVW2f÷VæBâgV÷C²¤VæD` £µ&×3 £²â2FR'&öbFR7V×0£²"â2FR&6R÷R7F'FVBBRâââ÷"ÂâF266RvR7F'FVBBÂFVfVÇB2£µ&WGW&ã £²FÖVç6öæÂ'&£²'&³Òâââ³ÒÒfÇVRFBv2VæVP£²'&³Òâââ³ÒÒçVÖ&W"Bv2f÷VæBöà¤gVæ2ôfæEVæVRb33c¶7V×2Âb33c¶ä&6RÒÂb33c·dFVÆÒÒgV÷C²gV÷C²µV6²fW'6öâÂvÆÂöæÇfæBöæRç7Fæ6RöbVæVRfÀ¢bb33c·dFVÆÒÒgV÷C²gV÷C²FVâb33c·dFVÆÒÒ6"¢Æö6Âb33c·4FVÆÒÒb33c·dFVÆТb33c·dFVÆÒf׳Òb33c·dFVÆТ²vRæVVBFòÖ¶R7G&ærg&öÒFR'&vFFVÆÖFW ¢Æö6Âb33c·57V×2Òb33c·dFVÆТf÷"b33c¶Òb33c¶ä&6RFòT&÷VæBb33c¶7V×2Ò¢b33c·57V×2f׳Òb33c¶7V×5²b33c¶Òfײb33c·dFVÆТæW@¢£²6öç6öÆUw&FRb33c·57V×2fײ5$Äb¢¢Æö6Âb33c¶&WGW&å³%Ò²÷W"&WGW&â'&¢Æö6Âb33c¶åV&÷Væ@¢´æ÷rvR6â6×ÇÆö÷F&÷VvÂW6R7G&æu&WÆ6P¢f÷"b33c¶Òb33c¶ä&6RFòT&÷VæBb33c¶7V×2Ò¢7G&æu&WÆ6Rb33c·57V×2Âb33c·4FVÆÒfײb33c¶7V×5²b33c¶Òfײb33c·4FVÆÒÂgV÷C²gV÷C²¢bWFVæFVBÒFVâ²öæÇ&WÆ6VÖVçBÖVç2Bv2VæVRÂæòæVVBFòvògW'FW ¢b33c¶&WGW&å³ÒÒb33c¶7V×5²b33c¶Ð¢b33c¶&WGW&å³ÒÒb33c¶¢&WGW&âb33c¶&WGW&à¢VæD`¢æW@¢&WGW&â6WDW'&÷"ÂÂgV÷C²gV÷C²¤VæDgVæ0
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

lol.. Your getting there..

Now the unique is always 6..

Dunno what part of this theory is going wrong. I know there is only 1 unique one.. And your code doesnt LOOK wrong just there must be something i am missing or we both are?

Link to comment
Share on other sites

  • Moderators

lol.. Your getting there..

Now the unique is always 6..

Dunno what part of this theory is going wrong. I know there is only 1 unique one.. And your code doesnt LOOK wrong just there must be something i am missing or we both are?

Of course it's always 6, it's hard coded (You'll see I commented out your PixelCheckSums because you didn't provide the application it was looking at for anyone to test it), and 6 is the unique value :) Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

It returns that there are no unique areas...

I left the consolewrite in there, just uncomment it and see if it is failing.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Still says no uniqes

Duh? What does the console output read?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

This was my idea but it doesnt do anything, just exits the script.

Global $aCheck = _FindUnique($aPixSums, 1)
If IsArray($aCheck) Then
    Click()
EndIf
Func Click()
If $aCheck[1] = "1" Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn1")
ElseIf $aCheck[1] = '2' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn2")
Elseif $aCheck[1] = '3' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn3")
ElseIf $aCheck[1] = '4' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn4")
ElseIf $aCheck[1] = '5' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn5")
ElseIf $aCheck[1] = '6' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn6")
ElseIf $aCheck[1] = '7' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn7")
ElseIf $aCheck[1] = '8' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn8")
ElseIf $aCheck[1] = '9' Then
    $oSubmit = _IEGetObjByName($Shooting, "ctl00$MainPageContent$valAntiScript$btn9")
    Endif
Endfunc

Anyone?

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