Sign in to follow this  
Followers 0
USama

PixelChecksum With MouseClick

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#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

RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

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