;===== set =====
app = "Battle.net"
tit = "디아블로 III"
exe = "C:\Program Files (x86)\Battle.net\Battle.net Launcher.exe"
cfg = C:\Users\Administrator\Documents\Diablo III\D3Prefs.txt
bak = C:\Users\Administrator\Documents\Diablo III\D3Prefs.bak
c1 = http://pds27.egloos.com/pds/201602/19/70/D3Prefs.txt
c2 = http://pds25.egloos.com/pds/201602/20/70/D3Prefs.txt
;===== on =====
[::
gosub, app
gosub, sys
return
;===== app =====
app:
{
IfWinNotExist, %app%
{
Run, %exe%
Sleep, 16000
WinActivate, %tit%
Sleep, 500
}
}
return
;===== sys =====
sys:
{
IfWinNotExist, %tit%
{
img(x, y, "start", "10")
MouseClick, Left, x, y
gosub, ini
Sleep, 27000
WinActivate, %tit%
Sleep, 2000
img(x, y, "room", "80")
MouseClick, Left, x, y
Sleep, 12000
}
}
return
;===== img =====
img(ByRef x, ByRef y, i, p){
ImageSearch, x, y, 1, 1, A_ScreenWidth, A_ScreenHeight, *%p% %A_ScriptDir%\img\%i%.bmp
If(ErrorLevel=1){
MsgBox, %i% 이미지를 찾지 못했습니다.
Sleep, 200
Pause
}
x+=10, y+=10
}
return
;===== ini =====
ini:
{
IfNotExist, %bak%
{
if(A_ScreenWidth>1920){
c1=%c1%
}else if(A_ScreenWidth=1920){
c1=%c2%
}else{
err("지원하지 않는 해상도입니다...")
}
IfExist, %cfg%
FileCopy, %cfg%, %bak%
URLDownloadToFile, %c1%, %cfg%
if ErrorLevel=1
err("다운로드에 문제가 생겼습니다.`n 백업 후 수동으로 진행바랍니다.")
}
}
return
;===== err =====
err(ByRef x){
MsgBox,,, %x%`n5초후 자동으로 사라집니다., 5
ExitApp
}