01-20-2015, 06:21 AM
(This post was last modified: 01-20-2015, 06:30 AM by xVincentNiKi.)
Where i put this in my script if someone can do a screenshot
Thanks in advance .
Thanks in advance .
Code:
#include <ImageSearch.au3>
#include <MsgBoxConstants.au3>
HotKeySet("{ESC}", "Terminate")
Func Terminate()
Exit 0
EndFunc
opt("mousecoordmode",0)
Global $Title = "BlueStacks App Player"
Global $HWnD = WinGetHandle (WinGetTitle($Title))
Global $ZC=0,$ZombieCount=0;, $E
Global $SearchZombie=0, $ZombieCount=0
Global $ZombieFileSets=5 ;Variant Image to use organized as per Folder
Global $Tolerance=70
Global $ZSExclude=3 ;Exlude lowest collector level for ZombieSearch. LowestCollector: $ZSExclude=0 means Search Lv6 up. Recommended Th9 = 2-3 (Start Elixir Lv9)
Global $Lx[4]= [ 0, 400, 0, 400 ]
Global $Ly[4]= [ 0, 0, 265, 265 ]
Global $Rx[4]= [ 460, 860, 400, 860 ]
Global $Ry[4]= [ 325, 325, 590, 590 ]
Global $MatchCount=0, $match=0
Global $Area[11][4]
Global $IS_x[11][4], $IS_y[11][4], $E[5][11]
; Global $Area[5][4], $IS_x[8][4], $IS_y[8][4], $E[5][11]
$E[0][0] = @ScriptDir&"\images\ELIX1\E6F9.bmp"
$E[0][1] = @ScriptDir&"\images\ELIX1\E7F9.bmp"
$E[0][2] = @ScriptDir&"\images\ELIX1\E8F9.bmp"
$E[0][3] = @ScriptDir&"\images\ELIX1\E9F9.bmp"
$E[0][4] = @ScriptDir&"\images\ELIX1\E10F8.bmp"
$E[0][5] = @ScriptDir&"\images\ELIX1\E10F9.bmp"
$E[0][6] = @ScriptDir&"\images\ELIX1\E11F8.bmp"
$E[0][7] = @ScriptDir&"\images\ELIX1\E11F9.bmp"
$E[0][8] = @ScriptDir&"\images\ELIX1\E12F7.bmp"
$E[0][9] = @ScriptDir&"\images\ELIX1\E12F8.bmp"
$E[0][10] = @ScriptDir&"\images\ELIX1\E12F9.bmp"
$E[1][0] = @ScriptDir&"\images\ELIX2\E6F9.bmp"
$E[1][1] = @ScriptDir&"\images\ELIX2\E7F9.bmp"
$E[1][2] = @ScriptDir&"\images\ELIX2\E8F9.bmp"
$E[1][3] = @ScriptDir&"\images\ELIX2\E9F9.bmp"
$E[1][4] = @ScriptDir&"\images\ELIX2\E10F8.bmp"
$E[1][5] = @ScriptDir&"\images\ELIX2\E10F9.bmp"
$E[1][6] = @ScriptDir&"\images\ELIX2\E11F8.bmp"
$E[1][7] = @ScriptDir&"\images\ELIX2\E11F9.bmp"
$E[1][8] = @ScriptDir&"\images\ELIX2\E12F7.bmp"
$E[1][9] = @ScriptDir&"\images\ELIX2\E12F8.bmp"
$E[1][10] = @ScriptDir&"\images\ELIX2\E12F9.bmp"
$E[2][0] = @ScriptDir&"\images\ELIX3\E6F9.bmp"
$E[2][1] = @ScriptDir&"\images\ELIX3\E7F9.bmp"
$E[2][2] = @ScriptDir&"\images\ELIX3\E8F9.bmp"
$E[2][3] = @ScriptDir&"\images\ELIX3\E9F9.bmp"
$E[2][4] = @ScriptDir&"\images\ELIX3\E10F8.bmp"
$E[2][5] = @ScriptDir&"\images\ELIX3\E10F9.bmp"
$E[2][6] = @ScriptDir&"\images\ELIX3\E11F8.bmp"
$E[2][7] = @ScriptDir&"\images\ELIX3\E11F9.bmp"
$E[2][8] = @ScriptDir&"\images\ELIX3\E12F7.bmp"
$E[2][9] = @ScriptDir&"\images\ELIX3\E12F8.bmp"
$E[2][10] = @ScriptDir&"\images\ELIX3\E12F9.bmp"
$E[3][0] = @ScriptDir&"\images\ELIX4\E6F9.bmp"
$E[3][1] = @ScriptDir&"\images\ELIX4\E7F9.bmp"
$E[3][2] = @ScriptDir&"\images\ELIX4\E8F9.bmp"
$E[3][3] = @ScriptDir&"\images\ELIX4\E9F9.bmp"
$E[3][4] = @ScriptDir&"\images\ELIX4\E10F8.bmp"
$E[3][5] = @ScriptDir&"\images\ELIX4\E10F9.bmp"
$E[3][6] = @ScriptDir&"\images\ELIX4\E11F8.bmp"
$E[3][7] = @ScriptDir&"\images\ELIX4\E11F9.bmp"
$E[3][8] = @ScriptDir&"\images\ELIX4\E12F7.bmp"
$E[3][9] = @ScriptDir&"\images\ELIX4\E12F8.bmp"
$E[3][10] = @ScriptDir&"\images\ELIX4\E12F9.bmp"
$E[4][0] = @ScriptDir&"\images\ELIXSNOW\E6F9.bmp"
$E[4][1] = @ScriptDir&"\images\ELIXSNOW\E7F9.bmp"
$E[4][2] = @ScriptDir&"\images\ELIXSNOW\E8F9.bmp"
$E[4][3] = @ScriptDir&"\images\ELIXSNOW\E9F9.bmp"
$E[4][4] = @ScriptDir&"\images\ELIXSNOW\E10F8.bmp"
$E[4][5] = @ScriptDir&"\images\ELIXSNOW\E10F9.bmp"
$E[4][6] = @ScriptDir&"\images\ELIXSNOW\E11F8.bmp"
$E[4][7] = @ScriptDir&"\images\ELIXSNOW\E11F9.bmp"
$E[4][8] = @ScriptDir&"\images\ELIXSNOW\E12F7.bmp"
$E[4][9] = @ScriptDir&"\images\ELIXSNOW\E12F8.bmp"
$E[4][10] = @ScriptDir&"\images\ELIXSNOW\E12F9.bmp"
ZombieSearch()
Func ZombieSearch()
WinActivate ($HWnD)
$SearchZombie=0
$ZombieCount=0
$MatchCount=0
$match=0
For $i=0 to 3 Step 1 ;Search per area
IS_Area($i, $Tolerance)
$ZombieCount=$ZombieCount+$ZC
$MatchCount=$match
Next
If $ZombieCount > 1 Then
$SearchZombie=1
EndIf
MsgBox(0,"","$ZombieCount= "&$ZOmbieCount&", $SearchZombie= "&$SearchZombie&", $MatchCount= "&$MatchCount&@CRLF&"----------------FILE1 E6F9"&@CRLF&$Area[0][0]&","&$Area[0][1]&@CRLF&$Area[0][2]&","&$Area[0][3]&@CRLF&"----------------FILE2: E7F9"&@CRLF&$Area[1][0]&","&$Area[1][1]&@CRLF&$Area[1][2]&","&$Area[1][3]&@CRLF&"----------------FILE3:E8F9"&@CRLF&$Area[2][0]&","&$Area[2][1]&@CRLF&$Area[2][2]&","&$Area[2][3]&@CRLF&"----------------FILE4:E9F9"&@CRLF&$Area[3][0]&","&$Area[3][1]&@CRLF&$Area[3][2]&","&$Area[3][3]&@CRLF&"----------------FILE5:E10F8"&@CRLF&$Area[4][0]&","&$Area[4][1]&@CRLF&$Area[4][2]&","&$Area[4][3]&@CRLF&"----------------FILE6:E10F9"&@CRLF&$Area[5][0]&","&$Area[5][1]&@CRLF&$Area[5][2]&","&$Area[5][3]&@CRLF&"----------------FILE7:E11F8"&@CRLF&$Area[6][0]&","&$Area[6][1]&@CRLF&$Area[6][2]&","&$Area[6][3]&@CRLF&"----------------FILE8:E11F9"&@CRLF&$Area[7][0]&","&$Area[7][1]&@CRLF&$Area[7][2]&","&$Area[7][3]&@CRLF&"----------------FILE9:E12F7"&@CRLF&$Area[8][0]&","&$Area[8][1]&@CRLF&$Area[8][2]&","&$Area[8][3]&@CRLF&"----------------FILE10:E12F8"&@CRLF&$Area[9][0]&","&$Area[9][1]&@CRLF&$Area[9][2]&","&$Area[9][3]&@CRLF&"----------------FILE11:E12F9"&@CRLF&$Area[10][0]&","&$Area[10][1]&@CRLF&$Area[10][2]&","&$Area[10][3]&@CRLF)
EndFunc
Func IS_Area($i, $Tolerance) ;Search per area then search per file. If not succeed variant 1 proceed 2 else proceed 3.
$ZC =0
For $s=0 to ($ZombieFileSets-1) Step 1
For $p=0+$ZSExclude to 10 Step 1
If FileExists($E[$s][$p]) Then
$Area[$p][$i]=_ImageSearchArea($E[$s][$p],0,$Lx[$i],$Ly[$i],$Rx[$i],$Ry[$i], $IS_x[$p][$i], $IS_y[$p][$i],$Tolerance)
If $Area[$p][$i]>0 Then
$ZC=1
ExitLoop(2)
EndIf
Else
$Area[$p][$i]=0
EndIf
Next
; MsgBox(0,"","$Area ["&$i&"] $ZC: "&$ZC&" $march="&$match&" ElixSet["&$s&"] = "&$Area[0][$i]&","&$Area[1][$i]&","&$Area[2][$i]&","&$Area[3][$i]&","&$Area[4][$i])
;If $ZC=1 Then
; ExitLoop
;EndIf
Next
EndFunc