이 소스 사용해보시고 저처럼 작동이중지되었습니다 라고 오류 나는지좀 알려주실분
10~30분정도 실행해보면 그렇게나오네여
비활성이라 시작눌러도 특정창 비활성 매크로라 작동은 안합니다
시작 눌러서 저처럼 오류 나는지 확인점 해주실분.....ㅠㅠ
부탁드립니다
힘들게 만들었는데 사용을 못하고있습니다
작동 잘되다가 10~30분정도있으면 이런 오류가 뜹니다
ActiveID := "BlueStacks App Player"
DebugMode := 1
; 기본 설정
CoordMode, Pixel, Screen
CoordMode, ToolTip, Screen
SysGet, WindowCaptionHeight, 4 ; 캡션Height
SysGet, WindowBorderWidth, 32 ; 보더Width
SysGet, WindowBorderHeight, 33 ; 보더Height
; 이미지 서치
; seconds : 시간 지정 (기본설정상 1초 = 10번 시도, 0.5초 = 5번 시도함)
; imgX, imgY : 리턴받기 위해 사용
; fromX , fromY , toX , toY : 이미지 서치 범위 지정
; 리턴값 : 1 = 이미지 찾음 , 0 = 이미지 못찾음, -1 = 이미지 파일 없음
CheckImage(img, seconds=0, ByRef imgX="", ByRef imgY="", fromX=0, fromY=0, toX=0, toY=0)
{
global ActiveID, DebugMode
Sleep, 10
If ( ActiveID)
WinGetPos, winX, winY, winW, winH, % ActiveID
Else
winX := 0, winY := 0, winW := A_ScreenWidth, winH := A_ScreenHeight
sleepTime := 100
times := seconds * (1000 / sleepTime)
If ( times=0)
times := 1
x := winX, y := winY, w := winX+winW, h := winY+winH
If (fromX && fromY && toX && toY)
{
w := x+toX, h := y+toY, x := x+fromX, y := y+fromY
If ( DebugMode = 1)
{
ToolTip, 범위시작, x, y, 11
ToolTip, 범위끝, w, h, 12
}
}
Loop, %times%
{
ImageSearch, oX, oY, x, y, w, h, *50 %A_ScriptDir%\%img%
If ( ErrorLevel = 0)
{
imgX := oX
imgY := oY
If ( DebugMode = 1)
{
;ToolTip, %img%, imgX, imgY, 10
}
Return 1
}
Else If ( ErrorLevel = 2)
{
MsgBox, , , 이미지 없음 : %img% , 1
Return -1
}
Sleep, %sleepTime%
}
Return 0
}
; 비활성 이미지 클릭
; seconds : 시간 지정 (CheckImage 설정에 따름)
; fromX , fromY , toX , toY : 이미지 서치 범위 지정
; 리턴값 : 1 = 이미지 찾음 , 0 = 이미지 못찾음, -1 = 이미지 파일 없음
ClickImage(img, seconds=0, fromX=0, fromY=0, toX=0, toY=0)
{
Sleep, 10
result := CheckImage( img, seconds, x, y, fromX, fromY, toX, toY)
If (result = 1)
{
global ActiveID, DebugMode, WindowCaptionHeight, WindowBorderWidth, WindowBorderHeight
WinGetPos, winX, winY, winW, winH, % ActiveID
px:=x-winX-WindowBorderWidth
py:=y-winY-WindowBorderHeight-WindowCaptionHeight
p := px|py<<16
If ( DebugMode = 1)
{
;ToolTip, 이미지 클릭 %img%, x, y, 10
}
PostMessage, 0x201, 0, %p%, , % ActiveID
PostMessage, 0x202, 0, %p%, , % ActiveID
}
Sleep, 200
Return result
}
; 비활성 좌표 클릭
; x, y 좌표를 클릭
ClickPosition(x, y)
{
global ActiveID, DebugMode, WindowCaptionHeight, WindowBorderWidth, WindowBorderHeight
Sleep, 10
px:=x-WindowBorderWidth/2
py:=y-WindowBorderHeight/2-WindowCaptionHeight
p := px|py<<16
PostMessage, 0x201, 0, %p%, , % ActiveID
PostMessage, 0x202, 0, %p%, , % ActiveID
If ( DebugMode = 1)
{
WinGetPos, winX, winY, winW, winH, % ActiveID
;ToolTip, 좌표클릭, winX+px, winY+py, 10
}
Sleep, 200
Return 1
}
; 비활성 마우스 드래그
; (fromX, fromY) 좌표에서 (toX, toY) 로 드래그함
MouseDrag(fromX, fromY, toX, toY)
{
global ActiveID, DebugMode, WindowCaptionHeight, WindowBorderWidth, WindowBorderHeight
Sleep, 10
px1 := fromX-WindowBorderWidth/2
py1 := fromY-WindowBorderHeight/2-WindowCaptionHeight
p1 := px1|py1<<16
px2 := toX-WindowBorderWidth/2
py2 := toY-WindowBorderHeight/2-WindowCaptionHeight
p2 := px2|py2<<16
PostMessage, 0x201, 0, %p1%, , % ActiveID
PostMessage, 0x200, 0, %p2%, , % ActiveID
PostMessage, 0x202, 0, %p2%, , % ActiveID
If ( DebugMode = 1)
{
WinGetPos, winX, winY, winW, winH, % ActiveID
;ToolTip, 드래그시작, winX+px1, winY+py1, 11
;ToolTip, 드래그종료, winX+px2, winY+py2, 12
}
Sleep, 200
Return 1
}
Gui, Add, GroupBox, x12 y10 w232 h150 +center cred va, 대기중
Gui, Add, Text, x35 y40 w200 h30 , F1 : 매크로 시작?
Gui, Add, Text, x35 y80 w200 h30 , F2 : 매크로 종료
Gui, Add, Text, x35 y120 w200 h30 ,F3 : 매크로 정지
Gui, Add, Text, x160 y170 w110 h20 , 만든이? 백곰e
; Generated using SmartGUI Creator 4.0
Gui, Show,, 천하제일 용병단 매크로
Gui, Show, w255 h190,
Return
GuiClose:
ExitApp
return
f2::
GuiControl,,a,게임 종료
ExitApp ; 종료한다
f3::
GuiControl,,a,매크로 일시정지
reload ; 일시정지한다
f1::
SetDefaultMouseSpeed,0
SetKeyDelay,-1
SetControlDelay,-1
SetBatchLines, -1
SetWinDelay,-1
SetMouseDelay,-1
IfWinExist, BlueStacks App Player
WinActivate, BlueStacks App Player
WinMove, BlueStacks App Player, , 0, 0, 640, 480
WinSet, AlwaysOnTop, On, BlueStacks App Player
WinGetPos, X, Y, W, H, BlueStacks App Player
X2:=X+W
Y2:=Y+H
CoordMode, Screen
GuiControl,,a,게임 진행중
돌발:?
Loop
{
If ( ClickImage( "image\오류확인.png" ) = 1)
{
Sleep, 500
}
Else If ( CheckImage( "image\출석보상.png" ) = 1 )
{
Sleep, 500
ClickImage("image\출석보상 엑바.png")
Sleep, 500
gosub, 모험시작
}
Else If ( CheckImage( "image\스피드핵.png") = 1 )
{
Sleep, 500
ClickImage( "image\스피드핵 확인.png")
Sleep, 500
}
Else If ( ClickImage( "image\용병단 아이콘.png") = 1 )
{
Sleep, 500
}
Else If ( ClickImage( "image\용병단 메인화면.png") = 1 )
{
Sleep, 500
}
Else If ( CheckImage( "image\이벤트창.png") = 1 )
{
Sleep, 500
ClickImage( "image\이벤트창 확인.png")
Sleep, 500
}
Else If ( CheckImage( "image\특가구매.png") = 1 )
{
Sleep, 500
ClickImage( "image\특가구매 엑바.png")
Sleep, 500
ClickImage( "image\특가구매 엑바 확인.png")
Sleep, 500
}
Else
{
gosub, 모험시작
}
}
?
모험시작:
Loop
{
if ( ClickImage( "image\모험시작.png" ) = 1)
{
Sleep, 500???????????????????????????????????????????????
}
Else If ( ClickImage( "image\어려움.png" ) = 1 )
{
Sleep, 500????????????????????????????????????????????
}
Else If ( ClickImage( "image\요정의숲.png") = 1 )????
{
Sleep, 500??????????????????????????????????????????????
}
Else If ( ClickImage( "image\1-3.png" ) = 1 )????
{
Sleep, 500????????????????????????????????????????????
}
Else If ( ClickImage( "image\입장하기.png" ) = 1 )????
{
Sleep, 500?????
}
If ( ClickImage( "image\다시하기.png" ) = 1 )????
{
Sleep, 500????????
}
Else
{?
gosub, 스킬
}
}
스킬:
Loop
{?
If ( CheckImage( "image\스킬.png" ) = 1)
{
ClickPosition(535, 305)?
sleep, 1000
}
If ( CheckImage( "image\스킬.png" ) = 1)
{
ClickPosition(600, 305)
sleep, 1000
}
If ( CheckImage( "image\스킬.png" ) = 1)
{
ClickPosition(495, 375)?
sleep, 1000
}
If ( CheckImage( "image\스킬.png" ) = 1)
{
ClickPosition(560, 375)?
sleep, 1000
}
Else
{
break?
gosub, 에너지
}
}
?
에너지:
LOOP,
{
If ( CheckImage( "image\에너지부족.png" ) = 1)
{
Sleep, 500
ClickImage( "image\에너지부족 확인.png" )
Sleep, 30000
gosub, 돌발
}
Else If ( CheckImage( "image\부족.png") = 1 )
{
Sleep, 500
ClickImage( "image\부족 메인메뉴.png")
Sleep, 30000
gosub, 돌발
}
Else If ( ClickImage( "image\에너지구입.png") = 1 )
{
Sleep, 500
ClickImage( "image\에너지구입 취소.png")
Sleep, 500
ClickPosition(485, 145)?
sleep, 500
ClickPosition(23, 81)?
sleep, 500
ClickPosition(23, 81)?
sleep, 30000
gosub, 돌발
}
Else
{?
gosub, 보관함부족
}
}
보관함부족:
Loop,
{?
If ( CheckImage( "image\장비보관함부족.png") = 1 )
{
Sleep, 500
ClickImage( "image\장비보관함부족 확인.png")
Sleep, 500
gosub, 장비판매
}
Else If ( ClickImage( "image\보관함확장.png") = 1 )
{
Sleep, 500
ClickImage( "image\보관함확장 취소.png")
Sleep, 500
ClickPosition(485, 145)?
sleep, 500
ClickPosition(23, 81)?
sleep, 500
ClickPosition(23, 81)?
sleep, 500
gosub, 장비판매
}
Else
{?
gosub, 돌발
}
}
장비판매:
Loop
{?
If ( ClickImage( "image\용병단.png") = 1 )
{
sleep, 5000
ClickPosition(144, 250)?
sleep, 1000
}
Else If ( ClickImage( "image\장비인벤.png") = 1 )
{
Sleep, 3000
ClickPosition(351, 188)?
Sleep, 1000
}
Else If ( ClickImage( "image\장비판매.png") = 1 )
{
ClickImage("image\등급판매.png")
Sleep, 500
}
Else If ( CheckImage( "image\A급판매.png") = 1 )
{
Sleep, 500
ClickImage( "image\등급판매 확인.png")
Sleep, 500
}
Else If ( CheckImage( "image\B급판매.png") = 1 )
{
Sleep, 500
ClickImage( "image\등급판매 확인.png")
Sleep, 500
}
Else If ( CheckImage( "image\C급판매.png") = 1 )
{
Sleep, 500
ClickImage( "image\등급판매 확인.png")
Sleep, 500
}
Else If ( CheckImage( "image\판매완료.png") = 1 )
{
Sleep, 500
ClickImage( "image\판매완료 확인.png")
Sleep, 500
}
Else If ( ClickImage( "image\용병정보 1.png") = 1 )
{
Sleep, 500
}
Else If ( ClickImage( "image\용병정보 2.png") = 1 )
{
sleep, 3000
gosub, 돌발
}
}
스킬: 여기서
Else
{
break?
gosub, 에너지
}
확인해보세요.