컴퓨터&매크로/오토핫키_중급

[스크립트]컴퓨터켜져있는지확인하는스크립트

릭나스 2014. 11. 11. 22:15
반응형

#Persistent

Version = 1.0

ProgramName = 감시카메라 체크 프로그램

ProgramTitle = %ProgramName% v%Version%

Menu, Tray, NoDefault

Menu, Tray, NoStandard

Menu, Tray, Add, IP변경, IP

Menu, Tray, Add, 만든사람, copy

Menu, Tray, Add, E&xit, Close

Menu, Tray, Click, 1



TrayTip, %ProgramTitle%, 하남창고의 카메라와 매장 내 카메라의`n동작여부를 체크 합니다., 5, 1

sleep, 5000


IP_File = %A_WinDir%IP.txt


CoordMode, ToolTip, Screen


IfNotExist, %IP_File%

{

TrayTip, %ProgramTitle%, 최초 실행 시 하남창고 카메라 서버의 IP를 입력해야만 합니다., 5, 1

sleep, 3000

Gosub IP

}


FileRead, IP_num, %IP_File%


loop {


IfNotExist, \Camera-server카메라 정보 ec

Msgbox, 0, 경고!!, 매장 감시카메라 서버 확인요망


UrlDownloadToFile, http://%IP_num%:1000/web.gif, %Temp%camera.tmp

If ErrorLevel 0

Gosub msg

else

hanger = 0


sleep, 300000

}

Return


msg:

If hanger = 1

{

Gosub, msg3

Return

}


Msgbox, 12336, 경고!!, 창고 감시카메라 서버에 문제가 발생 되었을 수 있습니다.


Msgbox, 12324, 경고!!, 도움말을 보시겠습니까?

IfMsgBox, Yes

Msgbox, 4160, 도움말, 감시카메라 서버의 IP가 변경 되었거나`n서버가 다운 되었을 수 있습니다.`n서버가 다운 되었을 때는 직접 가서 재부팅을 해주어 합니다.`n`n단순히 IP가 변경된 경우라면 다음에서 변경된 IP를 입력 해주시면`n본 프로그램이 정상적으로 작동하게 됩니다.


Msgbox, 12324, 창고 카메라 서버 문제해결, IP가 변경 되었습니까?

IfMsgBox, Yes

Gosub IP

IfMsgBox, No

Gosub, msg2

Return



IP:

IPstart:

InputBox, UserInput, IP입력, IP를 입력 해주세요., , 200, 120

If ErrorLevel 0

Return

If Not UserInput

{

Msgbox, 0, 알림, IP를 입력 해주세요.

Goto IPstart

}

Msgbox, 36, 확인, 변경할 IP가 %UserInput% 이(가) 맞습니까?

IfMsgBox, Yes

{

FileDelete, %IP_File%

FileAppend, %UserInput%, %IP_File%

Msgbox, 64, 안내, 앞으로 변경된 IP %UserInput% 을(를) 체크하게 됩니다.

}

IfMsgBox, No

Goto IPstart

Return


msg2:

hanger=1

Msgbox, 4160, 문제해결 방법, 창고 카메라 서버 시스템을 재부팅 하십시오.`n재부팅이 완료되기 전까지 이 안내창은 계속 나오게 됩니다.

Return


msg3:

hanger=1

TrayTip, 경고!!, 창고 카메라 서버 시스템을 재부팅 하십시오.`n재부팅이 완료되기 전까지 이 안내창은 계속 나오게 됩니다., 5, 3

Return


Close:

TrayTip, 경고!!, 본 프로그램이 종료되면`n감시카메라의 상태를`n자동으로 체크할 수 없습니다., 5, 3

sleep, 500

MsgBox, 20, 프로그램 종료, 종료 하시겠습니까?

IfMsgBox, Yes

ExitApp

Return


copy:

TrayTip, 만든사람, 바로 나!, 5, 1

Return

728x90