매크로

조회 수 238 추천 0 댓글 3

Gui, Add, Text , x50 y5 w150 h20, F1 Start
Gui, Add, Text , x50 y20 w150 h20, F2 Fin
IfNotExist, BlueStacks App Player
{
 Run, C:\Program Files (x86)\BlueStacks\HD-StartLauncher.exe
}
Gui, Show

start := false


F1::
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 start := true
 
 Loop
 {
  
  While(true)
  {
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\mo.bmp
   if (ErrorLevel = 0 && start = true)
   {
    hideclick(FoundX,FoundY)
    RandSleep(5000,5500)
    hideclick2(470,450) ;1번스킬
    RandSleep(5000,5500)
    hideclick2(470,390) ;2번스킬
    break
   }
      
  }
   
   
  While(true)
  {
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\re.bmp ;재시작
   if (ErrorLevel = 0)
   {
     hideclick(FoundX,FoundY)
     RandSleep(7000,7500)
     
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\lv30.bmp ;상태창 확인
     if (ErrorLevel = 0)
     {
      hideclick(FoundX,FoundY)
      RandSleep(4000,4500)
      set()
      lvset()
      ready()
      back()
      break
     }
     
     else
     {
      break
     }
   }
  }
  
 }
}

set()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y

 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\set.bmp ;영웅관리
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   RandSleep(2000,2500)
   
   hideclick2(135,405)
   teamout()
   
   hideclick2(135,325) ;3번제거
   teamout()
   
   ;hideclick2(135,240) ;2번제거
   ;teamout()
   
   ;hideclick(135,165) ;1번제거
   ;teamout()
   break
  }
 }
}
ready()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 
 hideclick2(330,205) ;4번추가
 teamin()
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\image\4.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   break
  }
 }
 RandSleep(1000,1500)
 
 hideclick2(455,205) ;3번추가
 teamin()
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\image\3.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   break
  }
 }
 RandSleep(1000,1500)
 
 ;hideclick2(585,205) ;2번추가
 ;teamin()
 ;hideclick2(135,240)
 ;RandSleep(5000,5500)
 
 ;hideclick2(735,205) ;1번추가
 ;teamin()
 ;hideclick2(135,165)
 ;RandSleep(5000,5500)
}

teamout()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 
 RandSleep(3000,3500)
 ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\teamout.bmp
 if(ErrorLevel = 0)
 {
  hideclick(FoundX,FoundY)
  RandSleep(3000,3500)
 }
}

teamin()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 start := true
 
 RandSleep(2000,2500)
 ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\teamin.bmp
 if(ErrorLevel = 0)
 {
  hideclick(FoundX,FoundY)
 }
}


lvset()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 start := true
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\lvup.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   RandSleep(1500,2000)
   hideclick(FoundX,FoundY)
   RandSleep(1500,2000)
   break
  }
 }
}

back()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\image\back.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   break
  }
 }
}

hideclick(x,y)

 WinGetPos, w_x, w_y, w_w, w_h, BlueStacks App Player
 
 inx := x - w_x
 iny := y - w_y
 
 lparam := inx|iny<<16
 PostMessage, 0x201, 1, %lparam%, , BlueStacks App Player
 PostMessage, 0x202, 0, %lparam%, , BlueStacks App Player
}


hideclick2(x,y)

 
 lparam := x|y<<16
 PostMessage, 0x201, 1, %lparam%, , BlueStacks App Player
 PostMessage, 0x202, 0, %lparam%, , BlueStacks App Player
}

RandSleep(x,y)
{
 Random, rand, %x%, %y%
 Sleep %rand%
}

F2::
{
 start = false
 ExitApp
}

return


뭐 간단하게


  • profile
    북붕 2016.05.11 04:13
    randsleep(x,y)는 변수 2개쓰기 번거로우니 randsleep(x,dx=500)으로 하고 범위를 (x,x+dx)로 두는게 좋을 것 같아요. 이러면 혹시 random범위를 바꾸고 싶을때도 바꿀 수 있고요.
  • profile
    북붕 2016.05.11 04:27
    그리고 imagesearch의 범위가 항상 같으니 함수로 바꿔도 되겠네요.
    img(a) 로 함수를 지어 a에 이미지파일 이름을 넣는다던가.. imagesearch의 errorlevel=0 이면 true값을 리턴하고,

    if img("계산기.bmp")
    hideclick(100,200)

    이러면 되겠죠.

    아니면 foundx foundy를 활용하고자 imgclick(a) 이렇게 해 놓고 imagesearch의 errorlevel=0 이면 hideclick(foundx,foundy) 를 해주면 되겠네요.
    특정 좌표를 클릭하려면 imgclick2(a,x,y) 이렇게 해서 hideclick(x,y)를 함수 안에 넣어도 되고요.

    함수 활용으로 전체적으로 코드를 좀 줄일 수 있을거 같습니다.
  • Vesper 2016.05.15 00:23

    오 감사합니다 그런데 gdip 와 adb의 차이점이 뭔지 알수 있나요?

    이제 비활성화에 대해 알아보려하는데 뭐가 뭔지 찾아봐도 모르겠어요...

    간단하게 윈두우 상과 안드로이드 상에서 캡쳐해서 찾는 방식이라고는 한거같은데 ㅠㅠ


List of Articles
분류 제목 글쓴이 최근변경 추천
질문 이미지 서치 질문합니다!! 9 셋쇼마루 2016.05.15 0/0
질문 녹스 질문점요 4 krip11 2016.05.21 0/0
질문 비활성 질문받아주실분 ㅠ 리슈니안 2016.05.12 0/0
질문 특정좌표안에 마우스이동 5 흑콘 2016.05.13 0/0
자유 딜콜 오류 힘들지말입 2016.05.12 0/0
질문 스크린 절대좌표로 클릭하는법ㅠㅠ 2 웅쓰1 2016.05.13 0/0
질문 어디가 문제인지 도움좀... 1 혼자서는 2016.05.12 0/0
질문 gdip_imagesearchWithHwnd 함수가 어떤 켬퓨터에서 작... 5 북붕 2016.05.15 0/0
자유 그냥 간단하게 여태 만든거 올려봅니다. 3 Vesper 2016.05.15 0/0
자유 비활성 이미지서치 소스 공유 해주실 분 계신가요.... 8 Rabbit 2016.06.10 0/0
질문 reload말고 스크립트를 초기화 시킬 방법 없을까요 leejno 2016.05.10 0/0
질문 보안질문입니다. 5 힘들지말입 2019.08.17 0/0
질문 특정 창에서 특정 좌표 클릭하는 방법 질문 4 정떤 2016.05.09 0/0
자유 같이 개발하실분 구했습니다. 6 아스키 2016.05.09 0/0
질문 이미지 서치 관련 1 한리 2016.05.07 0/0
자유 이미지서치후 postmessage 1 근홍 2016.05.08 0/0
질문 이미지서치 딜레이질문 .. 5 혜띠뿌뿌 2016.05.09 0/0
질문 이미지서치 3 PlusK 2016.05.07 0/0
질문 1을 001로, 62를 062로 표현하는 식이 없을까요? 3 북붕 2016.05.09 0/0
질문 보더 값 과 캡션 값에 대하여... 2 앞프론뒷태 2016.05.13 0/0
Board Pagination Prev 1 ... 120121122123124125126127128 ... 209 Next
/ 209

전체 최신 인기글

전체 주간 인기글