;ConnectionTester ;By jgpaiva ;date:26-04-2006 ;function: tries to download a page, in order to inform the user of the state of the connection #persistent DownloadInterval = 10 PageToDownload = http://www.this-page-intentionally-left-blank.org/ ShowMessage=True gosub,readini downloadtimer:=downloadinterval*1000 settimer,runthis,%downloadtimer% runthis: URLDownloadToFile,%pagetodownload%,tempfile.temp if errorlevel<>0 { menu,tray,icon,%A_WinDir%\system32\Shell32.dll, 28 } else { menu,tray,icon,%A_WinDir%\system32\Shell32.dll, 29 if ShowMessage=True msgbox, There is internet connection!! } return ReadIni: IfExist,%A_ScriptName%.ini { IniRead,DownloadInterval ,%A_ScriptName%.ini,Settings,DownloadInterval,%downloadInterval% IniRead,PageToDownload ,%A_ScriptName%.ini,Settings,PageToDownload,%PageToDownload% IniRead,ShowMessage ,%A_ScriptName%.ini,Settings,ShowMessage,ShowMessage } else GoSub,WriteIni return WriteIni: IfNotExist,%A_ScriptName%.ini FileAppend,%A_ScriptName%, IniWrite,%DownloadInterval% ,%A_ScriptName%.ini,Settings,DownloadInterval IniWrite,%PageToDownload% ,%A_ScriptName%.ini,Settings,PageToDownload IniWrite,%ShowMessage% ,%A_ScriptName%.ini,Settings,ShowMessage Return