Script I Slapped Together Today

There’s a channel in our lineup ran on a computer which runs classifieds, essentially.
If a slide gets stuck, there’s nothing that alarms.
I threw together this simple script in autohotkeys as a start to a solution to the issue.
Basically checks 5 pixels on the screen for their color.
Then checks again in a few moments to see if all 5 points are still the same color.
If yes, alarm.
If no, loop.
Here in the test script, instead of a loop, you see “COLOR MATCH NO”, since it’s a test case.
[tab][code]loop
{
MouseMove 64,94
sleep, 1000
PixelGetColor, color1A, 64, 94
PixelGetColor, color2A, 1216, 94
PixelGetColor, color3A, 64,927
PixelGetColor, color4A, 1216,926
PixelGetColor, color5A, 640,511
sleep, 10000
PixelGetColor, color1B, 64, 94
PixelGetColor, color2B, 1216, 94
PixelGetColor, color3B, 64,927
PixelGetColor, color4B, 1216,926
PixelGetColor, color5B, 640,511

if color1A = %color1B%
{
Var1 = 1
}
else
{
Var1 = 0
}

if color2A = %color2B%
{
Var2 = 1
}
else
{
Var2 = 0
}

if color3A = %color3B%
{
Var3 = 1
}
else
{
Var3 = 0
}

if color4A = %color4B%
{
Var4 = 1
}
else
{
Var4 = 0
}

if color5A = %color5B%
{
Var5 = 1
}
else
{
Var5 = 0
}

Var6 = %Var1%%Var2%%Var3%%Var4%%Var5%
Var7 = 11111

if Var6 = %Var7%
{
MsgBox, Color Match Yes
}
else
{
MsgBox, Color Match No
}
}[/code][/tab]
Here’s a video showing it running.
[youtube]http://www.youtube.com/watch?v=Ul4FV0m2YVQ[/youtube]

That’s a pretty cool idea you had there… as a solution to the problem.

Thanks!

Here’s the new version, which is “smarter”.
It grabs the color of 55 pixels in a diagonal line.
Waits a bit.
Then checks the same 55 pixels in a diagonal line again.
Then compares them.
If same, raises alarm (email) and flips a variable (58) to 1.
The variable 58 is an anti-spam email safegaurd.
Basically, if 58 is 1, it means that the email has already been sent and skips sending another email.
Once it detects the pixels have changed again, (indicating frozen feed fixed) then it clears the variable 58 back to 0 until the next time.

Anyway…here’s the script (which is easier to read if you select all and paste into notepad):

loop
{
	sleep, 1000

	PixelGetColor, color1A, 110, 255
	PixelGetColor, color2A, 130, 265
	PixelGetColor, color3A, 150, 275
	PixelGetColor, color4A, 170, 285
	PixelGetColor, color5A, 190, 295
	PixelGetColor, color6A, 210, 305
	PixelGetColor, color7A, 230, 315
	PixelGetColor, color8A, 250, 325
	PixelGetColor, color9A, 270, 335
	PixelGetColor, color10A, 290, 345
	PixelGetColor, color11A, 310, 355
	PixelGetColor, color12A, 330, 365
	PixelGetColor, color13A, 350, 375
	PixelGetColor, color14A, 370, 385
	PixelGetColor, color15A, 390, 395
	PixelGetColor, color16A, 410, 405
	PixelGetColor, color17A, 430, 415
	PixelGetColor, color18A, 450, 425
	PixelGetColor, color19A, 470, 435
	PixelGetColor, color20A, 490, 445
	PixelGetColor, color21A, 510, 455
	PixelGetColor, color22A, 530, 465
	PixelGetColor, color23A, 550, 475
	PixelGetColor, color24A, 570, 485
	PixelGetColor, color25A, 590, 495
	PixelGetColor, color26A, 610, 505
	PixelGetColor, color27A, 630, 515
	PixelGetColor, color28A, 650, 525
	PixelGetColor, color29A, 670, 535
	PixelGetColor, color30A, 690, 545
	PixelGetColor, color31A, 710, 565
	PixelGetColor, color32A, 730, 575
	PixelGetColor, color33A, 750, 585
	PixelGetColor, color34A, 770, 595
	PixelGetColor, color35A, 790, 605
	PixelGetColor, color36A, 810, 615
	PixelGetColor, color37A, 830, 625
	PixelGetColor, color38A, 850, 635
	PixelGetColor, color39A, 870, 645
	PixelGetColor, color40A, 890, 655
	PixelGetColor, color41A, 910, 665
	PixelGetColor, color42A, 930, 675
	PixelGetColor, color43A, 950, 685
	PixelGetColor, color44A, 970, 695
	PixelGetColor, color45A, 990, 705
	PixelGetColor, color46A, 1010, 715
	PixelGetColor, color47A, 1030, 725
	PixelGetColor, color48A, 1050, 735
	PixelGetColor, color49A, 1070, 745
	PixelGetColor, color50A, 1090, 755
	PixelGetColor, color51A, 1110, 765
	PixelGetColor, color52A, 1130, 775
	PixelGetColor, color53A, 1150, 785
	PixelGetColor, color54A, 1170, 795
	PixelGetColor, color55A, 1090, 805

	sleep, 40000

	PixelGetColor, color1B, 110, 255
	PixelGetColor, color2B, 130, 265
	PixelGetColor, color3B, 150, 275
	PixelGetColor, color4B, 170, 285
	PixelGetColor, color5B, 190, 295
	PixelGetColor, color6B, 210, 305
	PixelGetColor, color7B, 230, 315
	PixelGetColor, color8B, 250, 325
	PixelGetColor, color9B, 270, 335
	PixelGetColor, color10B, 290, 345
	PixelGetColor, color11B, 310, 355
	PixelGetColor, color12B, 330, 365
	PixelGetColor, color13B, 350, 375
	PixelGetColor, color14B, 370, 385
	PixelGetColor, color15B, 390, 395
	PixelGetColor, color16B, 410, 405
	PixelGetColor, color17B, 430, 415
	PixelGetColor, color18B, 450, 425
	PixelGetColor, color19B, 470, 435
	PixelGetColor, color20B, 490, 445
	PixelGetColor, color21B, 510, 455
	PixelGetColor, color22B, 530, 465
	PixelGetColor, color23B, 550, 475
	PixelGetColor, color24B, 570, 485
	PixelGetColor, color25B, 590, 495
	PixelGetColor, color26B, 610, 505
	PixelGetColor, color27B, 630, 515
	PixelGetColor, color28B, 650, 525
	PixelGetColor, color29B, 670, 535
	PixelGetColor, color30B, 690, 545
	PixelGetColor, color31B, 710, 565
	PixelGetColor, color32B, 730, 575
	PixelGetColor, color33B, 750, 585
	PixelGetColor, color34B, 770, 595
	PixelGetColor, color35B, 790, 605
	PixelGetColor, color36B, 810, 615
	PixelGetColor, color37B, 830, 625
	PixelGetColor, color38B, 850, 635
	PixelGetColor, color39B, 870, 645
	PixelGetColor, color40B, 890, 655
	PixelGetColor, color41B, 910, 665
	PixelGetColor, color42B, 930, 675
	PixelGetColor, color43B, 950, 685
	PixelGetColor, color44B, 970, 695
	PixelGetColor, color45B, 990, 705
	PixelGetColor, color46B, 1010, 715
	PixelGetColor, color47B, 1030, 725
	PixelGetColor, color48B, 1050, 735
	PixelGetColor, color49B, 1070, 745
	PixelGetColor, color50B, 1090, 755
	PixelGetColor, color51B, 1110, 765
	PixelGetColor, color52B, 1130, 775
	PixelGetColor, color53B, 1150, 785
	PixelGetColor, color54B, 1170, 795
	PixelGetColor, color55B, 1090, 805

	if color1A = %color1B%
		{
		Var1 = 1
		}
	else
		{
		Var1 = 0
		}

	if color2A = %color2B%
		{
		Var2 = 1
		}
	else
		{
		Var2 = 0
		}

	if color3A = %color3B%
		{
		Var3 = 1
		}
	else
		{
		Var3 = 0
		}

	if color4A = %color4B%
		{
		Var4 = 1
		}
	else
		{
		Var4 = 0
		}

	if color5A = %color5B%
		{
		Var5 = 1
		}
	else
		{
		Var5 = 0
		}

	if color6A = %color6B%
		{
		Var6 = 1
		}
	else
		{
		Var6 = 0
		}

	if color7A = %color7B%
		{
		Var7 = 1
		}
	else
		{
		Var7 = 0
		}

	if color8A = %color8B%
		{
		Var8 = 1
		}
	else
		{
		Var8 = 0
		}

	if color9A = %color9B%
		{
		Var9 = 1
		}
	else
		{
		Var9 = 0
		}

	if color10A = %color10B%
		{
		Var10 = 1
		}
	else
		{
		Var10 = 0
		}

	if color11A = %color11B%
		{
		Var11 = 1
		}
	else
		{
		Var11 = 0
		}

	if color12A = %color12B%
		{
		Var12 = 1
		}
	else
		{
		Var12 = 0
		}

	if color13A = %color13B%
		{
		Var13 = 1
		}
	else
		{
		Var13 = 0
		}

	if color14A = %color14B%
		{
		Var14 = 1
		}
	else
		{
		Var14 = 0
		}

	if color15A = %color15B%
		{
		Var15 = 1
		}
	else
		{
		Var15 = 0
		}

	if color16A = %color16B%
		{
		Var16 = 1
		}
	else
		{
		Var16 = 0
		}

	if color17A = %color17B%
		{
		Var17 = 1
		}
	else
		{
		Var17 = 0
		}

	if color18A = %color18B%
		{
		Var18 = 1
		}
	else
		{
		Var18 = 0
		}

	if color19A = %color19B%
		{
		Var19 = 1
		}
	else
		{
		Var19 = 0
		}

	if color20A = %color20B%
		{
		Var20 = 1
		}
	else
		{
		Var20 = 0
		}

	if color21A = %color21B%
		{
		Var21 = 1
		}
	else
		{
		Var21 = 0
		}

	if color22A = %color22B%
		{
		Var22 = 1
		}
	else
		{
		Var22 = 0
		}

	if color23A = %color23B%
		{
		Var23 = 1
		}
	else
		{
		Var23 = 0
		}

	if color24A = %color24B%
		{
		Var24 = 1
		}
	else
		{
		Var24 = 0
		}

	if color25A = %color25B%
		{
		Var25 = 1
		}
	else
		{
		Var25 = 0
		}

	if color26A = %color26B%
		{
		Var26 = 1
		}
	else
		{
		Var26 = 0
		}

	if color27A = %color27B%
		{
		Var27 = 1
		}
	else
		{
		Var27 = 0
		}

	if color28A = %color28B%
		{
		Var28 = 1
		}
	else
		{
		Var28 = 0
		}

	if color29A = %color29B%
		{
		Var29 = 1
		}
	else
		{
		Var29 = 0
		}

	if color30A = %color30B%
		{
		Var30 = 1
		}
	else
		{
		Var30 = 0
		}

	if color31A = %color31B%
		{
		Var31 = 1
		}
	else
		{
		Var31 = 0
		}

	if color32A = %color32B%
		{
		Var32 = 1
		}
	else
		{
		Var32 = 0
		}

	if color33A = %color33B%
		{
		Var33 = 1
		}
	else
		{
		Var33 = 0
		}

	if color34A = %color34B%
		{
		Var34 = 1
		}
	else
		{
		Var34 = 0
		}

	if color35A = %color35B%
		{
		Var35 = 1
		}
	else
		{
		Var35 = 0
		}

	if color36A = %color36B%
		{
		Var36 = 1
		}
	else
		{
		Var36 = 0
		}

	if color37A = %color37B%
		{
		Var37 = 1
		}
	else
		{
		Var37 = 0
		}

	if color38A = %color38B%
		{
		Var38 = 1
		}
	else
		{
		Var38 = 0
		}

	if color39A = %color39B%
		{
		Var39 = 1
		}
	else
		{
		Var39 = 0
		}

	if color40A = %color40B%
		{
		Var40 = 1
		}
	else
		{
		Var40 = 0
		}

	if color41A = %color41B%
		{
		Var41 = 1
		}
	else
		{
		Var41 = 0
		}

	if color42A = %color42B%
		{
		Var42 = 1
		}
	else
		{
		Var42 = 0
		}

	if color43A = %color43B%
		{
		Var43 = 1
		}
	else
		{
		Var43 = 0
		}

	if color44A = %color44B%
		{
		Var44 = 1
		}
	else
		{
		Var44 = 0
		}

	if color45A = %color45B%
		{
		Var45 = 1
		}
	else
		{
		Var45 = 0
		}

	if color46A = %color46B%
		{
		Var46 = 1
		}
	else
		{
		Var6 = 0
		}

	if color47A = %color47B%
		{
		Var47 = 1
		}
	else
		{
		Var47 = 0
		}

	if color48A = %color48B%
		{
		Var48 = 1
		}
	else
		{
		Var48 = 0
		}

	if color49A = %color49B%
		{
		Var49 = 1
		}
	else
		{
		Var49 = 0
		}

	if color50A = %color50B%
		{
		Var50 = 1
		}
	else
		{
		Var50 = 0
		}

	if color51A = %color51B%
		{
		Var51 = 1
		}
	else
		{
		Var51 = 0
		}

	if color52A = %color52B%
		{
		Var52 = 1
		}
	else
		{
		Var52 = 0
		}

	if color53A = %color53B%
		{
		Var53 = 1
		}
	else
		{
		Var53 = 0
		}

	if color54A = %color54B%
		{
		Var54 = 1
		}
	else
		{
		Var54 = 0
		}

	if color55A = %color55B%
		{
		Var55 = 1
		}
	else
		{
		Var55 = 0
		}

	Var56 := (Var1 + Var2 + Var3 + Var4 + Var5 + Var6 + Var7 + Var8 + Var9 + Var10 + Var11 + Var12 + Var13 + Var14 + Var15 + Var16 + Var17 + Var18 + Var19 + Var20 + Var21 + Var22 + Var23 + Var24 + Var25 + Var26 + Var27 + Var28 + Var29 + Var30 + Var31 + Var32 + Var33 + Var34 + Var35 + Var36 + Var37 + Var38 + Var39 + Var40 + Var41 + Var42 + Var43 + Var44 + Var45 + Var46 + Var47 + Var48 + Var49 + Var50 + Var51 + Var52 + Var53 + Var54 + Var55)
	Var57 = 55


	if Var56 = %Var57%
			{
				if Var58 = 1
					{
					;intentionally left blank so the process bypasses the else process of sending the notification and starts the loop over.
					}
				else
					{
					sleep, 2000
					Run mailto:name@domain.com?subject=Feed Alert&body=The Feed Is Frozen
					sleep, 150
					SetTitleMatchMode, 2
					WinMinimize, Feed Alert
					ControlSend,_WwG1,!s,Feed Alert
		
					Var58 = 1
					}
			}
	else
			{
			Var58 = 0
			}

}

You may want to try AutoIt instead of autohotkey.
They are similar but AutoIt is easier to do more complex scripting.

In AutoIt, you can use 2 dimensional array to store the cordinates,
and then loop over each coordinate to store the value, and compare after sleep.

The idea is to type less, minimize redundancy, use more short cut, to save energy and time.
But to learn how to do these, it requires time and energy. :smiley:

In Autohotkey, X,Y coordinate can be stored in separate array (if you are using original and not _L version of autohotkey), but the code isn’t that pretty as you can see.
In a language like Python, things can be more elegant. But AutoIt can be a very usable compromise.
(I use AutoIt a lot to automate lots of report building, exporting, conversion, etc, at work)

; Tested with AutoHotKey_L (other than e-mail client invocation), but it should work with AutoHotKey basic, too

; I added MsgBox (and copying array element to variable) for debugging (they are commented out)


; For the loop index, we can use  "A_Index" instead of "i".
; But "i" is shorter to type. :)

; For initializing X and Y coordinate arrays
; You can use any formula (instead of simple +20, +10  stepping) and number of coordinate

i = 1
xx = 110 ; initial X coordinate
yy = 255 ; initial Y coordinate

lc = 55  ; loop count.  Make it 2 or 3 for debugging

loop, %lc%
{
	X%i% := xx
	Y%i% := yy
	;~ MsgBox in loop %lc%  i = %i% xx = %xx%  yy = %yy%
	i ++
	xx += 20
	yy += 10
}

; Initialize pixel array
i = 1
loop, %lc%
{
	PixelGetColor, C%i%, X%i%, Y%i%
	;~ c := C%i%, x := X%i%, y := Y%i%
	;~ MsgBox in pixel loop %lc%  i = %i%,  x = %x%,  y = %y%,   c = %c%
	i ++
}


; Main loop
loop
{
	;~ MsgBox in main loop 
	sleep 10000  ; 10 seconds sleep. Adjust timing as needed.
	rr = 0
	i = 1
	loop, %lc%
	{
		PixelGetColor, cc, X%i%, Y%i%
		;~ c := C%i%, x := X%i%, y := Y%i%
		;~ MsgBox in loop %lc%, i = %i% , X%i% = %x%, Y%i% = %y%,  %cc% ??  %c%

		if (C%i% = cc) {  ; compare against previously stored color
		;~ c := C%i%
		;~ MsgBox %c% = %cc%
		rr ++ ; flag if it's different
		}
		C%i% := cc ; store the current color to be compared on the next run
		i ++
	}

	if (  rr = lc ) ; if no pixel changed
	{
		; Do your things
		sleep, 2000
		Run mailto:name@domain.com?subject=Feed Alert&body=The Feed Is Frozen
		sleep, 150
		SetTitleMatchMode, 2
		WinMinimize, Feed Alert
		ControlSend,_WwG1,!s,Feed Alert
		MsgBox Frozen !  rr is %rr% 
		Break  ; Exit the loop (and program) once email is sent       
	}else{
	;~ MsgBox Pixel(s) changed
	}
}

I’ll have to look into what you did more.
As well as check on autoit. Sounds interesting.
I’m not a good scripter or programmer in regards to syntax.
I don’t know arrays yet, so that is probably one thing I need to learn soon.
I’ll probably use your revamp as an aid to learning those concepts.

[EDIT]
I finally downloaded AutoHotKey_L (the extended version) along with Scite editor for it and tested/debug the script in the previous post.
autohotkey.net/~Lexikos/Auto … nstall.exe
autohotkey.net/~fincs/SciTE4 … beta5a.exe

I changed the code in this post, correcting some errors I found debugging AutoHotKey version.
[/EDIT]

I found AutoHotkey interesting because it mixes literal string and keywords/symbols in code.
Also the way it handles arrays (which isn’t really arrays) is a bit like meta-programing, which is related to our talk in another thread.
But these can be confusing, and they may cause errors.
I guess that’s why they introduced new syntax that separates literal string by quotes and don’t use %% to indicate variables.

Another advantage of AutoHotkey is its license and its open source policy.
If you don’t like something in AutoHotKey, you can modify the program by yourself.
And sometime, minor modification to a language may make things a lot easier for specific style and type of programming, depending on the project.

Although many other languages can do similar tasks of automating windows, I think AutoIt and AutoHotKey (often combined with other scripts such as Excel Macro, etc) are the best solution in many cases.
I like Python a lot, and it can do these things with modules, but AutoIt/AutoHotkey is often easier to write this kind of job.

; AutoIt version for the sake of comparison.  Again, not tested.
; I do prefer AutoHotkey syntax for a script of this level. 
; Possibly,  AutoHotkey_L can be a good compromise (for added feature that makes programming easier)

$xx = 110 ; initial X coordinate
$yy = 255 ; initial Y coordinate
$lc = 55  ; number of elements in arrays, and then loop count

Dim XY[$lc][2] ; Declare an array for XY coordinates. 
Dim $C[$lc] ; An array to keep pixel color. This can be the third element of XY, if you prefer.

$lc -= 1 ; Decrement to be used for the loop count because array index is zero based (starts from 0 instead of 1)

; Initialize XY coordinates
For $i=0 to $lc  ; 0 to 54  =  55 times
  XY[$i][0] = $xx 
  XY[$i][1] = $yy 
  $xx += 20
  $yy += 10
Next


; Initialize pixel array
For $i=0 to $lc
  $C[$i] =  GetPixelColor(XY[$i][0], XY[$i][1]) 
Next

; Main loop
While 1 ; Endless loop
  Sleep(10000)
  $rr = 0  ; Reset the variable for the result
  For $i=0 to $lc
    $cc =  GetPixelColor(XY[$i][0], XY[$i][1])
    If $cc = $C[$i] Then $rr += 1 
  Next

  If $rr > $lc Then
     ; Do your things
                   Sleep(2000)
                   ; I'm not sure if ShellExecute would digest "mailto", correctly. If not, you may need to open e-mail client (or things like outlook) and feed the info.
                   ShellExecute("mailto:name@domain.com?subject=Feed Alert&body=The Feed Is Frozen")
                   Sleep(150)
                   ; http://www.autoitscript.com/autoit3/docs/intro/windowsadvanced.htm
                   ;SetTitleMatchMode, 2
                   WinMinimize("Feed Alert") ; Is it necessary to minimize it ???
                   ControlSend("Feed Alert", "", "[CLASSNN]","!s",) ; I guess there are other ways to do this.
                   Exitloop                   
  EndIf
  
WEnd


# Python version for  comparison.  Again, not tested.

# In python, comments are started with "#"
# Blocks are indicated by semicolon ":" and following indented part
# And Python is case sensitive unlike AutoIt


# ---- importing modules and defining helper function ----

# import time module for "time.sleep"
import time  

# For detecting the color of a pixel
# From rosetta code http://rosettacode.org/wiki/Color_of_a_screen_pixel
import win32gui
def get_pixel_colour(i_x, i_y):
	i_desktop_window_id = win32gui.GetDesktopWindow()
	i_desktop_window_dc = win32gui.GetWindowDC(i_desktop_window_id)
	long_colour = win32gui.GetPixel(i_desktop_window_dc, i_x, i_y)
	i_colour = int(long_colour)
	return (i_colour & 0xff), ((i_colour >> 8) & 0xff), ((i_colour >> 16) & 0xff)

# For sending e-mail using any server
import smtplib


# --- initialize variables ---

xx = 110 # initial X coordinate
yy = 255 # initial Y coordinate
lc = 55  # loop count

XY = []  # A list for XY coordinates. 
C = [] # A list to keep pixel color. 

# Initialize XY coordinates
for i in range(lc):  #   55 times
  XY.append( [xx, yy] )  # add a coordinate to the list
  xx += 20
  yy += 10

# Initialize pixel data
for i in range(lc):  
  C.append( get_pixel_colour(XY[i][0], XY[i][1]) ) 


# --- Main loop ---

while 1:  # Endless loop
  time.sleep(10.000)  # runs each 10 seconds
  rr = 0  # Reset the variable for the result
  for i in range(lc):
    cc =  get_pixel_colour(XY[i][0], XY[i][1])
    if cc == C[i]: rr += 1 
    C[i] = cc

  if rr == lc:  # Do your things and exit the probram
    # I removed window minimizing and sending Alt-S since python will send mail without opening additional window.
    server = smtplib.SMTP('smtp.gmail.com:587')
    server.starttls() # if the mail server uses TLS
    server.login('YourLoginName', 'Yourpassword_if_required') # If login is required
    sa = 'Jayson@somewhere.com' # sender
    da = 'name@domain.com' # recipiant
    subj = 'Feed alert'
    msg = 'The Feed Is Frozen'
    r = server.sendmail(sa, [da], 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s' % (sa, da, subj, msg) )
    server.quit()
    break  # break the endless loop once e-mail has been sent

I’ve been playing with AutoHotKey_L and found it very handy.

I added compiling helper to the editor, too.
autohotkey.com/forum/topic22975.html

I made slightly modified version with real array, and using A_Index to eliminate the separate index variable. So, it only works with AutoHotKey_L.

; Tested with AutoHotKey_L

xx = 150 ; initial X coordinate
yy = 220 ; initial Y coordinate
lc = 55 ; loop count.  Make it 2 or 3 for debugging

; initialize coordinates (with real array)
X := []
Y := []
loop % lc
	X.Insert(xx) , Y.Insert(yy), xx += 20, yy += 10

; Initialize pixels. Still using quasi-array
loop % lc
	PixelGetColor, C%A_Index%, X[A_Index], Y[A_Index] 

; Main loop
loop
{
	sleep 1000  ; 10 seconds sleep. Adjust timing as needed.
	rr = 0

	loop % lc
	{
		PixelGetColor, cc, X[A_Index], Y[A_Index] 
		;~ MsgBox % "in pixel loop " lc " i = " A_Index ",  x = " X[A_Index] ",  y = " Y[A_Index]  ", c = " C%A_Index% ",   cc = " cc
		if (C%A_Index% = cc)   ; compare against previously stored color
			rr ++ ; flag if it's same
		C%A_Index% := cc ; store the current color to be compared on the next run
	}

	if (  rr = lc ) ; if no pixel was different
	{
		; Do your things
		;~ MsgBox Frozen !  rr is %rr% 
		;~ Exit
		sleep, 2000
		Run mailto:name@domain.com?subject=Feed Alert&body=The Feed Is Frozen
		sleep, 150
		SetTitleMatchMode, 2
		WinMinimize, Feed Alert
		ControlSend,_WwG1,!s,Feed Alert
		Break  ; Exit the loop (and program) once email is sent       
	}else{
	;~ MsgBox Pixel(s) changed
	}
}