105=(04:27) # 영웅 강화 : 목록을 모두 읽어왔습니다.
AutoStrengthenHero()
{
GuiControlGet, IsStrengthenHero, 10:
GuiControlGet, IsStrengthenCore, 10:
GuiControlGet, SacrificeStar, 10:
GuiControlGet, StrengthenStar2, 10:
GuiControlGet, StrengthenStar1, 10:
GuiControlGet, StrengthenCoreStar, 10:
GuiControlGet, StrengthenCore1th, 10:
GuiControlGet, StrengthenCore2th, 10:
GuiControlGet, StrengthenCore3th, 10:
GuiControlGet, StrengthenCore4th, 10:
GuiControlGet, StrengthenCore5th, 10:
GuiControlGet, GradeFirst, 10:
GuiControlGet, 3CoreSt, 10:
SacrificeLeft1 := 1
SacrificeLeft2 := 1
GoldShort := 0
CoreMode := 0
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0 ) )
return false
if ( IsStrengthenHero = 1 )
{
log := "# 영웅 자동 강화"
AddLog( log )
PushNote( "[Nebula] 영웅 강화", "" )
SetHeroStrengthenOrder( 1 )
if ( IsStrengthenCore = 1 )
{
CoreMode := 1
Loop, 4
{
A := A_Index
Loop, 6
{
Num%A%Core%A_Index%Target := 0
Num%A%Core%A_Index%NoPlus5 := 0
}
}
SetOrder( "Normal" )
if ( IsImagePlus( clickX, clickY, "Image\Hero\CoreHeroes.bmp", 445,59 516, 70, 478, 69 ) )
{
log := "# 정렬 오류 : 영웅 자동 강화 종료"
AddLog( log )
return false
}
ScanCore( Num1Core1Target, Num1Core2Target, Num1Core3Target, Num1Core4Target, Num1Core5Target, Num2Core1Target, Num2Core2Target, Num2Core3Target, Num2Core4Target, Num2Core5Target, Num3Core1Target, Num3Core2Target, Num3Core3Target, Num3Core4Target, Num3Core5Target, Num4Core1Target, Num4Core2Target, Num4Core3Target, Num4Core4Target, Num4Core5Target, Num1Core1NoPlus5, Num1Core2NoPlus5, Num1Core3NoPlus5, Num1Core4NoPlus5, Num1Core5NoPlus5, Num2Core1NoPlus5, Num2Core2NoPlus5, Num2Core3NoPlus5, Num2Core4NoPlus5, Num2Core5NoPlus5, Num3Core1NoPlus5, Num3Core2NoPlus5, Num3Core3NoPlus5, Num3Core4NoPlus5, Num3Core5NoPlus5, Num4Core1NoPlus5, Num4Core2NoPlus5, Num4Core3NoPlus5, Num4Core4NoPlus5, Num4Core5NoPlus5 )
if ( GradeFirst = 1 )
{
if ( StrengthenCoreStar > 0 and StrengthenCoreStar < 5 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( Num1Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num1Core%Kind%Target
NoPlus5 := Num1Core%Kind%NoPlus5
StrengthenCore( 1, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar > 1 and StrengthenCoreStar < 8 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( Num2Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num2Core%Kind%Target
NoPlus5 := Num2Core%Kind%NoPlus5
StrengthenCore( 2, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 3 or StrengthenCoreStar = 4 or ( StrengthenCoreStar > 5 and StrengthenCoreStar < 13 ) )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( ( 3CoreSt = 2 or 3CoreSt = 3 ) and Num3Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 2, Kind, Target, NoPlus5 )
Num3Core%Kind%Target := Target
Num3Core%Kind%NoPlus5 := NoPlus5
}
if ( ( 3CoreSt = 1 or 3CoreSt = 3 ) and Num3Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 4 or StrengthenCoreStar = 7 or StrengthenCoreStar > 10 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( Num4Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num4Core%Kind%Target
NoPlus5 := Num4Core%Kind%NoPlus5
StrengthenCore( 4, 2, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 14 or StrengthenCoreStar = 15 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( ( 3CoreSt = 2 or 3CoreSt = 3 ) and Num3Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 2, Kind, Target, NoPlus5 )
Num3Core%Kind%Target := Target
Num3Core%Kind%NoPlus5 := NoPlus5
}
if ( ( 3CoreSt = 1 or 3CoreSt = 3 ) and Num3Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 9 or StrengthenCoreStar = 10 or StrengthenCoreStar = 12 or StrengthenCoreStar = 15 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( Num2Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num2Core%Kind%Target
NoPlus5 := Num2Core%Kind%NoPlus5
StrengthenCore( 2, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 10 )
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( Num4Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num4Core%Kind%Target
NoPlus5 := Num4Core%Kind%NoPlus5
StrengthenCore( 4, 2, Kind, Target, NoPlus5 )
}
}
}
}
else
{
Loop, 5
{
Kind := StrengthenCore%A_Index%th
if ( StrengthenCoreStar > 0 and StrengthenCoreStar < 5 )
{
if ( Num1Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num1Core%Kind%Target
NoPlus5 := Num1Core%Kind%NoPlus5
StrengthenCore( 1, 1, Kind, Target, NoPlus5 )
}
}
if ( StrengthenCoreStar > 1 and StrengthenCoreStar < 8 )
{
if ( Num2Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num2Core%Kind%Target
NoPlus5 := Num2Core%Kind%NoPlus5
StrengthenCore( 2, 1, Kind, Target, NoPlus5 )
}
}
if ( StrengthenCoreStar = 3 or StrengthenCoreStar = 4 or ( StrengthenCoreStar > 5 and StrengthenCoreStar < 13 ) )
{
if ( 3CoreSt = 2 or 3CoreSt = 3 )
{
if ( Num3Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 2, Kind, Target, NoPlus5 )
Num3Core%Kind%Target := Target
Num3Core%Kind%NoPlus5 := NoPlus5
}
}
if ( 3CoreSt = 1 or 3CoreSt = 3 )
{
if ( Num3Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 4 or StrengthenCoreStar = 7 or StrengthenCoreStar > 10 )
{
if ( Num4Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num4Core%Kind%Target
NoPlus5 := Num4Core%Kind%NoPlus5
StrengthenCore( 4, 2, Kind, Target, NoPlus5 )
}
}
if ( StrengthenCoreStar = 14 or StrengthenCoreStar = 15 )
{
if ( 3CoreSt = 2 or 3CoreSt = 3 )
{
if ( Num3Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 2, Kind, Target, NoPlus5 )
Num3Core%Kind%Target := Target
Num3Core%Kind%NoPlus5 := NoPlus5
}
}
if ( 3CoreSt = 1 or 3CoreSt = 3 )
{
if ( Num3Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num3Core%Kind%Target
NoPlus5 := Num3Core%Kind%NoPlus5
StrengthenCore( 3, 1, Kind, Target, NoPlus5 )
}
}
}
if ( StrengthenCoreStar = 9 or StrengthenCoreStar = 10 or StrengthenCoreStar = 12 or StrengthenCoreStar = 15 )
{
if ( Num2Core%Kind%Target > 0 and SacrificeLeft1 = 1 and GoldShort = 0 )
{
Target := Num2Core%Kind%Target
NoPlus5 := Num2Core%Kind%NoPlus5
StrengthenCore( 2, 1, Kind, Target, NoPlus5 )
}
}
if ( StrengthenCoreStar = 10 )
{
if ( Num4Core%Kind%Target > 0 and SacrificeLeft2 = 1 and GoldShort = 0 )
{
Target := Num4Core%Kind%Target
NoPlus5 := Num4Core%Kind%NoPlus5
StrengthenCore( 4, 2, Kind, Target, NoPlus5 )
}
}
}
}
CoreMode := 0
Target := 0
NoPlus5 := 0
}
if ( ( SacrificeLeft2 = 1 or SacrificeLeft1 = 1 ) and GoldShort = 0 )
{
if ( ( SacrificeStar = 2 or SacrificeStar = 3 ) and SacrificeLeft2 = 1 and GoldShort = 0 )
{
if ( StrengthenStar2 = 1 or StrengthenStar2 = 2 or StrengthenStar2 = 3 )
{
StrengthenStarSt( 3, 2 )
}
if ( StrengthenStar2 = 4 or StrengthenStar2 = 5 or StrengthenStar2 = 6 or StrengthenStar2 = 7 or StrengthenStar2 = 8 )
{
StrengthenStarSt( 4, 2 )
}
if ( StrengthenStar2 = 2 or StrengthenStar2 = 3 )
{
if ( NextStar = 1 )
{
StrengthenStarSt( 4, 2 )
}
}
if ( StrengthenStar2 = 9 or StrengthenStar2 = 10 or StrengthenStar2 = 11 )
{
StrengthenStarSt( 5, 2 )
}
if ( StrengthenStar2 = 3 or StrengthenStar2 = 7 or StrengthenStar2 = 8 )
{
if ( NextStar = 1 )
{
StrengthenStarSt( 5, 2 )
}
}
if ( StrengthenStar2 = 10 or StrengthenStar2 = 11 )
{
if ( NextStar = 1 )
{
StrengthenStarSt( 4, 2 )
}
}
if ( StrengthenStar2 = 5 or StrengthenStar2 = 6 or StrengthenStar2 = 8 or StrengthenStar2 = 11 )
{
if ( NextStar = 1 )
{
StrengthenStarSt( 3, 2 )
}
}
if ( StrengthenStar2 = 6 )
{
if ( NextStar = 1 )
{
StrengthenStarSt( 5, 2 )
}
}
}
if ( ( SacrificeStar = 1 or SacrificeStar = 3 ) and SacrificeLeft1 = 1 and GoldShort = 0 )
{
if ( StrengthenStar1 = 1 or StrengthenStar1 = 2 )
{
StrengthenStarSt( 3, 1 )
}
if ( StrengthenStar1 = 3 or StrengthenStar1 = 4 )
{
StrengthenStarSt( 4, 1 )
}
if ( StrengthenStar1 = 2 and NextStar = 1 )
{
StrengthenStarSt( 4, 1 )
}
if ( StrengthenStar1 = 4 and NextStar = 1 )
{
StrengthenStarSt( 3, 1 )
}
}
}
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0) )
return false
Click( clickX, clickY )
SleepLog( TIME_WAITPOPUP )
if ( IsImagePlus( clickX, clickY, "Image\Events\Achievement.bmp", 60, 0) )
{
SleepLog( TIME_WAITPOPUP )
if ( IsImagePlus( clickX, clickY, "Image\Events\Achievement.bmp" , 60, 0) )
{
log := "# 업적 달성"
AddLog( log )
clickX := clickX + 35
clickY := clickY + 15
ClickToImage( clickX, clickY, "Image\Achievement\Out.bmp" )
GetAchievement()
}
}
if(IsImagePlus(clickX, clickY, "Image\Events\GuideQuest.bmp", 60, 0))
{
SleepLog( TIME_WAITPOPUP )
if(IsImagePlus(clickX, clickY, "Image\Events\GuideQuest.bmp", 60, 0))
{
log := "# 가이드 퀘스트 완료"
AddLog(log)
clickX := clickX + 40
clickY := clickY + 60
Click(clickX, clickY)
}
}
return
}
Click(clickX, clickY)
return
}
StrengthenStarSt( Star, St )
{
Cont := 1
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0) )
return false
SetHeroStrengthenOrder()
Loop,
{
W := FindTarget( Star )
if ( W = 0 )
{
log := "# " Star "성 강화대상 없음"
Addlog( log )
NextStar := 1
return
}
Loop,
{
Loop, 100
{
SleepLog( 1000 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp" , 60, 0) )
{
log := "# 강화대상 5강 완료 후 영웅관리 화면 복귀"
Addlog( log )
SetHeroStrengthenOrder()
break, 2
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp" , 60, 0) )
{
log := "# 영웅강화 화면 진입"
Addlog( log )
Click( clickX, clickY )
break
}
}
log := "# 강화재료 설정 : " St "성 30레벨 영웅"
Addlog( log )
Cont := SacrificeHero30( St )
if ( Cont = 0 )
{
log := "# 강화재료 또는 골드 부족"
Addlog( log )
NextStar := 0
Loop, 100
{
SleepLog( 1000 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp" , 60, 0) )
{
log := "# 강화대상 5강 완료 후 영웅관리 화면 복귀"
Addlog( log )
return
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp" , 60, 0) )
{
log := "# 영웅관리 화면으로 나가기"
Addlog( log )
Click( clickX, clickY )
return
}
}
}
else
{
log := "# 영웅강화 계속 시도"
Addlog( log )
}
}
}
}
FindTarget( Star )
{
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0) )
return false
Q := 1
n := 1
page := 0
EndPage := 0
Loop, 309
{
if ( IFStandbyHeroStar( Q , n ) )
{
if ( n = Star )
{
if ( IFStandbyHero5Plus( Q ) )
{
if ( IFStandbyHero30( Q ) )
{
log := "# " Q "위치 영웅정보 화면 진입"
Addlog( log )
QClick( Q )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\X.bmp", 60, 0) )
return false
if ( !IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp" , 60, 0) )
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\Confirm30.bmp" , 60, 0) )
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp" , 60, 0) )
Click( clickX, clickY )
R := FindBackward( Star, Q )
return R
}
else
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp" , 60, 0) )
Click( clickX, clickY )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0) )
return false
}
}
else
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp" , 60, 0) )
Click( clickX, clickY )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0) )
return false
}
}
}
}
if ( n > Star )
{
R := FindBackward( Star, Q )
return R
}
Q++
}
else
{
n++
}
if ( Q = 9 )
{
if ( EndPage = 1 )
{
R := FindBackward( Star, Q )
return R
}
Loop, 8
{
f := 5 * ( A_Index - 1 )
if ( ( page = f ) or ( page = f + 1 ) or ( page = f + 3 ) )
{
Drag( 522, 334, 522, 141 )
}
else if ( ( page = f + 2 ) or ( page = f + 4 ) )
{
Drag( 522, 334, 522, 142 )
}
}
sX := 624
sY := 361
eX := sX + 16
eY := sY + 19
if ( IsImagePlus( clickX, clickY, "Image\Hero\EndPage.bmp", 80, 0, sX, sY, eX, eY ) )
{
log := "# 마지막 페이지"
Addlog( log )
SleepLog( 3000 )
n := 1
EndPage := 1
}
page++
Q := 1
}
}
}
FindBackward( Star, Q )
{
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0 ) )
return false
Loop, 299
{
if ( Q = 1 )
{
if ( page = 0 )
{
return false
}
else
{
Loop, 8
{
f := 5 * ( A_Index - 1 )
if ( ( page = f ) or ( page = f + 1 ) or ( page = f + 3 ) )
{
Drag( 522, 141, 522, 334 )
}
else if ( ( page = f + 2 ) or ( page = f + 4 ) )
{
Drag( 522, 142, 522, 334 )
}
}
Q := 8
page--
if ( page = 0 )
{
SleepLog( 3000 )
}
}
}
else
{
Q := Q - 1
}
if ( IFStandbyHeroStar( Q, Star ) )
{
QClick( Q )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\X.bmp", 60, 0) )
return false
if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp" , 60, 0) )
{
return
}
else
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp" , 60, 0) )
ClickToImage( clickX, clickY, "Image\Hero\SettingOut.bmp" )
}
}
else
{
return false
}
}
}
IFStandbyHeroStar( Q , n )
{
if ( Q < 5 )
{
sX := 137 + Q * 105
sY := 193
}
else
{
sX := 137 + ( Q - 4 ) * 105
sY := 338
}
eX := sX + 30
eY := sY + 20
if ( n = 1 )
ColorID := 0xDBDBDB
else if ( n = 2 )
ColorID := 0xB0D247
else if ( n = 3 )
ColorID := 0x3685FC
else if ( n = 4 )
ColorID := 0xF88913
else if ( n = 5 )
ColorID := 0xEA3333
else if ( n = 6 )
ColorID := 0xD851D0
else
return true
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY) )
{
return true
}
else
{
return false
}
}
IFStandbyHero5Plus( Q )
{
if ( Q < 5 )
{
sX := 184 + Q * 105
sY := 83
}
else
{
sX := 184 + ( Q - 4 ) * 105
sY := 228
}
eX := sX + 16
eY := sY + 30
ImageName := "Image\Hero\Plus5.bmp"
if( IsImagePlus( clickX, clickY, ImageName, 95, "WHITE", sX, sY, eX, eY ) )
{
return true
}
else
{
return false
}
}
QClick( Q )
{
if ( Q < 5 )
{
clickX := 137 + Q * 105
clickY := 193
}
else
{
clickX := 137 + ( Q - 4 ) * 105
clickY := 338
}
Click( clickX, clickY )
}
IFStandbyHero30( Q )
{
if ( Q < 5 )
{
sX := 177 + Q * 105
sY := 154
}
else
{
sX := 177 + ( Q - 4 ) * 105
sY := 298
}
eX := sX + 23
eY := sY + 27
ImageName := "Image\Hero\MainFullLevel2.bmp"
if( IsImagePlus( clickX, clickY, ImageName, 95, "WHITE", sX, sY, eX, eY) )
{
return true
}
else
{
return false
}
}
IsPixelSquare( ByRef clickX, ByRef clickY, ColorID, sX, sY, eX, eY )
{
CoordMode, Pixel, Screen
RealWinSize(posX, posY, width, height, "BlueStacks App Player")
SysGet, wFrame, 7
SysGet, wCaption, 4
sX := sX + posX + wFrame
sY := sY + posY + wFrame + wCaption
eX := eX + posX + wFrame
eY := eY + posY + wFrame + wCaption
PixelSearch, vX, vY, sX, sY, eX, eY, %ColorID%, 30, Fast RGB
if (ErrorLevel = 0)
{
clickX := vX - posX
clickY := vY - posY
return true
}
if (ErrorLevel = 1)
{
clickX := 0
clickY := 0
return false
}
}
SacrificeHero30( St, Byref Target = 0, Byref NoPlus5 = 0 )
{
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenOut.bmp", 60, 0) )
return false
P := 1
n := 1
SCount := 0
EndPage := 0
Loop, 309
{
if ( IFSacrificeHeroStar( P, n ) )
{
if ( n = St )
{
if ( SCount = 5 )
{
log := "# " St "성 강화재료 투입 완료"
Addlog( log )
U := StrengthenNow( St, Target, NoPlus5 )
return U
}
if ( SCount > 0 )
{
PClick( P )
log := "# " St "성 강화재료 투입"
Addlog( log )
SCount++
}
else if ( IFSacrificeHero30( P ) )
{
PClick( P )
log := "# " St "성 강화재료 투입"
Addlog( log )
SCount++
}
}
if ( n > St )
{
if ( SCount > 0 )
{
SacrificeLeft%St% := 0
log := "# " St "성 강화재료 투입 완료"
Addlog( log )
U := StrengthenNow( St, Target, NoPlus5 )
if ( U = 1 )
{
if ( SacrificeLeft%St% = 1 )
{
return true
}
else
{
return false
}
}
else
{
return false
}
}
else
{
log := "# " St "성 강화재료 부족"
Addlog( log )
SacrificeLeft%St% = 0
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenOut.bmp", 60, 0 ) )
return false
Click( clickX, clickY )
return false
}
}
P++
}
else
{
n++
}
if ( P = 7 )
{
if ( EndPage = 1 )
{
if ( SCount > 0 )
{
SacrificeLeft%St% := 0
log := "# " St "성 강화재료 투입 완료"
Addlog( log )
U := StrengthenNow( St, Target, NoPlus5 )
if ( U = 1 )
{
if ( SacrificeLeft%St% = 1 )
{
return true
}
else
{
return false
}
}
else
{
return false
}
}
else
{
log := "# " St "성 강화재료 부족"
Addlog( log )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenOut.bmp", 60, 0 ) )
return false
Click( clickX, clickY )
return false
}
}
Drag( 522, 334, 522, 136 )
sX := 620
sY := 356
eX := sX + 16
eY := sY + 19
if ( IsImagePlus( clickX, clickY, "Image\Hero\EndPage2.bmp", 80, 0, sX, sY, eX, eY ) )
{
log := "# 마지막 페이지"
Addlog( log )
SleepLog( 3000 )
n := 1
EndPage := 1
}
P := 1
}
}
}
IFSacrificeHeroStar( P, n )
{
if ( P < 4 )
{
sX := 242 + P * 105
sY := 193
}
else
{
sX := 242 + ( P - 3 ) * 105
sY := 338
}
eX := sX + 30
eY := sY + 20
if ( n = 1 )
ColorID := 0xDBDBDB
else if ( n = 2 )
ColorID := 0xB0D247
else if ( n = 3 )
ColorID := 0x3685FC
else if ( n = 4 )
ColorID := 0xF88913
else if ( n = 5 )
ColorID := 0xEA3333
else if ( n = 6 )
ColorID := 0xD851D0
else
return true
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
{
return true
}
else
{
return false
}
}
IFSacrificeHero30( P )
{
if ( P < 4 )
{
sX := 276 + P * 106
sY := 157
}
else
{
sX := 276 + ( P - 3 ) * 106
sY := 305
}
eX := sX + 23
eY := sY + 15
ImageName := "Image\Hero\MainFullLevel2.bmp"
if( IsImagePlus( clickX, clickY, ImageName, 120, "WHITE", sX, sY, eX, eY) )
{
return true
}
else
{
return false
}
}
PClick( P )
{
if ( P < 4 )
{
clickX := 242 + P * 105
clickY := 193
}
else
{
clickX := 242 + ( P - 3 ) * 105
clickY := 338
}
Click( clickX, clickY )
}
StrengthenNow( St, Byref Target = 0, Byref NoPlus5 = 0 )
{
log := "# 강화 시도"
Addlog( log )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenS.bmp", 60, 0) )
return false
log := "# 하단 강화 버튼 클릭"
Addlog( log )
Click( clickX, clickY )
Loop,
{
SleepLog( 1000 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenNow.bmp", 60, 0 ) )
{
log := "# 바로 강화 버튼 클릭"
Addlog( log )
Click( clickX, clickY )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenResult.bmp", 60, 0 ) )
return false
log := "# 강화 완료! 강화결과 확인"
Addlog( log )
Loop, %SCount%
{
sX := 147 + A_Index * 68
sY := 133
eX := sX + 55
eY := sY + 25
if ( IsPixelSquare( clickX, clickY, 0x8EC63D, sX, sY, eX, eY ) )
{
log := "# " A_Index "번 강화 : 성공"
Addlog( log )
GuiControlGet, NumStrSuccess, 10:
NumStrSuccess++
GuiControl, 10:, NumStrSuccess, %NumStrSuccess%
}
else if ( IsPixelSquare( clickX, clickY, 0xFFE2AB, sX, sY, eX, eY ) )
{
log := "# " A_Index "번 강화 : 실패"
Addlog( log )
GuiControlGet, NumStrFailure, 10:
NumStrFailure++
GuiControl, 10:, NumStrFailure, %NumStrFailure%
}
else
{
log := "# " A_Index "번 강화 : 반환"
Addlog( log )
SacrificeLeft%St% := 1
}
}
if ( CoreMode = 1 )
{
if ( IsImagePlus( clickX, clickY, "Image\Hero\Plus5Prime.bmp", 120, "WHITE", 177, 65, 193, 85 ) )
{
Target--
NoPlus5--
}
}
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\StrengthenResult.bmp", 60, 0 ) )
return false
Click( clickX, clickY )
return true
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\GoldShort.bmp" , 60, 0) )
{
GoldShort := 1
log := "# 강화 골드 부족"
Addlog( log )
ClickToImage( clickX, clickY, "Image\Hero\StrengthenOut.bmp" )
Click( clickX, clickY )
return false
}
}
}
ScanCore( Byref Num1Core1Target, Byref Num1Core2Target, Byref Num1Core3Target, Byref Num1Core4Target, Byref Num1Core5Target, Byref Num2Core1Target, Byref Num2Core2Target, Byref Num2Core3Target, Byref Num2Core4Target, Byref Num2Core5Target, Byref Num3Core1Target, Byref Num3Core2Target, Byref Num3Core3Target, Byref Num3Core4Target, Byref Num3Core5Target, Byref Num4Core1Target, Byref Num4Core2Target, Byref Num4Core3Target, Byref Num4Core4Target, Byref Num4Core5Target, Byref Num1Core1NoPlus5, Byref Num1Core2NoPlus5, Byref Num1Core3NoPlus5, Byref Num1Core4NoPlus5, Byref Num1Core5NoPlus5, Byref Num2Core1NoPlus5, Byref Num2Core2NoPlus5, Byref Num2Core3NoPlus5, Byref Num2Core4NoPlus5, Byref Num2Core5NoPlus5, Byref Num3Core1NoPlus5, Byref Num3Core2NoPlus5, Byref Num3Core3NoPlus5, Byref Num3Core4NoPlus5, Byref Num3Core5NoPlus5, Byref Num4Core1NoPlus5, Byref Num4Core2NoPlus5, Byref Num4Core3NoPlus5, Byref Num4Core4NoPlus5, Byref Num4Core5NoPlus5 )
{
GuiControlGet, StrengthenCoreStar, 10:
GuiControlGet, IsNotStrengthen2Core1, 10:
GuiControlGet, IsNotStrengthen2Core2, 10:
GuiControlGet, IsNotStrengthen2Core3, 10:
GuiControlGet, IsNotStrengthen2Core4, 10:
GuiControlGet, IsNotStrengthen2Core5, 10:
log := "# 영웅 강화 : 목록을 읽어 옵니다."
Addlog( log )
Q := 1
n := 1
page := 0
EndPage := 0
Loop, 4
{
Star := A_Index
Loop, 5
{
Kind := A_Index
Num%Star%Core%Kind%NoPlus5 := 0
Num%Star%Core%Kind%Plus5 := 0
}
}
if ( StrengthenCoreStar = 1 )
{
Min := 1
Max := 1
}
else if ( StrengthenCoreStar = 2 )
{
Min := 1
Max := 2
}
else if ( StrengthenCoreStar = 3 )
{
Min := 1
Max := 3
}
else if ( StrengthenCoreStar = 4 )
{
Min := 1
Max := 4
}
else if ( StrengthenCoreStar = 5 )
{
Min := 2
Max := 2
}
else if ( StrengthenCoreStar = 6 or StrengthenCoreStar = 9 )
{
Min := 2
Max := 3
}
else if ( StrengthenCoreStar = 7 or StrengthenCoreStar = 10 or StrengthenCoreStar = 12 or StrengthenCoreStar = 15 )
{
Min := 2
Max := 4
}
else if ( StrengthenCoreStar = 8 )
{
Min := 3
Max := 3
}
else if ( StrengthenCoreStar = 11 or StrengthenCoreStar = 14 )
{
Min := 3
Max := 4
}
else if ( StrengthenCoreStar = 13 )
{
Min := 4
Max := 4
}
Loop, 309
{
if ( IFStandbyHeroStar( Q , n ) )
{
if ( n = Min or ( Min < n and n < Max ) or n = Max )
{
WhatCoreKind( Q, Kind )
if ( IFStandbyCore5Plus( Q ) )
{
Num%n%Core%Kind%Plus5++
}
else
{
Num%n%Core%Kind%NoPlus5++
}
}
if ( n > Max )
{
break
}
Q++
}
else
{
n++
}
if ( Q > 4 )
{
if ( EndPage = 1 )
{
if ( Q = 9 )
{
break
}
continue
}
if ( page = 0 )
{
Drag( 522, 135, 522, 235 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\OnePage.bmp", 80, 0 ) )
{
log := "# 마지막 페이지"
Addlog( log )
EndPage := 1
Q := 5
SleepLog( 3000 )
continue
}
SleepLog( 3000 )
Drag( 522, 235, 522, 135 )
}
else
{
Loop, 15
{
f := 5 * ( A_Index - 1 )
if ( ( page = f + 1 ) or ( page = f + 2 ) or ( page = f + 3 ) or ( page = f + 4 ) )
{
Drag( 522, 231, 522, 135 )
}
else if ( page = f )
{
Drag( 522, 232, 522, 135 )
}
}
}
if ( IsImagePlus( clickX, clickY, "Image\Hero\EndPage.bmp", 80, 0, 624, 361, 640, 380 ) )
{
log := "# 마지막 페이지"
Addlog( log )
SleepLog( 3000 )
EndPage := 1
}
page++
Q := 1
}
}
Loop, 4
{
Star := A_Index
Loop, 5
{
Kind := A_Index
Num%Star%Core%Kind%Target := Floor( ( Num%Star%Core%Kind%NoPlus5 + Num%Star%Core%Kind%Plus5 ) * 0.5 ) - Num%Star%Core%Kind%Plus5
}
}
if ( IsNotStrengthen2Core1 )
Num2Core1Target := 0
if ( IsNotStrengthen2Core2 )
Num2Core2Target := 0
if ( IsNotStrengthen2Core3 )
Num2Core3Target := 0
if ( IsNotStrengthen2Core4 )
Num2Core4Target := 0
if ( IsNotStrengthen2Core5 )
Num2Core5Target := 0
log := "# 영웅 강화 : 목록을 모두 읽어왔습니다."
Addlog( log )
}
IFCoreKind( Q, Kind )
{
if ( Kind = 1 )
{
ColorID := 0xF85303
if ( Q < 5 )
{
sX := 150 + Q * 105
sY := 130
}
else
{
sX := 150 + ( Q - 4 ) * 105
sY := 130 + 144
}
eX := sX + 5
eY := sY + 10
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
return true
}
else if ( Kind = 2 )
{
ColorID := 0x1355B6
if ( Q < 5 )
{
sX := 125 + Q * 105
sY := 120
}
else
{
sX := 125 + ( Q - 4 ) * 105
sY := 120 + 144
}
eX := sX + 12
eY := sY + 13
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
return true
}
else if ( Kind = 3 )
{
ColorID := 0x4E7F0A
if ( Q < 5 )
{
sX := 183 + Q * 105
sY := 90
}
else
{
sX := 183 + ( Q - 4 ) * 105
sY := 90 + 144
}
eX := sX + 11
eY := sY + 19
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
return true
}
else if ( Kind = 4 )
{
ColorID := 0xF42862
if ( Q < 5 )
{
sX := 157 + Q * 105
sY := 131
}
else
{
sX := 157 + ( Q - 4 ) * 105
sY := 131 + 144
}
eX := sX + 7
eY := sY + 11
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
return true
}
else if ( Kind = 5 )
{
ColorID := 0xBB00FD
if ( Q < 5 )
{
sX := 131 + Q * 105
sY := 102
}
else
{
sX := 131 + ( Q - 4 ) * 105
sY := 102 + 144
}
eX := sX + 20
eY := sY + 15
if ( IsPixelSquare( clickX, clickY, ColorID, sX, sY, eX, eY ) )
return true
}
else
{
return false
}
}
WhatCoreKind( Q, Byref Kind )
{
Static K := 1
Loop, 5
{
if ( IFCoreKind( Q, K ) )
{
Kind := K
return
}
if ( K = 5 )
{
K := 1
}
else
{
K++
}
}
}
IFStandbyCore5Plus( Q )
{
if ( Q < 5 )
{
sX := 184 + Q * 105
sY := 83
}
else
{
sX := 184 + ( Q - 4 ) * 105
sY := 228
}
eX := sX + 16
eY := sY + 30
if( IsImagePlus( clickX, clickY, "Image\Hero\Plus5Prime.bmp", 120, "WHITE", sX, sY, eX, eY ) )
{
return true
}
else
{
return false
}
}
StrengthenCore( Star, St, Kind, Byref Target, Byref NoPlus5 )
{
Cont := 1
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\normalHeroes.bmp", 60, 0 ) )
return false
SetHeroStrengthenOrder()
Loop,
{
W := FindCoreTarget( Star, Kind, Target, NoPlus5 )
if ( W = 0 )
{
log := "# " Star "성 " Kind "종 강화대상 원소 탐색 오류"
Addlog( log )
return
}
Loop,
{
Loop, 100
{
SleepLog( 1000 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp" , 60, 0) )
{
log := "# 강화대상 5강 완료 후 영웅관리 화면 복귀"
Addlog( log )
if ( Target = 0 )
{
return
}
SetHeroStrengthenOrder()
break, 2
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp" , 60, 0) )
{
log := "# 영웅강화 화면 진입"
Addlog( log )
Click( clickX, clickY )
break
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenOut.bmp" , 60, 0) )
{
log := "# 영웅강화 화면"
Addlog( log )
break
}
}
log := "# 강화재료 설정 : " St "성 30레벨 영웅"
Addlog( log )
Cont := SacrificeHero30( St, Target, NoPlus5 )
if ( Cont = 0 )
{
log := "# 강화재료 또는 골드 부족"
Addlog( log )
Loop, 100
{
SleepLog( 1000 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\SettingOut.bmp", 60, 0 ) )
{
log := "# 강화대상 5강 완료 후 영웅관리 화면 복귀"
Addlog( log )
return
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\X.bmp", 60, 0 ) )
{
log := "# 영웅관리 화면으로 나가기"
Addlog( log )
Click( clickX, clickY )
return
}
}
}
else
{
log := "# 영웅강화 계속 시도"
Addlog( log )
}
}
}
}
FindCoreTarget( Star, Kind, Target, NoPlus5 )
{
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\coreHeroes.bmp", 60, 0 ) )
return false
Q := 1
n := 1
page := 0
EndPage := 0
Loop, 309
{
if ( IFStandbyHeroStar( Q , n ) )
{
if ( n = Star )
{
if ( IFCoreKind( Q, Kind ) )
{
if ( !IFStandbyCore5Plus( Q ) )
{
log := "# " Q "위치 영웅정보 화면 진입"
Addlog( log )
QClick( Q )
if ( !WaitImagePlus( clickX, clickY, "Image\Hero\X.bmp", 60, 0 ) )
return false
if ( !IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp", 60, 0 ) )
{
log := "# 오류 : " Q "위치 5강 오인식"
Addlog( log )
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\Plus.bmp", 60, "WHITE", 271, 9, 300, 26 ) )
{
log := "# 강화대상 : 강화 중인 원소"
Addlog( log )
return true
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenB.bmp", 60, 0 ) )
{
ClickToImage( clickX, clickY, "Image\Hero\StrengthenOut.bmp" )
if ( !IsImagePlus( clickX, clickY, "Image\Hero\0Point.bmp", 60, 0 ) )
{
log := "# 강화대상 : 강화 중인 원소"
Addlog( log )
return true
}
else
{
NoPlus5--
if ( NoPlus5 = 0 )
{
log := "# 강화대상 : 마지막 원소"
Addlog( log )
return true
}
else if ( IsImagePlus( clickX, clickY, "Image\Hero\StrengthenOut.bmp", 60, 0 ) )
{
ClickToImage( clickX, clickY, "Image\Hero\X.bmp" )
ClickToImage( clickX, clickY, "Image\Hero\SettingOut.bmp" )
}
}
}
}
}
}
if ( n > Star )
{
log := "# 원소 탐색 오류 : 지정한 성수 초과"
Addlog( log )
return false
}
Q++
}
else
{
n++
}
if ( Q = 5 )
{
if ( EndPage = 1 )
{
if ( Q = 9 )
{
log := "# 원소 탐색 오류 : 마지막 페이지 넘김"
Addlog( log )
return false
}
continue
}
if ( page = 0 )
{
Drag( 522, 135, 522, 235 )
if ( IsImagePlus( clickX, clickY, "Image\Hero\OnePage.bmp", 80, 0 ) )
{
log := "# 마지막 페이지"
Addlog( log )
EndPage := 1
Q := 5
SleepLog( 3000 )
continue
}
SleepLog( 3000 )
Drag( 522, 235, 522, 135 )
}
else
{
Loop, 15
{
f := 5 * ( A_Index - 1 )
if ( ( page = f + 1 ) or ( page = f + 2 ) or ( page = f + 3 ) or ( page = f + 4 ) )
{
Drag( 522, 231, 522, 135 )
}
else if ( page = f )
{
Drag( 522, 232, 522, 135 )
}
}
}
if ( IsImagePlus( clickX, clickY, "Image\Hero\EndPage.bmp", 80, 0, 624, 361, 640, 380 ) )
{
log := "# 마지막 페이지"
Addlog( log )
SleepLog( 3000 )
EndPage := 1
}
page++
Q := 1
}
}
}
이미지를 못찾는거니