Here is the code for the loop portion: I changed the name of the website. Do Send("#r") ;WinWaitActive("Run") Send("http://www.website") ;open Demand Studios Electrical Send("{enter}") Sleep (3000) Send("{ALT}") ;opens source file Send("{RIGHT 2}") Send("{DOWN 12}") Send("{ENTER}") ; opens source file Sleep (3000) ; two second delay Send("{CTRLDOWN }") ; select all of source Send("{A}") Send("{A}") ; DUPLICATE NOT NEEDED Send("{C}") ; copy source code Send("{CTRLUP}") Send("{ENTER}") ; copy source code Sleep (4000) $handle = WinGetHandle ("") winclose ($handle) Sleep (4000) $handle = WinGetHandle ("") winclose ($handle) Sleep (4000) Send("{CTRLDOWN }") ;opens notepad Send("{ALTDOWN }") Send("{n}") Send("{CTRLUP }") Send("{ALTUP}") ;opens notepad Sleep (4000) Send("{CTRLDOWN}") ; pastes source to notepad Send("{V}") Send("{CTRLUP}") ; pastes source to notepad Sleep (5000) Send("{ALT}") Send("{DOWN 3}") Send("{ENTER}") Sleep (3000) Send("C:\Users\phil\Desktop\sourcetest.txt") ; saves source to notepad file Sleep (3000) Send("{ENTER}") Send("{LEFT}") Send("{ENTER}") ; saves source to notepad file Sleep (3000) $handle = WinGetHandle ("") winclose ($handle) #include<array.au3> ; finds total and puts in array $re = StringRegExp(FileRead('C:\Users\phil\Desktop\sourcetest.txt'), 'Total.*?\\d+)', 3) ;_ArrayDisplay($re) $secondtotal = $re[0] ;MsgBox (0, "", $firsttotal) ; displays total string in message box ~ until $secondtotal >= ($firsttotal + 25) Here are the declarations that are at the beginning of the code. dim $firsttotal dim $secondtotal dim $handle