Right I've had a good time this morning, and my first post resulted in a great solution to an alarm for changes to a region, I have tidied that thread up and marked it as solved as the questions I was additionally asking we're going of the original topic and I only have one more message left today? (any help on getting aditional messages would be appreciated).
Anyway Ive took this code.
; Provide a way to exit
HotKeySet("{+}", "On_Exit") ;uses the + key to exit the program
; Get an initial checksum
$nCurr_Checksum = PixelChecksum(0, 0, 400, 400);alter this region to the region requiring monitoring
; Start the loop
While 1
; Get a new checksum
$nNew_Checksum = PixelChecksum(0, 0, 400, 400) ;alter this to match the PixelCheckSum above
; See if the area has changed
If $nNew_Checksum <> $nCurr_Checksum Then
; If so then notify
SoundPlay(@WindowsDir & "\Media\notify.wav", 1) ;\media\notify.wav can be changed to any other audible file
ConsoleWrite("!Changed" & @CRLF)
; And reset the checksum to check against next time round
$nCurr_Checksum = $nNew_Checksum
EndIf
; Wait 1 sec and do it all again
Sleep(400) ;in milliseconds altering this changes how quickly the script refreshes
WEnd
Func On_Exit()
Exit
EndFunc
this provides an alarm for an area should it change, and resets once the alarm has sounded.
The problem is transparency, the messenger window I'm monitoring has a transparency so things behind it are setting off the alarm, so I believe I need to add a PixelSearch to the code, have tried a few and getting errors, tried this and no errors, but no alarm, and help appreciated.
; Provide a way to exit
HotKeySet("{+}", "On_Exit") ;uses the + key to exit the program
; Get an initial checksum
$nCurr_Checksum = PixelChecksum(2129, 448, 2220, 1200);alter this region to the region requiring monitoring
; Start the loop
While 1
; Get a new checksum
$nNew_Checksum = PixelChecksum(2129, 448, 2220, 1200) ;alter this to match the PixelCheckSum above
; See if the area has changed
If $nNew_Checksum <> $nCurr_Checksum And PixelSearch (2129, 448, 2220, 1200, 0x252424 ,2 ) Then
; If so then notify
SoundPlay(@WindowsDir & "\Media\notify.wav", 1) ;\media\notify.wav can be changed to any other audible file
ConsoleWrite("!Changed" & @CRLF)
; And reset the checksum to check against next time round
$nCurr_Checksum = $nNew_Checksum
EndIf
; Wait 1 sec and do it all again
Sleep(400) ;in milliseconds altering this changes how quickly the script refreshes
WEnd
Func On_Exit()
Exit
EndFunc