모바게님 함수를 쓰던 도중 이미지 범위 서치가 안됩니다..
아래 스크립트처럼 실행을 시키면 아래와 같은 오류가 납니다.
이부분을 어떻게 고쳐야 할까요??
(21) : ==> Blank parameter
Specifically: CheckImage("test.bmp", , , , 10, 10, 300, 300)
>Exit code: 2 Time: 0.1297
#NoEnv ?; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, force
SendMode Input
SetWorkingDir %A_ScriptDir% ?; Ensures a consistent starting directory.
SetBatchLines,-1
ListLines, Off
ActiveID := "BlueStacks App Player"
DebugMode := 1
Gui, Add, Button, gTestSearch2, 이미지 범위 서치
Gui, Add, Button, gRestart, 재시작
Gui, Show, , 테스트
Return
GuiClose:
ExitApp
Return
TestSearch2:
; 범위 서치
MsgBox, % CheckImage("test.bmp", , , , 10, 10, 300, 300)
Return
Restart:
Reload
Return
SysGet, WindowCaptionHeight, 4 ; 캡션Height
SysGet, WindowBorderWidth, 32 ; 보더Width
SysGet, WindowBorderHeight, 33 ; 보더Height
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
}
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)
{
Return -1
}
Sleep, %sleepTime%
}
Return 0
}
if (CheckImage("test.bmp", , , , 10, 10, 300, 300)=1)
{
msgbox,잘찾앗다
}
리턴값을... 적어주시요.. 펑션을 보시면 답이이겠죠..?