276
Post New Requests Here / Re: 🤔 PixelNotifier alert when color is different, not same as it operates now?
« on: March 02, 2019, 07:29 AM »
I've modified the original download from the Skrommel site to support your request, and also updated the documentation in the ini file (source and sample ini in the attached zip file)
No compiled exe is provided, so you'll have to have AutoHotKey installed on your computer.
Modification: The pixelcolor can now optionally be prefixed with an exclamation mark, like !FFFFFF, so the pixel is watched for being not-equal to that color. The message should probably be adjusted accordingly.
NB: There is no support for setting this option from using the Add alarm... option from the context menu, but it can easily be set as the ini file is opened after adding an alarm.
No compiled exe is provided, so you'll have to have AutoHotKey installed on your computer.
Modification: The pixelcolor can now optionally be prefixed with an exclamation mark, like !FFFFFF, so the pixel is watched for being not-equal to that color. The message should probably be adjusted accordingly.
NB: There is no support for setting this option from using the Add alarm... option from the context menu, but it can easily be set as the ini file is opened after adding an alarm.
Code: Autohotkey [Select]
- ;PixelNotifier.ahk
- ; Watches a screen pixel for a specific color, and notifies the user when it occurs.
- ;Skrommel @2005
- ; 2019-03-02 Ath: Added inverted check by prefixing the pixelcolor with !
- #SingleInstance,Force
- applicationname=PixelNotifier
- Gosub,READINI
- Gosub,ACTIVATEALL
- LOOP:
- {
- If active_%A_Index%=0
- If triggered_%A_Index%=1
- x:=alarms_%A_Index%_1
- y:=alarms_%A_Index%_2
- pixelcolor:=alarms_%A_Index%_3
- If invert = !
- {
- checkInvert=1
- }
- relative:=alarms_%A_Index%_4
- If relative=1
- Else
- If checkInvert = 1
- {
- If readpixelcolor=%pixelcolor%
- }
- else
- {
- If readpixelcolor<>%pixelcolor%
- }
- triggered_%A_Index%=1
- message:=alarms_%A_Index%_5
- fullscreencolor:=alarms_%A_Index%_6
- Gui,%A_Index%:+Owner -Resize -SysMenu -MinimizeBox -MaximizeBox -Disabled +Caption +Border -ToolWindow
- }
- TRIGGERED_9:
- triggered=9
- Goto,TRIGGERED
- TRIGGERED_8:
- triggered=8
- Goto,TRIGGERED
- TRIGGERED_7:
- triggered=7
- Goto,TRIGGERED
- TRIGGERED_6:
- triggered=6
- Goto,TRIGGERED
- TRIGGERED_5:
- triggered=5
- Goto,TRIGGERED
- TRIGGERED_4:
- triggered=4
- Goto,TRIGGERED
- TRIGGERED_3:
- triggered=3
- Goto,TRIGGERED
- TRIGGERED_2:
- triggered=2
- Goto,TRIGGERED
- TRIGGERED_1:
- triggered=1
- Goto,TRIGGERED
- TRIGGERED:
- sound:=alarms_%triggered%_7
- ;WinSet,Top,,%applicationname% %triggered%
- Return
- OK_9:
- ok=9
- OK_8:
- ok=8
- OK_7:
- ok=7
- OK_6:
- ok=6
- OK_5:
- ok=5
- OK_4:
- ok=4
- OK_3:
- ok=3
- OK_2:
- ok=2
- OK_1:
- ok=1
- active_%ok%=0
- Gosub,TRAYMENU
- Return
- TOGGLE_9:
- TOGGLE_8:
- TOGGLE_7:
- TOGGLE_6:
- TOGGLE_5:
- TOGGLE_4:
- TOGGLE_3:
- TOGGLE_2:
- TOGGLE_1:
- If active_%menu%=0
- {
- active_%menu%=1
- triggered_%menu%=0
- Gosub,TRAYMENU
- }
- Else
- {
- }
- Return
- ADD:
- Gosub,DEACTIVATEALL
- {
- If screen=D
- {
- FileAppend,`n%sx%`,%sy%`,%readpixelcolor%`,1`,Message`,FFFFFF`,C:\Windows\Ding.wav,%applicationname%.ini
- Gosub,SETTINGS
- }
- If window=D
- {
- FileAppend,`n%x%`,%y%`,%readpixelcolor%`,2`,Message`,FFFFFF`,C:\Windows\Ding.wav,%applicationname%.ini
- Gosub,SETTINGS
- }
- If esc=D
- {
- }
- }
- Return
- SETTINGS:
- Gosub,DEACTIVATEALL
- Gosub,READINI
- Return
- READINI:
- {
- ini=`;%applicationname%.ini
- ini=%ini%`n`;
- ini=%ini%`n`;Syntax:
- ini=%ini%`n`;
- ini=%ini%`n`;x,y,pixelcolor,relative,message,fullscreencolor,sound
- ini=%ini%`n`;
- ini=%ini%`n`; x Horizontal positon of the pixel to watch
- ini=%ini%`n`; y vertical positon of the pixel to watch
- ini=%ini%`n`; pixelcolor=[!]000000-FFFFFF RGB-color of the pixel to watch
- ini=%ini%`n`; If the RGB color is optionally prefixed with an exclamation mark,
- ini=%ini%`n`; like !FFFFFF, the pixel is watched for being not-equal to that color
- ini=%ini%`n`; relative=1,2 Find pixel relative to 1=the screen or 2=the active window
- ini=%ini%`n`; message The message to display
- ini=%ini%`n`; fullscreencolor=000000-FFFFFF Color of the fullscreen notification
- ini=%ini%`n`; sound Path to the WAV-file
- ini=%ini%`n`;
- ini=%ini%`n`;Example:
- ini=%ini%`n`;
- ini=%ini%`n`;0,0,FFFFFF,White color detected!,0,0000FF,C:\Windows\Media\Ding.wav
- ini=%ini%`n`; Watches the screenposition 0,0 for the color white and plays a sound and
- ini=%ini%`n`; displays a blue message window with the text White color detected!
- ini=%ini%`n
- ini=
- }
- alarmscount=0
- {
- alarmscount+=1
- }
- Return
- TRAYMENU:
- {
- message:=alarms_%A_Index%_5
- If active_%A_Index%=1
- }
- Return
- TOGGLE:
- Pause,Toggle
- Return
- ACTIVATEALL:
- {
- active_%A_Index%=1
- triggered_%A_Index%=0
- Gosub,TRAYMENU
- }
- Return
- DEACTIVATEALL:
- {
- active_%A_Index%=0
- triggered_%A_Index%=0
- Gosub,TRAYMENU
- }
- Return
- ABOUT:
- Return
- 1HOURSOFTWARE:
- Return
- DONATIONCODER:
- Return
- AUTOHOTKEY:
- Return
- 99GuiClose:
- Return
- WM_MOUSEMOVE(wParam,lParam)
- {
- Global hCurs
- If ctrl in Static9,Static13,Static17
- Return
- }
- Return
- EXIT: