▼ 어제 소스만 고치고 테스트는 너무 피곤해서 안해봤는데(집에 가면 해보려구요.)
혹시 고쳐야 곳이 있는지요?
Menu, Tray, Icon, Image\\Icon.ico
Gui, Add, GroupBox, x22 y19 w260 h270 , 동작
Gui, Add, Button, x42 y49 w110 h30 gRunApp, 게임실행
Gui, Add, Button, x42 y89 w110 h30 gStart, 경속시작
Gui, Add, Button, x42 y129 w110 h30 gOneShot, 한방기부
Gui, Add, Button, x42 y169 w50 h30 gGold, 원보
Gui, Add, Button, x102 y169 w50 h30 gCoin, 은화
Gui, Add, Button, x42 y209 w110 h30 gStop, 정지
Gui, Add, Text, x172 y39 w80 h20 +Center, [ 핫키 목록 ]
Gui, Add, Text, x162 y59 w100 h20 , F9 : 좌클릭 연타
Gui, Add, Text, x162 y79 w100 h20 , F10 : 동작정지
Gui, Add, Text, x162 y99 w100 h20 , F12 : 화면 넘기기
Gui, Add, Picture, x192 y119 w80 h160 , Image\\Icon2.png
Gui, Add, Text, x42 y259 w160 h20 , 문의 : m****@naver.com
; Generated using SmartGUI Creator 4.0
Gui, Show, x215 y645 h323 w315, HellSam v1.0
Return
GuiClose:
ExitApp
;-----------------------------------------------------------------------;
;------------------------------------------ Mouse Click
ClickHere(x, y) ; Sleep(1초) 클릭함수
{
sleep, 100
SysGet, wCaption, 4
SysGet, wFrame, 7
lX := x
lY := y
x := x - wFrame
y := y - wCaption - wFrame
Coor := x | y<<16
WinGet, ActiveID, ID, BlueStacks App Player
if not getkeystate("Ctrl" , "p")
{
PostMessage, 0x201, 1, %Coor%,, ahk_id %ActiveID% ; 마우스 왼쪽 버튼 다운, 좌표 Coor
PostMessage, 0x202, 0, %Coor%,, ahk_id %ActiveID% ; 마우스 왼쪽 버튼 업, 좌표 Coor
sleep, 1000
}
}
ClickHere2(x, y) ; Not Sleep 클릭함수
{
sleep, 100
SysGet, wCaption, 4
SysGet, wFrame, 7
lX := x
lY := y
x := x - wFrame
y := y - wCaption - wFrame
Coor := x | y<<16
WinGet, ActiveID, ID, BlueStacks App Player
if not getkeystate("Ctrl" , "p")
{
PostMessage, 0x201, 0, %Coor%,, ahk_id %ActiveID%
PostMessage, 0x202, 0, %Coor%,, ahk_id %ActiveID%
}
;-------------------------------------------- Image 함수
Bmp1(ByRef clickX, ByRef clickY, ImageName) ; @@색상오차57 이미지함수
{
CoordMode, Pixel, Screen
RealWinSize(posX, posY, width, height, "BlueStacks App Player")
appWidth := posX + width
appHeight := posY + height
ImageSearch, vX, vY, posX, posY, appWidth, appHeight, *57 %ImageName%
IfNotExist, %ImageName%
{
return false
}
if (ErrorLevel = 0)
{
clickX := vX - posX
clickY := vY- posY
return true
}
if (ErrorLevel = 1)
{
clickX := 0
clickY := 0
return false
}
}
BmpArea(ByRef clickX, ByRef clickY, ImageName, sX, sY, eX, eY) ; @@색상오차80 이미지 영역 함수
{
CoordMode, Pixel, Screen
RealWinSize(posX, posY, width, height, "BlueStacks App Player")
sX := sX + posX
sY := sY + posY
eX := eX + posX
eY := eY + posY
ImageSearch, vX, vY, sX, sY, eX, eY, *80 %ImageName%
IfNotExist, %ImageName%
{
return false
}
if (ErrorLevel = 0)
{
clickX := vX - posX
clickY := vY- posY
return true
}
if (ErrorLevel = 1)
{
clickX := 0
clickY := 0
return false
}
}
BmpTransBlack(ByRef clickX, ByRef clickY, ImageName) ; @@색상오차55 TransBlack이미지함수
{
CoordMode, Pixel, Screen
RealWinSize(posX, posY, width, height, "BlueStacks App Player")
appWidth := posX + width
appHeight := posY + height
ImageSearch, vX, vY, posX, posY, appWidth, appHeight, *55 %ImageName%
IfNotExist, %ImageName%
{
return false
}
if (ErrorLevel = 0)
{
clickX := vX - posX
clickY := vY- posY
return true
}
if (ErrorLevel = 1)
{
clickX := 0
clickY := 0
return false
}
}
;----------------------------------------- 기타 함수
RealWinSize(ByRef posX, ByRef posY, ByRef width , ByRef height, ProcessID)
{
WinGetPos, X, Y, W, H, %ProcessID%
SysGet, wFrame, 7
SysGet, wCaption, 4
posX := X
posY := Y
width := W - wFrame * 2
height := H - wFrame * 2 - wCaption
return
}
;------------------------------- Gui Button
RunApp: ; 게임실행 Button
run, "C:\Program Files (x86)\BlueStacks\HD-RunApp.exe" -p war.god.kingdom -a com.zhancheng.android.hjsg.HJSG ?HD-RunApp.exe ;게임실행
return
Start:
Loop
{
if(Bmp1(clickX, clickY, "Image\Main\End2.bmp")) ; 여포 클리어 완료
{
break
}
if(Bmp1(clickX, clickY, "Image\Main\End.bmp")) ; 여포 클리어 완료
{
break
}
if(Bmp1(clickX, clickY, "Image\Stage\ClearG.bmp")) ; 관문클리어
{
Click(322, 270)
Sleep, 2500
SelectGroup()
}
; 화살표 이미지 클릭
if(Bmp1(clickX, clickY, "Image\Hero\A1.bmp"))
{
Click(clickX, clickY)
}
if(Bmp1(clickX, clickY, "Image\Main\Waiting.bmp"))
{
AttackMonster()
}
if(Bmp1(clickX, clickY, "Image\Main\Attack.bmp"))
{
Click(clickX, clickY)
Sleep, 2500
}
if(Bmp1(clickX, clickY, "Image\Main\Next.bmp"))
{
Click(clickX, clickY)
}
}
return
SelectWorld()
{
Loop, 2
{
; 세계지도 이미지
if(Bmp1(clickX, clickY, "Image\Stage\W" A_Index ".bmp")=true)
{
Click(clickX, clickY)
}
}
}
return
SelectGroup()
{
Loop, 2
{
if(Bmp1(clickX, clickY, "Image\Stage\G" A_Index ".bmp")=true)
{
Click(clickX, clickY)
}
}
}
return
AttackMonster()
{
Loop, 2
{
if(BmpTransBlack(clickX, clickY, "Image\Hero\TransM" A_Index ".bmp")=true)
{
Click(clickX, clickY)
}
}
}
return