reese646 Posted December 31, 2013 Share Posted December 31, 2013 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 31, 2013 Moderators Share Posted December 31, 2013 (edited) reese646,I have lifted your "New Member" posting restriction. Now I will look at your question. M23Edit:I am not at all sure that PixelSearch is going to help here if the background is changing and affecting teh colours in an area. Some screenshots of the messenger window before and after a "real" notification and when the background is "changing" between these 2 points would be a great help. We might be able to identify something more specific that you can use to indicate the "real" change. Edited December 31, 2013 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Bert Posted December 31, 2013 Share Posted December 31, 2013 Also, is it possible to hook into the control on the window in question to see if something has changed? That method would be MUCH more stable. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
reese646 Posted December 31, 2013 Author Share Posted December 31, 2013 hi, just checking back in on the fly so can't sort any pictures out at the minute, as asked about the change in colour I'd say the transparency is only 5-8 percent and so is only very mildly affecting the base colour as a light shimmer if you know what I mean, similar I suppose to windows aero transparency, but this very slight pixel tinting is enough obviously to give a false positive, hence my thinking that if a pixelsearch could be implemented after the pixelchecksum as a secondary condition then it would solve the problem, implementing it is the current problem, changing the colour variation in the pixelsearch variables is something I can play with once I've got something to work with. Have tried a few things and worked my way through some of the tutorials and its really interesting, but I'm struggling to apply this knowledge so far to the problem in hand. Many thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 1, 2014 Moderators Share Posted January 1, 2014 reese646,Another thought - how about putting a non-transparent window underneath the messenger GUI? That way you can prevent the background from showing through. It is quite easy to get an AutoIt GUI to "follow" another so that you do not have to keep the messenger window in a fixed position. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now