매크로

조회 수 452 추천 1 댓글 2

openAd(){
 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%\lib\common\adventure.bmp
   if (ErrorLevel = 0)
   {
    hideclick(FoundX,FoundY)
    RandSleep(1000,1500)
    hideclick2(185,90)
    RandSleep(1000,1500)
    break
   }
  }
  RandSleep(1000,1500)
  While(true)
  {
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\lastadventure.bmp
   if (ErrorLevel = 0)
   {
    RandSleep(1000,1500)
    hideclick(FoundX,FoundY)
    break
   }
   else
   {
    RandSleep(1000,1500)
    hideclick2(608,435)
    break
   }
  }
 }
  
adventure()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y 
 S1:=0
 S2:=0
 S3:=0
  
  While(true)
  {
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\start.bmp
   if (ErrorLevel = 0)
   {
    hideclick(FoundX,FoundY)
    RandSleep(5000,5500)
    IniRead,S1,lib/Setting.ini,SkillChecked,S1
    IniRead,S2,lib/Setting.ini,SkillChecked,S2
    IniRead,S3,lib/Setting.ini,SkillChecked,S3
    useskill(S1)
    RandSleep(1500,2000)
    useskill(S2)
    RandSleep(1500,2000)
    useskill(S3)
    break
   }
      
  }
  
  While(true)
  {
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\skill.bmp ;각성
   if (ErrorLevel = 0)
    hideclick2(470,305)
   ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\re.bmp ;재시작
   if (ErrorLevel = 0)
   {
     hideclick(FoundX,FoundY)
     RandSleep(3000,3500)
     hideclick2(400,240)
     RandSleep(1000,1500)
     setdragon()
     
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\quest.bmp ;업적달성
     if (ErrorLevel = 0)
      hideclick(FoundX,FoundY)
     
     RandSleep(1000,1500)
     
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\lv30.bmp ;상태창 확인
     if (ErrorLevel = 0)
     {
      hideclick(FoundX,FoundY)
      RandSleep(3000,3500)
      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
 Mob1 :=0
 Mob2 :=0
 Mob3 :=0
 Mob4 :=0
  
 IniRead,Mob1,lib/Setting.ini,MobChecked,Mob1
 IniRead,Mob2,lib/Setting.ini,MobChecked,Mob2
 IniRead,Mob3,lib/Setting.ini,MobChecked,Mob3
 IniRead,Mob4,lib/Setting.ini,MobChecked,Mob4
 IniWrite,0,lib/Setting.ini,MobChecked,DelMob1
 IniWrite,0,lib/Setting.ini,MobChecked,DelMob2
 IniWrite,0,lib/Setting.ini,MobChecked,DelMob3
 IniWrite,0,lib/Setting.ini,MobChecked,DelMob4
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\heroset.bmp ;영웅관리
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   RandSleep(2000,2500)
   

   if(Mob4=1)
   {
    hideclick2(130,410) ;4번제거
    RandSleep(800,1000)   
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\check30.bmp ;30
    if(ErrorLevel = 0)
    {
     teamout()
     IniWrite,1,lib/Setting.ini,MobChecked,DelMob4
    }
    else
     teamnoout()
   }
   
   if(Mob3=1)
   {
    hideclick2(130,320) ;3번제거
    RandSleep(800,1000)    
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\check30.bmp ;30
    if(ErrorLevel = 0)
    {
     teamout()
     IniWrite,1,lib/Setting.ini,MobChecked,DelMob3
    }
    else
     teamnoout()
   }
   
   if(Mob2=1)
   {
    hideclick2(130,240) ;2번제거
    RandSleep(800,1000)
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\check30.bmp ;30
    if(ErrorLevel = 0)
    {
     teamout()
     IniWrite,1,lib/Setting.ini,MobChecked,DelMob2
    }
    else
     teamnoout()
   }
   
   if(Mob1=1)
   {
    hideclick2(130,165) ;1번제거
    RandSleep(800,1000)
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\check30.bmp ;30
    if(ErrorLevel = 0)
    {
     teamout()
     IniWrite,1,lib/Setting.ini,MobChecked,DelMob1
    }
    else
     teamnoout()
   }
   RandSleep(1000,1500)
   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
 setch := 1
 
 DelMob1 :=0
 DelMob2 :=0
 DelMob3 :=0
 DelMob4 :=0
  
 IniRead,DelMob1,lib/Setting.ini,MobChecked,DelMob1
 IniRead,DelMob2,lib/Setting.ini,MobChecked,DelMob2
 IniRead,DelMob3,lib/Setting.ini,MobChecked,DelMob3
 IniRead,DelMob4,lib/Setting.ini,MobChecked,DelMob4
 
 if(DelMob4=1)
 {
  while(true)
  {
   
   if(chok = 1)
   {
    setch := setch+1
    chok := 0
    break
   }
   
   setch(setch)
   teamin()
   
   while(true) ;4추가
   {
    
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\lib\Adventure\4.bmp
    if(ErrorLevel = 0)
    {
     hideclick(FoundX,FoundY)
     RandSleep(1000,1500)
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\fail.bmp
     if(ErrorLevel = 0)
     {
      setch := setch+1
      hideclick(FoundX,FoundY)
     }
     else
     {
      chok := 1
     } 
     break
    }
   }
   RandSleep(1000,1500)
  }
 }
 
 
 if(DelMob3=1)
 {
  while(true)
  {
   
   if(chok = 1)
   {
    setch := setch+1
    chok := 0
    break
   }
   
   setch(setch)
   teamin()
   
   while(true) ;3추가
   {
    
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\lib\Adventure\3.bmp
    if(ErrorLevel = 0)
    {
     hideclick(FoundX,FoundY)
     RandSleep(1000,1500)
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\fail.bmp
     if(ErrorLevel = 0)
     {
      setch := setch+1
      hideclick(FoundX,FoundY)
     }
     else
     {
      chok := 1
     } 
     break
    }
   }
   RandSleep(1000,1500)
  }
 }
 
 if(DelMob2=1)
 {
  while(true)
  {
   
   if(chok = 1)
   {
    setch := setch+1
    chok := 0
    break
   }
   
   setch(setch)
   teamin()
   
   while(true) ;2추가
   {
    
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\lib\Adventure\2.bmp
    if(ErrorLevel = 0)
    {
     hideclick(FoundX,FoundY)
     RandSleep(1000,1500)
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\fail.bmp
     if(ErrorLevel = 0)
     {
      setch := setch+1
      hideclick(FoundX,FoundY)
     }
     else
     {
      chok := 1
     } 
     break
    }
   }
   RandSleep(1000,1500)
  }
 }
 
 if(DelMob1=1)
 {
  while(true)
  {
   
   if(chok = 1)
   {
    setch := setch+1
    chok := 0
    break
   }
   
   setch(setch)
   teamin()
   
   while(true) ;1추가
   {
    
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *40 %A_ScriptDir%\lib\Adventure\1.bmp
    if(ErrorLevel = 0)
    {
     hideclick(FoundX,FoundY)
     RandSleep(1000,1500)
     ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\fail.bmp
     if(ErrorLevel = 0)
     {
      setch := setch+1
      hideclick(FoundX,FoundY)
     }
     else
     {
      chok := 1
     } 
     break
    }
   }
   RandSleep(1000,1500)
  }
 }

}

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%\lib\Adventure\teamout.bmp
 if(ErrorLevel = 0)
 {
  hideclick(FoundX,FoundY)
  RandSleep(1000,1500)
 }
}

teamnoout()
{
 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%\lib\Adventure\noout.bmp
 if(ErrorLevel = 0)
 {
  hideclick(FoundX,FoundY)
  RandSleep(1000,1500)
 }
}

teamin()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 RandSleep(2000,2500)
 ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\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
 
 while(true)
 {
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\lvup.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   while(true)
   {
    ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\lvup.bmp
    if(ErrorLevel = 0)
    {
     hideclick(FoundX,FoundY)
     break
    }
   }
   RandSleep(1000,1500)
   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%\lib\common\back.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
   break
  }
 }
}

superback()
{
 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)
 {
  RandSleep(1000,2000)
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\common\back.bmp
  if(ErrorLevel = 0)
  {
   hideclick(FoundX,FoundY)
  }
  else
   break
 }
}
setdragon()
{
 CoordMode, Pixel, Screen
 WinGetPos, pos_x,pos_y, width, height, BlueStacks App Player
 x_right := width + pos_x
 y_bottom := height + pos_y
 loop,3
 {
  RandSleep(500,800)
  ImageSearch,FoundX,FoundY,%pos_x%,%pos_y%,%x_right%,%y_bottom%, *50 %A_ScriptDir%\lib\Adventure\dragon.bmp ;용
  if (ErrorLevel = 0)
  {
   superback()
   openAd()
   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%
}

setch(x)
{
 if(x=1)
  hideclick2(330,200)
 if(x=2)
  hideclick2(460,200)
 if(x=3)
  hideclick2(590,200)
 if(x=4)
  hideclick2(720,200)
 if(x=5)
  hideclick2(330,410)
 if(x=6)
  hideclick2(460,410)
 if(x=7)
  hideclick2(590,410)
 if(x=8)
  hideclick2(720,410)
}

useskill(x)
{
 if(x=1)
  hideclick2(470,345)
 if(x=2)
  hideclick2(540,345)
 if(x=3)
  hideclick2(620,345)
 if(x=4)
  hideclick2(690,345)
 if(x=5)
  hideclick2(765,345)
 if(x=6)
  hideclick2(470,405)
 if(x=7)
  hideclick2(540,405)
 if(x=8)
  hideclick2(620,405)
 if(x=9)
  hideclick2(690,405)
 if(x=10)
  hideclick2(765,405)

}

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 := 800, winH := 480
 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)
  {
   Return -1
  }
  Sleep, %sleepTime%
 }
 Return 0
}

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
}



List of Articles
분류 제목 글쓴이 최근변경 추천
정보 블루스택 해상도 변경하기... 10 로뎀나무 2015.04.15 4/0
정보 블루스택 PostMessage 사용법 4 천례향 2016.03.21 0/0
정보 블레이드 보스만날시 스킬사용메크로 7 앙꼬호빵 2014.09.20 0/0
정보 브레이브 헌터 ... 매크로.. 1 제발등업좀2 2015.07.10 4/0
정보 복사 붙여넣기 프로그램 3 아잉뿌잉 2015.04.09 1/0
정보 별이되어라 색값 보정 함수선언.. 2 로뎀나무 2015.03.26 1/0
정보 별되-오토핫키매크로 <팁> 중복유의. 1 sanman 2015.05.03 0/0
정보 메이플매크로 보여중인데 3 검ㅇ응사막 2022.02.05 0/0
정보 메이플 아직 뚫리네요 9 천례향 2018.04.20 0/0
정보 맥주소 얻기 12 와이로 2015.10.05 1/0
정보 많은분들이 공유하신 확장모니터 사용법입니다. 골부리 2015.07.14 0/0
정보 마지막으로 작업했던 오토핫키 공유(4) -끝- 2 Vesper 2016.06.11 1/0
정보 마지막으로 작업했던 오토핫키 공유(3) 1 Vesper 2016.06.10 1/0
정보 마지막으로 작업했던 오토핫키 공유(2) 2 Vesper 2016.11.03 1/0
정보 마지막으로 작업했던 오토핫키 공유(1) 6 Vesper 2017.05.29 1/0
정보 레이븐 블루스택용 소스8탄 - 필요하신분쓰세요 추천X 4 T7GG 2016.11.14 1/0
정보 레이븐 블루스택용 소스7탄 - 필요하신분쓰세요 추천X 1 T7GG 2016.11.14 1/0
정보 레이븐 블루스택용 소스6탄 - 필요하신분쓰세요 추천X T7GG 2015.09.13 1/0
정보 레이븐 블루스택용 소스5탄 - 필요하신분쓰세요 추천X 1 T7GG 2016.11.14 1/0
정보 레이븐 블루스택용 소스4탄 - 필요하신분쓰세요 추천X T7GG 2015.09.13 1/0
Board Pagination Prev 1 23456 7 Next
/ 7

전체 최신 인기글

전체 주간 인기글