Jump to content

PixelChecksum With MouseClick


USama
 Share

Recommended Posts

PixelChecksum : Wait until something changes in the region x y

and when something changes it sends msg box

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")

I Changed msg box with mouseclick like that

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)


; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

; Double click at 0,500
MouseClick("left", 50, 50, 2)

And It Works ...

What I Need Is ( If Something Changes In X Y Do Mouseclick In The Same X Y )

Other Meaning ( I Need The Script To checksum All My Screen And If SomeThing Changes Do MouseClick On The Same Place Which The Changes Happened On It...

Thank You .. I Know I make You Tierd ...Sorry

Edited by USama
Link to comment
Share on other sites

PixelChecksum : Wait until something changes in the region x y

and when something changes it sends msg box

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")

I Changed msg box with mouseclick like that

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum
$checksum = PixelChecksum(0,0, 50,50)


; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

; Double click at 0,500
MouseClick("left", 50, 50, 2)

And It Works ...

What I Need Is ( If Something Changes In X Y Do Mouseclick In The Same X Y )

Other Meaning ( I Need The Script To checksum All My Screen And If SomeThing Changes Do MouseClick On The Same Place Which The Changes Happened On It...

Thank You .. I Know I make You Tierd ...Sorry

You would need to use PixelSearch I believe. PixelCheckSum does not return coordinates.
Link to comment
Share on other sites

#include "array.au3"

Dim $Area[Ceiling((@DesktopHeight / 100) + 1)][Ceiling((@DesktopWidth / 100))]

$i = 0
$u = 0

For $x = 0 To @DesktopWidth Step 100
    For $y = 0 To @DesktopHeight Step 100
        $Area[$i][$u] = PixelChecksum($x, $y, $x + 99, $y + 99)
        $i += 1
    Next
    $u += 1
    $i = 0
Next

While 1
    For $u = 0 To UBound($Area, 2) - 1
        For $i = 0 To UBound($Area, 1) - 1
            If $Area[$i][$u] <> PixelChecksum($u * 100, $i * 100, $u * 100 + 99, $i * 100 + 99) Then
                MouseClick("main", ($u * 100), ($i * 100))
                MsgBox(0, "", ($u * 100) & ($i * 100))
            EndIf
        Next
    Next
WEnd

lol... Well... This may not exactly do what you want, but it works... I think? Give it a try. It's really slow though

Edited by mistersquirrle

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

#include "array.au3"

Dim $Area[Ceiling((@DesktopHeight / 100) + 1)][Ceiling((@DesktopWidth / 100))]

$i = 0
$u = 0

For $x = 0 To @DesktopWidth Step 100
    For $y = 0 To @DesktopHeight Step 100
        $Area[$i][$u] = PixelChecksum($x, $y, $x + 99, $y + 99)
        $i += 1
    Next
    $u += 1
    $i = 0
Next

While 1
    For $u = 0 To UBound($Area, 2) - 1
        For $i = 0 To UBound($Area, 1) - 1
            If $Area[$i][$u] <> PixelChecksum($u * 100, $i * 100, $u * 100 + 99, $i * 100 + 99) Then
                MouseClick("main", ($u * 100), ($i * 100))
                MsgBox(0, "", ($u * 100) & ($i * 100))
            EndIf
        Next
    Next
WEnd

lol... Well... This may not exactly do what you want, but it works... I think? Give it a try. It's really slow though

Thank You But Its Not What I Need

Link to comment
Share on other sites

Hi,

 

Other Meaning  ( I Need The Script To checksum All My Screen And If SomeThing  Changes Do MouseClick On The Same Place Which The Changes Happened On It...

Where do you want to click when a window appears to your screen?

Try this:

Make screenshot of your screen, take this as a reference.

Make screenshots of your screen (into a loop), if actual screenshot differs to the reference, compare the pixels of the reference with the actual screenshot.  (you could use prospeed.dll to do this or iterate with stringcompare())

If you find a pixel in the actual screenshot which is not the same as in the reference, click it....

ciao

Andy

Edited by AndyG
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...