Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deadbase Search
#21
I think there is a way to implement deadbase search by pixelgetcolor due to the gridstyle of the main screen. Although it might require the bot to do a lot of calculations. here's the idea.

The area to be searched shall have an increment of about 15-16pixels (as represented by small boxes on the grass) from top to bottom with varying x and fixed 45-50 as height.

Use Pixel get color to identify the collector and type (remember height is fixed 45-50). And we will have a hit if it is not an empty or 1/3 filled type collectors.

The key to this one is identifying the grid dimensions properly.

GKevinOD is expert on this one but he's busy atm.
Reply
#22
~~~update~~~
Please set aside these files temporarily:
;Buggy files SETA: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix4e12f9. replace Elix1e10f9 from orig
;Buggy files SETB: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix3e10f9,Elix4e10f9,Elix4e12f8,Elix4e12f9
;Buggy files SETC: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix3e10f9,Elix3e12f8,Elix3e12f9

New recommended tolerance for TH9 (Elixir 9 and up) = 90 for all sets.
Not sure for TH8 and below but I think 65-80.

NOTE: I tried SETA with the orig tolerance of 90 and it didn't work. It should have performed better than the previous update. It should have worked because it's based on the last version and with added images(and replaced some better ones). Thus found out that fully filled collector images need a different tolerance. As temporary fix, please set aside the collectors mentioned above. Hence, I think individual tolerance needed for appropriate fill.
Reply
#23
(01-12-2015, 11:52 AM)AtoZ Wrote:  ~~~update~~~
Please set aside these files temporarily:
;Buggy files SETA: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix4e12f9. replace Elix1e10f9 from orig
;Buggy files SETB: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix3e10f9,Elix4e10f9,Elix4e12f8,Elix4e12f9
;Buggy files SETC: Elix1e10f9,Elix1e12f9,Elix2e12f9,Elix3e10f9,Elix3e12f8,Elix3e12f9

New recommended tolerance for TH9 (Elixir 9 and up) = 90 for all sets.
Not sure for TH8 and below but I think 65-80.

NOTE: I tried SETA with the orig tolerance of 90 and it didn't work. It should have performed better than the previous update. It should have worked because it's based on the last version and with added images(and replaced some better ones). Thus found out that fully filled collector images need a different tolerance. As temporary fix, please set aside the collectors mentioned above. Hence, I think individual tolerance needed for appropriate fill.

I am sorry, I am completely confused by this post.
So you're saying we should go back to the original SETA pictures and tweak the tolerance (try 90 first)?
These settings didn't work because of the winter update but by the time the winter update is over, they will be the best set to use?
Reply
#24
Actually the original file images works better in my opinion. The new sets wasn't able to perform (skipped dead bases) because tolerance of most of the collectors are tight (65) where it should have been at 90. And tolerance 90 didn't work because we're getting false positives from collectors mentioned above. And that is why 65 worked well but skipped more than the first version.

I remember someone posted that it only recognize full collectors because at tolerance 65, full collector types are in it's working level and the other types are having problems at that tolerance w/c is tight. That explains why. Full collectors need tolerance of 65. and the original types need 90.

With this fix, I'm getting good results with SET A.

ATM, I'm recommending to transfer the files mentioned above to a different folder or by simply putting x on the file path in au3. Thus I recommend a new Tolerance w/c is 90 but you could still use 65. OR just use the current setups. I'll post new code later to make use of files mentioned above.

It's better to individualize tolerance and just set adjustments ex. +10 or -10.
Reply
#25
I see.

So in summary, the best results for you have seen, use SetA except remove:
- Elix1e10f9
- Elix1e12f9
- Elix2e12f9
- Elix4e12f9
- Copy Elix1e10f9 from original (say from Antitode's 5.3.4)

Tolerance 90, and if it does not work, tweak it.

Correct?

Heading to bed soon, want to test out your results. Smile
Reply
#26
Reply
#27
You would have to refactor the function, I would suggest each file have an adjustment value instead of the absolute tolerance value.

But my recommendation is not to complicate things and to use one tolerance value.
If those buggy files are causing fake positives and need a lower tolerance, I would update/fix those images instead.

What do you think?

I will try setA tonight with tolerance 90 without those 3 files and took the suggested original too. All with tolerance 90. I'll report back. It might skip some dead bases now that I am missing some images...
Reply
#28
~~~tolerance update

SET B and C:
Global $Tolerance[11]=[65,65,65,80,80, 65,80,80,0,75, 65]
Reply
#29
Code 
Where i put this in my script if someone can do a screenshot

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
Reply
#30
Can upload them there and share link
https://the.bytecode.club/showthread.php?tid=232
Reply
 


Forum Jump:


Users browsing this thread: 1 Guest(s)

About The Bytecode Club

We're a community focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website