매크로

조회 수 363 추천 0 댓글 1

 

게임내에서 숫자를 인식하는 소스인데 해석좀 부탁드려요 ㅠㅠ

 

 

=====================================================================================

 

 

number =
WinGet, hwnd, ID, A
imgDir = %A_ScriptDir%\image_autocheck
detectAuto := CheckAutoDetectWindows(x, y, hwnd, imgDir)
if detectAuto
loop 4
number .= GetAutoNumbers(x, y, hwnd, imgDir)
return
CheckAutoDetectWindows(byref num_x, byref num_y, hwnd, imgDir)
{
상태_오토신고창인식 = 주흔.bmp
global FindImage_area_x
global FindImage_area_y
global FindImage_area_width
global FindImage_area_height
FindImage_area_x := 149
FindImage_area_y := 234
FindImage_area_width := 266
FindImage_area_height := 348
if !FindImageScreen(num_x, num_y, hwnd, 상태_오토신고창인식, 70)
return 0
num_x += -3, num_y += 17
return 1
}
GetAutoNumbers(ByRef num_x, ByRef num_y, hwnd, imgDir)
{
global FindImage_area_x
global FindImage_area_y
global FindImage_area_width
global FindImage_area_height
FindImage_area_x := num_x
FindImage_area_y := num_y
FindImage_area_width := 7
FindImage_area_height := 9
margin = 10
loop 10
{
number := A_index - 1
pre = number_%number%
if FileExist(image := pre ".bmp")
{
if FindImageScreen(x, y, hwnd, image, margin)
{
num_x := x + 8
return number
}
}
else
{
loop 9
{
if !FileExist(image := pre "_" A_index ".bmp")
break
if FindImageScreen(x, y, hwnd, image, margin)
{
num_x := x + 8
return number
}
}
}
}
return
}
FindImageScreens(ByRef foundx,ByRef foundy, handle, image, margin)
{
global FindImage_area_x
global FindImage_area_y
global FindImage_area_width
global FindImage_area_height
IfWinNotExist ahk_id %handle%
{
foundx = -1
foundy = -1
return 0
}
CoordMode, Pixel, Screen
WinGetPos, winx,winy , width,height, ahk_id %handle%
if FindImage_area_x>=0
x := winx + FindImage_area_x
else
x := winx + width + FindImage_area_x
if FindImage_area_y>=0
y := winy + FindImage_area_y
else
y := winy + height + FindImage_area_y
if FindImage_area_width and FindImage_area_width<=width
width := FindImage_area_width
if FindImage_area_height and FindImage_area_height<=height
height := FindImage_area_height
ImageSearch, foundx,foundy , x,y , x+width, y+height , *transED1C24 *%margin% %image%
if ErrorLevel=0
{
foundx := foundx - winx -2.7
foundy := foundy - winy
return 1
}
else
if ErrorLevel=1
foundx = -1
else
{
MsgBox,, Error, %A_ThisFunc%`n`nImageSearch ErrorLevel2 오류
ExitApp
}
foundx = -1
foundy = -1
return 0
}


  • profile
    외치기 2016.08.03 17:56

    숫자가 들어있는 창의 위치를 파악하고

    왼쪽에서부터 하나씩 숫자를 비교하는 로직이네요.

    첫번째 숫자가 있을 범위에서 숫자이미지를 0부터 9까지 쭉 비교해보고

    이미지가 발견되면 두번째 숫자를 비교하기 위해 x값을 8 증가시키네요.


List of Articles
분류 제목 글쓴이 최근변경 추천
질문 Gdip비활성 이미지 서치중입니다 3 가족오락관 2016.08.05 0/0
자유 오버워치 에임만듬 13 셋쇼마루 2016.08.30 0/-1
질문 숫자인식 소스 해석 부탁드립니다 1 notes5 2016.08.03 0/0
질문 비활성 이미지서치 trans기능 함수 소스좀 얻을수 있을... 4 가족오락관 2016.07.31 0/0
질문 사인코드 우회할 수 있는 방법이 있나요? 1 사용메뉴얼 2016.08.21 0/0
질문 gui 명령어에 관해 질문드립니다 2 낙길 2016.08.03 0/0
질문 Fps 게임 에임고정을 만들어보았는데요 도와주세요 ㅠㅠ 갓버워치 2016.07.30 0/0
질문 오토핫키 로그인 인증방식과연동 관련하여 제작의뢰를 ... 4 혼마류 2023.02.24 0/0
질문 난독화 관련 질문 5 득칠 2016.08.03 0/0
질문 블택2 비활성클릭 안되나요? 3 수지가좋아 2016.10.25 0/0
질문 Postmessage 질문 3 카둠 2016.08.09 0/0
질문 오토핫키 + - * / 1 김현서 2016.07.25 0/0
질문 오토핫키 메이플1 에서 막히는데 뚫는법은 없나요? 밍코예 2019.08.17 0/0
질문 오토핫키를 이용해서 메이플2를 하는데 space 키를 입... 퓨쥬 2016.07.25 1/0
질문 RunWait에 관하여 질문드립니다. 2 낙길 2016.07.30 0/0
질문 영군 무한혼탑 좀 짜주실분 없을까요?... 라티엠 2016.07.25 0/-3
질문 붉은보석 게임가드나 핵쉴드 우회 2 RYORI 2017.01.08 0/0
자유 ahk파일 뜯으면서 공부하려고 하는데 4 에데루스 2016.07.29 0/0
질문 오버워치 인게임 픽셀서치 문제입니다 2 플레이 2018.02.03 0/0
질문 오토핫키 버전 어떤거 사용하시나요? 4 가족오락관 2016.07.25 0/0
Board Pagination Prev 1 ... 111112113114115116117118119 ... 209 Next
/ 209

전체 최신 인기글

전체 주간 인기글