피시방 행운상자 까다가 심심해서 만들어본 간단한 타이머 스크립트 입니다.
![](https://upload2.inven.co.kr/upload/2016/10/06/bbs/i13175587396.png?MW=800)
1. http://ahkscript.org/ 에서 오토핫키 다운로드 후 설치
2. 아래 스크립트내용을 메모장에 붙여넣고 '상자타이머.ahk' 란 이름으로 저장
3. 윈도탐색기에서 '상자타이머.ahk' 더블클릭으로 실행
실행파일로 컴파일해서 올리면 해킹툴로 의심받고 그래서 스크립트로 올려봅니다.
< 오토핫키 스크립트 >
#SingleInstance Force
Gui, Add, Text , xm w70, 설정시간(분)
Gui, Add, Edit , xp+90 w150 yp-5 number center vEdit타이머
Gui, Add, Button, xm gBtn시작 vBtn시작, 시작
Gui, Add, Button, xp+70 disabled gBtn중지 vBtn중지, 중지
Gui, Show,, 타이머
return
GuiClose:
ExitApp
Btn시작:
GuiControlGet, Edit타이머
setTimeValue := Edit타이머? Edit타이머:0
startTime := A_TickCount
endTime := startTime + setTimeValue*60000
GuiControl, Disable, Edit타이머
GuiControl, Disable, Btn시작
GuiControl, Enable, Btn중지
SetTimer, CheckTimer, 100
return
Btn중지:
SetTimer, CheckTimer, Off
GuiControl, Enable, Btn시작
GuiControl, Disable, Btn중지
GuiControl, Enable, Edit타이머
GuiControl,, Edit타이머, % setTimeValue
return
CheckTimer:
if (A_TickCount>endTime)
{
Gosub, Btn중지
WinActivate, - ArcheAge -
MsgBox,4096, 타이머, 타이머 알람...
return
}
;진행상황 표시
flowTimeValue := Round((endTime-A_TickCount)/60000)
GuiControl,, Edit타이머, % flowTimeValue "/" setTimeValue " (" (100-Round(flowTimeValue/setTimeValue*100)) "%)"
return