The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

BUG: 5.3.1: Bot hang/ blank windows

Started by dinobot · Jan 4, 2015

72 replies951,380 views
Jan 7, 2015#51

I used Imagesearch for restarting COC in BS, restarting Bluestacks in  5min counter, identifying main screen and the next button. I made sure my restart functions worked. I also added a lot of logs at the checkmainscreen and getresource. I also deleted the code below at checkmainscreen's 5min counter func as I thought checkmainscreen within checkmainscreen might complicate:

;  Do
; If _Sleep(10000) or $RunState = False Then ExitLoop(2)
;  Until ControlGetHandle("BlueStacks App Player", "", "BlueStacksApp1") <> 0

;  checkMainScreen()
;  ExitLoop(2)

The bot was able to restart successfully at first:

.....
2015-01-07 00:58:55 : (66) [G]: 52885        [E]: 9923         [D]: 4            [T]: 11
2015-01-07 00:59:03 : (67) [G]: 41355        [E]: 76252        [D]: 481          [T]: 22
2015-01-07 00:59:08 : (68) [G]: 1537         [E]: 17212        [D]: 118          [T]: 16
2015-01-07 01:04:18 : GETRESOURCES: Cannot Read within 10secs...
2015-01-07 01:04:18 : Cannot locate Next button, Restarting Bot
2015-01-07 01:04:18 : CheckMainScreen: PRoblem Loading...
2015-01-07 01:04:18 : Not in MainScreen. Trying to get to main screen
2015-01-07 01:04:33 : OutofSync: Reload Successful!!!
2015-01-07 01:04:33 : Checking for MainScreen in 7 secs...
2015-01-07 01:04:35 : In MainSCreen! Exiting Loop!
2015-01-07 01:04:35 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 01:04:40 : Training Troops...
2015-01-07 01:04:53 : Training Troops Complete
2015-01-07 01:04:58 : ===============Searching For Base===============
2015-01-07 01:05:01 : (1) [G]: 31135        [E]: 47783        [D]: 548          [T]: 22
2015-01-07 01:05:06 : (2) [G]: 352930       [E]: 357180       [D]: 1243         [T]: 28 
2015-01-07 01:05:09 : ~~~~~~~Dead Base Found!~~~~~~~
2015-01-07 01:05:09 : ===============Searching Complete===============

It managed to finish that next attack.

I didn't get a Gui blank screen at the end but the problem still persisted. It wasn't able to get to checknextbutton and checkmainscreen and not triggered any error logs where it should have. The last resource read I got was from the previous search. The hang without blank Gui happened at the next round of search before it was able to read resources and before it was able to trigger any error logs:

2015-01-07 01:13:53 : (41) [G]: 52309        [E]: 76335        [D]: 687          [T]: 14
2015-01-07 01:13:57 : (42) [G]: 24528        [E]: 63260        [D]: 19           [T]: 16
2015-01-07 01:14:03 : (43) [G]: 88617        [E]: 12711        [D]: 152          [T]: 23
2015-01-07 01:14:07 : (44) [G]: 32592        [E]: 33456        [D]: 337          [T]: 12

So I thought of the second while condition:
IMPORT3

But then I remember bot 003 still do hang WITH zombiesearch but I haven't tested without it. The readvalue  func doesn't have that that same waiting loop and it still experienced gui blank hang.

I'm so bugged by the problem LOL. Right now I'm also thinking It might still be related to imagesearch/memory. 

My big question is, does Madalilng's advanced deadbase search and COC app optimization still experience the same problem?

@Antidote
Did your fix worked?
Jan 7, 2015#52

I added a log every 5 read attempts to findout if what is happening during the loop in getresource func.

 While getGold($BSpos[0] + 51, $BSpos[1] + 66) = "" ; Loops until gold is readable
 If _Sleep(500*2) Or $RunState = False Then ExitLoop(2)
 $i += 1
 If Mod($i,5)=0 Then
     SetLog("GETRESOURCES: Cannot Read for the"&$i&"th time...")
 EndIf
 If $i >= 7 Then ; If gold cannot be read by 10 seconds
   IF $i >= 30/2 OR _ColorCheckVariation(Hex(PixelGetColor($BSpos[0] + 458, $BSpos[1] + 311), 6), Hex(0x33B5E5, 6)) Then
  SetLog("GETRESOURCES: Cannot Read within 30 loops...")

  If SearchImage($ISNext) Then ;Checks for Out of Sync or Connection Error during search
  SetLog("GETRESOURCES: Next Button Located...")
 Click(750, 500) ;Click Next
  Else
 SetLog("Cannot locate Next button, Restarting Bot")
 checkMainScreen()
 $Restart = True
 SetLog("GETRESOURCES: Going to MainScreen Successful!!!")
 ExitLoop(2)
  EndIf
   EndIf
   $i = 0
 EndIf
 WEnd

And the result:

2015-01-07 12:08:03 : ~~~~Welcome to COC Bot Pre-Alpha v5.3!~~~~
2015-01-07 12:08:03 : Bot is starting...
2015-01-07 12:08:08 : Training Troops...
2015-01-07 12:08:22 : Training Troops Complete
2015-01-07 12:08:23 : ~~~Waiting for full army~~~
2015-01-07 12:08:55 : Collecting Resources
2015-01-07 12:08:56 : Collecting Complete
2015-01-07 12:08:57 : Training Troops...
2015-01-07 12:09:10 : Training Troops Complete
2015-01-07 12:09:43 : Collecting Resources
2015-01-07 12:09:43 : Collecting Complete
2015-01-07 12:09:44 : Training Troops...
2015-01-07 12:09:58 : Training Troops Complete
2015-01-07 12:10:31 : Collecting Resources
2015-01-07 12:10:31 : Collecting Complete
2015-01-07 12:10:32 : Training Troops...
2015-01-07 12:10:46 : Training Troops Complete
2015-01-07 12:11:19 : Collecting Resources
2015-01-07 12:11:20 : Collecting Complete
2015-01-07 12:11:21 : Training Troops...
2015-01-07 12:11:35 : Training Troops Complete
2015-01-07 12:11:39 : ===============Searching For Base===============
2015-01-07 12:11:41 : (1) [G]: 27967        [E]: 65627        [D]: 142          [T]: 19
2015-01-07 12:11:46 : (2) [G]: 12290        [E]: 39199        [D]: 729          [T]: 34
2015-01-07 12:11:51 : (3) [G]: 101285       [E]: 55400        [D]: 356          [T]: 22
2015-01-07 12:11:55 : (4) [G]: 64773        [E]: 7349         [D]: 425          [T]: 25
2015-01-07 12:12:00 : (5) [G]: 79388        [E]: 156569       [D]:              [T]: 30
2015-01-07 12:12:05 : (6) [G]: 58380        [E]: 30834        [D]:              [T]: 15
2015-01-07 12:12:09 : (7) [G]: 61574        [E]: 45797        [D]: 416          [T]: 25
2015-01-07 12:12:14 : (8) [G]: 45559        [E]: 41343        [D]: 887          [T]: 30
2015-01-07 12:12:18 : (9) [G]: 40191        [E]: 42424        [D]: 129          [T]: 16
2015-01-07 12:12:23 : (10) [G]: 159707       [E]: 87363        [D]: 246          [T]: 25
2015-01-07 12:12:27 : (11) [G]: 28594        [E]: 15366        [D]: 19           [T]: 14
2015-01-07 12:12:32 : (12) [G]: 53121        [E]: 53412        [D]: 25           [T]: 20
2015-01-07 12:12:36 : (13) [G]: 35834        [E]: 37356        [D]: 907          [T]: 23
2015-01-07 12:12:41 : (14) [G]: 41332        [E]: 143301       [D]: 196          [T]: 14
2015-01-07 12:12:46 : (15) [G]: 77056        [E]: 58279        [D]: 0            [T]: 24
2015-01-07 12:12:50 : (16) [G]: 31843        [E]: 69274        [D]: 581          [T]: 17
2015-01-07 12:12:55 : (17) [G]: 42600        [E]: 90558        [D]: 365          [T]: 22
2015-01-07 12:12:59 : (18) [G]: 39414        [E]: 98101        [D]: 933          [T]: 20
2015-01-07 12:13:04 : (19) [G]: 51939        [E]: 40756        [D]: 98           [T]: 30
2015-01-07 12:13:10 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:13:13 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:13:13 : Cannot locate Next button, Restarting Bot
2015-01-07 12:13:13 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:13:13 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:13:28 : OutofSync: Reload Successful!!!
2015-01-07 12:13:28 : Checking for MainScreen in 7 secs...
2015-01-07 12:13:31 : In MainSCreen! Exiting Loop!
2015-01-07 12:13:31 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:13:35 : Training Troops...
2015-01-07 12:13:48 : Training Troops Complete
2015-01-07 12:13:53 : ===============Searching For Base===============
2015-01-07 12:13:56 : (1) [G]: 25492        [E]: 31381        [D]: 296          [T]: 31
2015-01-07 12:14:00 : (2) [G]: 38551        [E]: 16092        [D]: 1592         [T]: 34
2015-01-07 12:14:05 : (3) [G]: 6284         [E]: 118982       [D]: 834          [T]: 28
2015-01-07 12:14:09 : (4) [G]: 80552        [E]: 72873        [D]: 128          [T]: 22
2015-01-07 12:14:14 : (5) [G]: 28724        [E]: 53054        [D]: 30           [T]: 16
2015-01-07 12:14:18 : (6) [G]: 62967        [E]: 80815        [D]: 488          [T]: 15
2015-01-07 12:14:23 : (7) [G]: 53604        [E]: 280532       [D]: 619          [T]: 20
2015-01-07 12:14:27 : (8) [G]: 83051        [E]: 85872        [D]: 9            [T]: 28
2015-01-07 12:14:32 : (9) [G]: 72481        [E]: 64215        [D]: 674          [T]: 34
2015-01-07 12:14:37 : (10) [G]: 106844       [E]: 57156        [D]: 639          [T]: 17
2015-01-07 12:14:41 : (11) [G]: 52146        [E]: 42693        [D]: 1577         [T]: 18
2015-01-07 12:14:46 : (12) [G]: 34818        [E]: 84957        [D]: 130          [T]: 28
2015-01-07 12:14:50 : (13) [G]: 32646        [E]: 30758        [D]: 100          [T]: 13
2015-01-07 12:14:55 : (14) [G]: 49625        [E]: 60584        [D]: 65           [T]: 14
2015-01-07 12:14:59 : (15) [G]: 37846        [E]: 60551        [D]: 370          [T]: 18
2015-01-07 12:15:04 : (16) [G]: 16341        [E]: 43907        [D]: 115          [T]: 21
2015-01-07 12:15:08 : (17) [G]: 20878        [E]: 39639        [D]: 82           [T]: 22
2015-01-07 12:15:13 : (18) [G]: 43522        [E]: 419840       [D]: 3396         [T]: 21
2015-01-07 12:15:18 : (19) [G]: 35937        [E]: 73079        [D]: 244          [T]: 20
2015-01-07 12:15:22 : (20) [G]: 33944        [E]: 60224        [D]: 161          [T]: 32
2015-01-07 12:15:27 : (21) [G]: 46194        [E]: 55610        [D]: 943          [T]: 26
2015-01-07 12:15:31 : (22) [G]: 80040        [E]: 49214        [D]: 415          [T]: 15
2015-01-07 12:15:36 : (23) [G]: 51612        [E]: 26122        [D]: 414          [T]: 23
2015-01-07 12:15:40 : (24) [G]: 17066        [E]: 80654        [D]: 292          [T]: 24
2015-01-07 12:15:45 : (25) [G]: 71886        [E]: 8914         [D]: 176          [T]: 29
2015-01-07 12:15:49 : (26) [G]: 47759        [E]: 25683        [D]: 0            [T]: 22
2015-01-07 12:15:54 : (27) [G]: 54293        [E]: 6374         [D]: 379          [T]: 24
2015-01-07 12:15:59 : (28) [G]: 147656       [E]: 18543        [D]: 450          [T]: 20
2015-01-07 12:16:03 : (29) [G]: 235870       [E]: 118717       [D]: 1151         [T]: 15
2015-01-07 12:16:08 : (30) [G]: 22812        [E]: 13819        [D]: 343          [T]: 17
2015-01-07 12:16:12 : (31) [G]: 21892        [E]: 11823        [D]: 353          [T]: 21
2015-01-07 12:16:17 : (32) [G]: 45081        [E]: 120166       [D]: 496          [T]: 13
2015-01-07 12:16:21 : (33) [G]: 28555        [E]: 40781        [D]: 557          [T]: 16
2015-01-07 12:16:28 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:16:30 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:16:30 : Cannot locate Next button, Restarting Bot
2015-01-07 12:16:30 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:16:30 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:16:46 : OutofSync: Reload Successful!!!
2015-01-07 12:16:46 : Checking for MainScreen in 7 secs...
2015-01-07 12:16:48 : In MainSCreen! Exiting Loop!
2015-01-07 12:16:48 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:16:53 : Training Troops...
2015-01-07 12:17:05 : Training Troops Complete
2015-01-07 12:17:10 : ===============Searching For Base===============
2015-01-07 12:17:13 : (1) [G]: 10677        [E]: 64731        [D]: 76           [T]: 29
2015-01-07 12:17:17 : (2) [G]: 44515        [E]: 14268        [D]: 580          [T]: 16
2015-01-07 12:17:22 : (3) [G]: 62010        [E]: 35308        [D]: 391          [T]: 14
2015-01-07 12:17:27 : (4) [G]: 14606        [E]: 118121       [D]: 798          [T]: 18
2015-01-07 12:17:31 : (5) [G]: 13967        [E]: 34671        [D]: 392          [T]: 17
2015-01-07 12:17:36 : (6) [G]: 29022        [E]: 80752        [D]: 460          [T]: 15
2015-01-07 12:17:40 : (7) [G]: 17127        [E]: 29187        [D]: 454          [T]: 31
2015-01-07 12:17:45 : (8) [G]: 5058         [E]: 78218        [D]: 239          [T]: 18
2015-01-07 12:17:49 : (9) [G]: 30696        [E]: 23990        [D]: 677          [T]: 18
2015-01-07 12:17:54 : (10) [G]: 38752        [E]: 56484        [D]: 534          [T]: 21
2015-01-07 12:17:59 : (11) [G]: 19260        [E]: 73880        [D]: 269          [T]: 21
2015-01-07 12:18:03 : (12) [G]: 15109        [E]: 81089        [D]: 376          [T]: 22
2015-01-07 12:18:08 : (13) [G]: 18591        [E]: 121712       [D]: 470          [T]: 24
2015-01-07 12:18:12 : (14) [G]: 38702        [E]: 14785        [D]: 620          [T]: 24
2015-01-07 12:18:17 : (15) [G]: 72908        [E]: 34814        [D]: 130          [T]: 21
2015-01-07 12:18:23 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:18:25 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:18:25 : Cannot locate Next button, Restarting Bot
2015-01-07 12:18:26 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:18:26 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:18:41 : OutofSync: Reload Successful!!!
2015-01-07 12:18:41 : Checking for MainScreen in 7 secs...
2015-01-07 12:18:43 : In MainSCreen! Exiting Loop!
2015-01-07 12:18:43 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:18:49 : Training Troops...
2015-01-07 12:19:01 : Training Troops Complete
2015-01-07 12:19:07 : ===============Searching For Base===============
2015-01-07 12:19:09 : (1) [G]: 95626        [E]: 23492        [D]: 413          [T]: 18
2015-01-07 12:19:13 : (2) [G]: 161634       [E]: 415141       [D]: 1090         [T]: 16
2015-01-07 12:19:21 : ~~~~~~~Not dead base, skipping~~~~~~~
2015-01-07 12:19:25 : (3) [G]: 99866        [E]: 293019       [D]: 1092         [T]: 14
2015-01-07 12:19:30 : (4) [G]: 76223        [E]: 3574         [D]: 679          [T]: 15
2015-01-07 12:19:35 : (5) [G]: 99141        [E]: 46347        [D]: 331          [T]: 25
2015-01-07 12:19:39 : (6) [G]: 38698        [E]: 72434        [D]: 753          [T]: 15
2015-01-07 12:19:44 : (7) [G]: 3912         [E]: 57026        [D]: 466          [T]: 27
2015-01-07 12:19:48 : (8) [G]: 96322        [E]: 75045        [D]: 298          [T]: 17
2015-01-07 12:19:53 : (9) [G]: 20412        [E]: 49051        [D]: 221          [T]: 13
2015-01-07 12:19:57 : (10) [G]: 56877        [E]: 33563        [D]: 214          [T]: 14
2015-01-07 12:20:04 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:20:05 : (11) [G]: 65720        [E]: 45261        [D]: 970          [T]: 28
2015-01-07 12:20:10 : (12) [G]: 30355        [E]: 102275       [D]: 759          [T]: 20
2015-01-07 12:20:15 : (13) [G]: 10995        [E]: 30985        [D]: 274          [T]: 24
2015-01-07 12:20:19 : (14) [G]: 228601       [E]: 232249       [D]: 555          [T]: 22
2015-01-07 12:20:27 : ~~~~~~~Not dead base, skipping~~~~~~~
2015-01-07 12:20:32 : (15) [G]: 23511        [E]: 7199         [D]: 23           [T]: 23
2015-01-07 12:20:36 : (16) [G]: 168344       [E]: 28913        [D]: 753          [T]: 21
2015-01-07 12:20:43 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:20:43 : (17) [G]: 69258        [E]: 190129       [D]: 1399         [T]: 15
2015-01-07 12:20:48 : (18) [G]: 96950        [E]: 9307         [D]: 723          [T]: 26
2015-01-07 12:20:52 : (19) [G]: 90885        [E]: 3976         [D]: 12           [T]: 28
2015-01-07 12:20:57 : (20) [G]: 61069        [E]: 68132        [D]: 232          [T]: 19
2015-01-07 12:21:01 : (21) [G]: 24627        [E]: 22761        [D]: 239          [T]: 14
2015-01-07 12:21:06 : (22) [G]: 70338        [E]: 79717        [D]: 1108         [T]: 14
2015-01-07 12:21:12 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:21:15 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:21:15 : Cannot locate Next button, Restarting Bot
2015-01-07 12:21:15 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:21:15 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:21:30 : OutofSync: Reload Successful!!!
2015-01-07 12:21:30 : Checking for MainScreen in 7 secs...
2015-01-07 12:21:33 : In MainSCreen! Exiting Loop!
2015-01-07 12:21:33 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:21:37 : Training Troops...
2015-01-07 12:21:50 : Training Troops Complete
2015-01-07 12:21:55 : ===============Searching For Base===============
2015-01-07 12:21:58 : (1) [G]: 12402        [E]: 27589        [D]: 0            [T]: 16
2015-01-07 12:22:02 : (2) [G]: 25068        [E]: 99732        [D]: 641          [T]: 30
2015-01-07 12:22:07 : (3) [G]: 24669        [E]: 28051        [D]: 355          [T]: 21
2015-01-07 12:22:11 : (4) [G]: 96983        [E]: 11798        [D]:              [T]: 20
2015-01-07 12:22:16 : (5) [G]: 60076        [E]: 77339        [D]: 464          [T]: 17
2015-01-07 12:22:21 : (6) [G]: 14806        [E]: 40665        [D]: 332          [T]: 25
2015-01-07 12:22:25 : (7) [G]: 45980        [E]:              [D]: 658          [T]: 21
2015-01-07 12:22:30 : (8) [G]: 30735        [E]: 65728        [D]: 271          [T]: 26
2015-01-07 12:22:35 : (9) [G]: 20643        [E]: 46233        [D]: 23           [T]: 14
2015-01-07 12:22:39 : (10) [G]: 11230        [E]: 70422        [D]: 643          [T]: 30
2015-01-07 12:22:44 : (11) [G]: 111388       [E]: 92678        [D]: 1448         [T]: 16
2015-01-07 12:22:48 : (12) [G]: 130423       [E]: 80724        [D]: 325          [T]: 17
2015-01-07 12:22:53 : (13) [G]: 102671       [E]: 50033        [D]: 663          [T]: 29
2015-01-07 12:22:57 : (14) [G]: 13872        [E]: 13705        [D]: 884          [T]: 26
2015-01-07 12:23:02 : (15) [G]: 70309        [E]: 6199         [D]: 2            [T]: 30
2015-01-07 12:23:07 : (16) [G]: 70128        [E]: 48929        [D]: 135          [T]: 32
2015-01-07 12:23:11 : (17) [G]: 251276       [E]: 55879        [D]: 639          [T]: 19
2015-01-07 12:23:16 : (18) [G]: 43885        [E]: 81762        [D]: 434          [T]: 22
2015-01-07 12:23:20 : (19) [G]: 26673        [E]: 179733       [D]: 284          [T]: 31
2015-01-07 12:23:27 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:23:29 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:23:29 : Cannot locate Next button, Restarting Bot
2015-01-07 12:23:29 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:23:29 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:23:45 : OutofSync: Reload Successful!!!
2015-01-07 12:23:45 : Checking for MainScreen in 7 secs...
2015-01-07 12:23:47 : In MainSCreen! Exiting Loop!
2015-01-07 12:23:47 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:23:52 : Training Troops...
2015-01-07 12:24:05 : Training Troops Complete
2015-01-07 12:24:10 : ===============Searching For Base===============
2015-01-07 12:24:12 : (1) [G]: 20507        [E]: 65476        [D]: 245          [T]: 15
2015-01-07 12:24:17 : (2) [G]: 32116        [E]: 47           [D]: 167          [T]: 30
2015-01-07 12:24:21 : (3) [G]: 70447        [E]: 82866        [D]: 584          [T]: 16
2015-01-07 12:24:26 : (4) [G]: 35846        [E]: 4603         [D]: 17           [T]: 21
2015-01-07 12:24:31 : (5) [G]: 55002        [E]: 47782        [D]: 521          [T]: 24
2015-01-07 12:24:35 : (6) [G]: 82768        [E]: 57572        [D]: 590          [T]: 28
2015-01-07 12:24:40 : (7) [G]: 205854       [E]: 8414         [D]: 879          [T]: 28
2015-01-07 12:24:44 : (8) [G]: 120707       [E]: 49762        [D]: 587          [T]: 22
2015-01-07 12:24:51 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:24:53 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:24:53 : Cannot locate Next button, Restarting Bot
2015-01-07 12:24:53 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:24:53 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:25:08 : OutofSync: Reload Successful!!!
2015-01-07 12:25:08 : Checking for MainScreen in 7 secs...
2015-01-07 12:25:10 : In MainSCreen! Exiting Loop!
2015-01-07 12:25:11 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:25:15 : Training Troops...
2015-01-07 12:25:28 : Training Troops Complete
2015-01-07 12:25:33 : ===============Searching For Base===============
2015-01-07 12:25:35 : (1) [G]: 17125        [E]: 56236        [D]: 1            [T]: 16
2015-01-07 12:25:40 : (2) [G]: 50971        [E]: 73034        [D]: 50           [T]: 13
2015-01-07 12:25:45 : (3) [G]: 14765        [E]: 88763        [D]: 469          [T]: 19
2015-01-07 12:25:49 : (4) [G]: 69015        [E]: 53887        [D]: 125          [T]: 16
2015-01-07 12:25:54 : (5) [G]: 375690       [E]: 451862       [D]: 1620         [T]: 30
2015-01-07 12:25:57 : ~~~~~~~Dead Base Found!~~~~~~~
2015-01-07 12:25:57 : ===============Searching Complete===============
2015-01-07 12:25:58 : Preparing to search
2015-01-07 12:25:58 : Preparing to attack
2015-01-07 12:25:58 : -Barbarian 119
2015-01-07 12:25:59 : -Archer 96
2015-01-07 12:25:59 : -Giant 1
2015-01-07 12:26:00 : ======Beginning Attack======
2015-01-07 12:26:00 : ~Attacking in all sides...
2015-01-07 12:26:01 : Dropping first wave of Barbarians
2015-01-07 12:26:02 : Dropping first wave of Archers
2015-01-07 12:26:04 : Dropping second wave of Barbarians
2015-01-07 12:26:06 : Dropping second wave of Archers
2015-01-07 12:26:08 : Dropping left over troops
2015-01-07 12:26:09 : ~Finished Attacking, waiting to finish
2015-01-07 12:27:10 : Gold change detected, waiting...
2015-01-07 12:27:41 : Gold change detected, waiting...
2015-01-07 12:28:12 : Returning Home
2015-01-07 12:28:28 : Training Troops...
2015-01-07 12:28:42 : Training Troops Complete
2015-01-07 12:28:43 : ~~~Waiting for full army~~~
2015-01-07 12:29:15 : Collecting Resources
2015-01-07 12:29:19 : Collecting Complete
2015-01-07 12:29:20 : Training Troops...
2015-01-07 12:29:34 : Training Troops Complete
2015-01-07 12:30:07 : Collecting Resources
2015-01-07 12:30:07 : Collecting Complete
2015-01-07 12:30:08 : Training Troops...
2015-01-07 12:30:22 : Training Troops Complete
2015-01-07 12:30:54 : Collecting Resources
2015-01-07 12:30:55 : Collecting Complete
2015-01-07 12:30:56 : Training Troops...
2015-01-07 12:31:09 : Training Troops Complete
2015-01-07 12:31:42 : Collecting Resources
2015-01-07 12:31:43 : Collecting Complete
2015-01-07 12:31:44 : Training Troops...
2015-01-07 12:31:58 : Training Troops Complete
2015-01-07 12:32:30 : Collecting Resources
2015-01-07 12:32:31 : Collecting Complete
2015-01-07 12:32:32 : Training Troops...
2015-01-07 12:32:45 : Training Troops Complete
2015-01-07 12:33:18 : Collecting Resources
2015-01-07 12:33:18 : Collecting Complete
2015-01-07 12:33:19 : Training Troops...
2015-01-07 12:33:33 : Training Troops Complete
2015-01-07 12:34:06 : Collecting Resources
2015-01-07 12:34:07 : Collecting Complete
2015-01-07 12:34:08 : Training Troops...
2015-01-07 12:34:21 : Training Troops Complete
2015-01-07 12:34:54 : Collecting Resources
2015-01-07 12:34:54 : Collecting Complete
2015-01-07 12:34:55 : Training Troops...
2015-01-07 12:35:09 : Training Troops Complete
2015-01-07 12:35:42 : Collecting Resources
2015-01-07 12:35:42 : Collecting Complete
2015-01-07 12:35:43 : Training Troops...
2015-01-07 12:35:57 : Training Troops Complete
2015-01-07 12:36:29 : Collecting Resources
2015-01-07 12:36:30 : Collecting Complete
2015-01-07 12:36:31 : Training Troops...
2015-01-07 12:36:45 : Training Troops Complete
2015-01-07 12:37:17 : Collecting Resources
2015-01-07 12:37:18 : Collecting Complete
2015-01-07 12:37:19 : Training Troops...
2015-01-07 12:37:32 : Training Troops Complete
2015-01-07 12:38:05 : Collecting Resources
2015-01-07 12:38:07 : Collecting Complete
2015-01-07 12:38:08 : Training Troops...
2015-01-07 12:38:23 : Training Troops Complete
2015-01-07 12:38:57 : Collecting Resources
2015-01-07 12:39:00 : Collecting Complete
2015-01-07 12:39:01 : Training Troops...
2015-01-07 12:39:14 : Training Troops Complete
2015-01-07 12:39:47 : Collecting Resources
2015-01-07 12:39:48 : Collecting Complete
2015-01-07 12:39:49 : Training Troops...
2015-01-07 12:40:02 : Training Troops Complete
2015-01-07 12:40:35 : Collecting Resources
2015-01-07 12:40:36 : Collecting Complete
2015-01-07 12:40:37 : Training Troops...
2015-01-07 12:40:50 : Training Troops Complete
2015-01-07 12:41:23 : Collecting Resources
2015-01-07 12:41:24 : Collecting Complete
2015-01-07 12:41:25 : Training Troops...
2015-01-07 12:41:33 : Barrack 3 is not available
2015-01-07 12:41:38 : Training Troops Complete
2015-01-07 12:42:12 : Collecting Resources
2015-01-07 12:42:12 : Collecting Complete
2015-01-07 12:42:13 : Training Troops...
2015-01-07 12:42:27 : Training Troops Complete
2015-01-07 12:42:31 : ===============Searching For Base===============
2015-01-07 12:42:34 : (1) [G]: 63633        [E]: 37306        [D]: 1392         [T]: 34
2015-01-07 12:42:40 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:42:48 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:42:56 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:04 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:12 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:20 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:28 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:36 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:44 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:43:52 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:00 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:07 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:15 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:23 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:31 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:39 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:47 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:44:55 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:03 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:11 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:19 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:27 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:35 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:43 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:51 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:45:59 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:06 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:14 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:22 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:30 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:38 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:46 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:46:54 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:02 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:10 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:18 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:26 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:34 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:47:36 : GETRESOURCES: Cannot Read within 30 loops...
2015-01-07 12:47:36 : Cannot locate Next button, Restarting Bot
2015-01-07 12:47:36 : CheckMainScreen: PRoblem Loading...
2015-01-07 12:47:36 : Not in MainScreen. Trying to get to main screen
2015-01-07 12:47:53 : OutofSync: Reload Successful!!!
2015-01-07 12:47:53 : Checking for MainScreen in 7 secs...
2015-01-07 12:47:55 : In MainSCreen! Exiting Loop!
2015-01-07 12:47:55 : GETRESOURCES: Going to MainScreen Successful!!!
2015-01-07 12:48:00 : Training Troops...
2015-01-07 12:48:12 : Training Troops Complete
2015-01-07 12:48:18 : ===============Searching For Base===============
2015-01-07 12:48:24 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:48:32 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:48:40 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:48:48 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:48:56 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:04 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:12 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:20 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:27 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:35 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:43 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:51 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:49:59 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:07 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:15 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:23 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:31 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:38 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:46 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:50:54 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:51:02 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:51:10 : GETRESOURCES: Cannot Read for the5th time...
2015-01-07 12:51:18 : GETRESOURCES: Cannot Read for the5th time...

It restarts after detecting inactivity but did not hang. Could anyone try adding the log to check if we have the same errors getting stuck on that loop.

Jan 7, 2015#53

This is my first time as kaz mentioned earlier on... the hang was in mainscreen.... the hang was at 8.52am.... keep restarting every 5 min till 2pm... bot didnt hang but struck in loop somewhere.... this is using new coding by antidote...

The coding (below) did allow me to make the bot last longer... started the bot at 3.48am, hang at 8.52am.

@AtoZ
I didnt use Dead Base search. But i do think there is a faulty loop somewhere, probably While and didnt have a good exit loop that could cause memory leak, causing the hang... realise that even coc started up but bot still didnt detect it. but it manage to restart the bluestack and coc successfully but remain in unzoomed state. at this point, the bot gui is already blank but still able to close process and restart them.

2015-01-07 08:51:39 : Collecting Resources
2015-01-07 08:51:40 : Collecting Complete
2015-01-07 08:51:41 : Training Troops...
2015-01-07 08:51:58 : Training Troops Complete
2015-01-07 08:52:11 : Collecting Resources
2015-01-07 08:52:11 : Collecting Complete
2015-01-07 08:52:12 : Training Troops...
2015-01-07 08:52:15 : Barrack 1 is not available
2015-01-07 08:52:20 : Barrack 2 is not available
2015-01-07 08:52:24 : Barrack 3 is not available
2015-01-07 08:52:29 : Barrack 4 is not available
2015-01-07 08:52:30 : Training Troops Complete
2015-01-07 08:52:43 : Collecting Resources
2015-01-07 08:52:43 : Collecting Complete
2015-01-07 08:52:45 : Training Troops...
2015-01-07 08:52:48 : Barrack 1 is not available
2015-01-07 08:52:52 : Barrack 2 is not available
2015-01-07 08:52:57 : Barrack 3 is not available
2015-01-07 08:53:01 : Barrack 4 is not available
2015-01-07 08:53:03 : Training Troops Complete
2015-01-07 08:53:04 : Trying to get to main screen
2015-01-07 08:58:11 : Could not automatically load Clash Of Clans
2015-01-07 08:58:12 : Restarting BlueStacks
2015-01-07 08:58:32 : Trying to get to main screen
2015-01-07 09:03:38 : Could not automatically load Clash Of Clans
2015-01-07 09:03:39 : Restarting BlueStacks
2015-01-07 09:03:49 : Trying to get to main screen
2015-01-07 09:08:56 : Could not automatically load Clash Of Clans
2015-01-07 09:08:57 : Restarting BlueStacks
2015-01-07 09:09:07 : Trying to get to main screen
2015-01-07 09:14:13 : Could not automatically load Clash Of Clans
2015-01-07 09:14:14 : Restarting BlueStacks
2015-01-07 09:14:24 : Trying to get to main screen
2015-01-07 09:19:31 : Could not automatically load Clash Of Clans
2015-01-07 09:19:32 : Restarting BlueStacks
2015-01-07 09:19:42 : Trying to get to main screen
2015-01-07 09:24:48 : Could not automatically load Clash Of Clans
2015-01-07 09:24:49 : Restarting BlueStacks
2015-01-07 09:25:00 : Trying to get to main screen
2015-01-07 09:30:06 : Could not automatically load Clash Of Clans
2015-01-07 09:30:07 : Restarting BlueStacks
2015-01-07 09:30:17 : Trying to get to main screen
2015-01-07 09:35:28 : Could not automatically load Clash Of Clans
2015-01-07 09:35:29 : Restarting BlueStacks
2015-01-07 09:35:39 : Trying to get to main screen
2015-01-07 09:40:46 : Could not automatically load Clash Of Clans
2015-01-07 09:40:47 : Restarting BlueStacks
2015-01-07 09:40:57 : Trying to get to main screen
2015-01-07 09:46:03 : Could not automatically load Clash Of Clans
2015-01-07 09:46:04 : Restarting BlueStacks
2015-01-07 09:46:14 : Trying to get to main screen
2015-01-07 09:51:21 : Could not automatically load Clash Of Clans
2015-01-07 09:51:22 : Restarting BlueStacks
2015-01-07 09:51:32 : Trying to get to main screen
2015-01-07 09:56:38 : Could not automatically load Clash Of Clans
2015-01-07 09:56:39 : Restarting BlueStacks
2015-01-07 09:56:49 : Trying to get to main screen
2015-01-07 10:01:56 : Could not automatically load Clash Of Clans
2015-01-07 10:01:57 : Restarting BlueStacks
2015-01-07 10:02:08 : Trying to get to main screen
2015-01-07 10:07:14 : Could not automatically load Clash Of Clans
2015-01-07 10:07:15 : Restarting BlueStacks
2015-01-07 10:07:25 : Trying to get to main screen
2015-01-07 10:12:32 : Could not automatically load Clash Of Clans
2015-01-07 10:12:33 : Restarting BlueStacks
2015-01-07 10:12:43 : Trying to get to main screen
2015-01-07 10:17:49 : Could not automatically load Clash Of Clans
2015-01-07 10:17:50 : Restarting BlueStacks
2015-01-07 10:18:00 : Trying to get to main screen
2015-01-07 10:23:07 : Could not automatically load Clash Of Clans
2015-01-07 10:23:08 : Restarting BlueStacks
2015-01-07 10:23:18 : Trying to get to main screen
2015-01-07 10:28:25 : Could not automatically load Clash Of Clans
2015-01-07 10:28:26 : Restarting BlueStacks
2015-01-07 10:28:36 : Trying to get to main screen
2015-01-07 10:33:42 : Could not automatically load Clash Of Clans
2015-01-07 10:33:43 : Restarting BlueStacks
2015-01-07 10:34:03 : Trying to get to main screen
2015-01-07 10:39:10 : Could not automatically load Clash Of Clans
2015-01-07 10:39:11 : Restarting BlueStacks
2015-01-07 10:39:21 : Trying to get to main screen
2015-01-07 10:44:27 : Could not automatically load Clash Of Clans
2015-01-07 10:44:28 : Restarting BlueStacks
2015-01-07 10:44:38 : Trying to get to main screen
2015-01-07 10:49:45 : Could not automatically load Clash Of Clans
2015-01-07 10:49:46 : Restarting BlueStacks
2015-01-07 10:49:56 : Trying to get to main screen
2015-01-07 10:55:02 : Could not automatically load Clash Of Clans
2015-01-07 10:55:03 : Restarting BlueStacks
2015-01-07 10:55:13 : Trying to get to main screen
2015-01-07 11:00:20 : Could not automatically load Clash Of Clans
2015-01-07 11:00:21 : Restarting BlueStacks
2015-01-07 11:00:31 : Trying to get to main screen
2015-01-07 11:05:37 : Could not automatically load Clash Of Clans
2015-01-07 11:05:38 : Restarting BlueStacks
2015-01-07 11:05:48 : Trying to get to main screen
2015-01-07 11:10:55 : Could not automatically load Clash Of Clans
2015-01-07 11:10:56 : Restarting BlueStacks
2015-01-07 11:11:06 : Trying to get to main screen
2015-01-07 11:16:12 : Could not automatically load Clash Of Clans
2015-01-07 11:16:13 : Restarting BlueStacks
2015-01-07 11:16:23 : Trying to get to main screen
2015-01-07 11:21:30 : Could not automatically load Clash Of Clans
2015-01-07 11:21:31 : Restarting BlueStacks
2015-01-07 11:21:41 : Trying to get to main screen
2015-01-07 11:26:48 : Could not automatically load Clash Of Clans
2015-01-07 11:26:49 : Restarting BlueStacks
2015-01-07 11:27:09 : Trying to get to main screen
2015-01-07 11:32:15 : Could not automatically load Clash Of Clans
2015-01-07 11:32:16 : Restarting BlueStacks
2015-01-07 11:32:26 : Trying to get to main screen
2015-01-07 11:37:33 : Could not automatically load Clash Of Clans
2015-01-07 11:37:34 : Restarting BlueStacks
2015-01-07 11:37:44 : Trying to get to main screen
2015-01-07 11:42:50 : Could not automatically load Clash Of Clans
2015-01-07 11:42:51 : Restarting BlueStacks
2015-01-07 11:43:02 : Trying to get to main screen
2015-01-07 11:48:08 : Could not automatically load Clash Of Clans
2015-01-07 11:48:09 : Restarting BlueStacks
2015-01-07 11:48:19 : Trying to get to main screen
2015-01-07 11:53:26 : Could not automatically load Clash Of Clans
2015-01-07 11:53:27 : Restarting BlueStacks
2015-01-07 11:53:37 : Trying to get to main screen
2015-01-07 11:58:43 : Could not automatically load Clash Of Clans
2015-01-07 11:58:44 : Restarting BlueStacks
2015-01-07 11:58:54 : Trying to get to main screen
2015-01-07 12:04:01 : Could not automatically load Clash Of Clans
2015-01-07 12:04:02 : Restarting BlueStacks
2015-01-07 12:04:12 : Trying to get to main screen
2015-01-07 12:09:18 : Could not automatically load Clash Of Clans
2015-01-07 12:09:19 : Restarting BlueStacks
2015-01-07 12:09:30 : Trying to get to main screen
2015-01-07 12:14:36 : Could not automatically load Clash Of Clans
2015-01-07 12:14:37 : Restarting BlueStacks
2015-01-07 12:14:47 : Trying to get to main screen
2015-01-07 12:19:53 : Could not automatically load Clash Of Clans
2015-01-07 12:19:54 : Restarting BlueStacks
2015-01-07 12:20:04 : Trying to get to main screen
2015-01-07 12:25:11 : Could not automatically load Clash Of Clans
2015-01-07 12:25:12 : Restarting BlueStacks
2015-01-07 12:25:22 : Trying to get to main screen
2015-01-07 12:30:29 : Could not automatically load Clash Of Clans
2015-01-07 12:30:30 : Restarting BlueStacks
2015-01-07 12:30:40 : Trying to get to main screen
2015-01-07 12:35:46 : Could not automatically load Clash Of Clans
2015-01-07 12:35:47 : Restarting BlueStacks
2015-01-07 12:35:57 : Trying to get to main screen
2015-01-07 12:41:04 : Could not automatically load Clash Of Clans
2015-01-07 12:41:05 : Restarting BlueStacks
2015-01-07 12:41:15 : Trying to get to main screen
2015-01-07 12:46:21 : Could not automatically load Clash Of Clans
2015-01-07 12:46:22 : Restarting BlueStacks
2015-01-07 12:46:32 : Trying to get to main screen
2015-01-07 12:51:39 : Could not automatically load Clash Of Clans
2015-01-07 12:51:40 : Restarting BlueStacks
2015-01-07 12:51:50 : Trying to get to main screen
2015-01-07 12:56:57 : Could not automatically load Clash Of Clans
2015-01-07 12:56:58 : Restarting BlueStacks
2015-01-07 12:57:08 : Trying to get to main screen
2015-01-07 13:02:14 : Could not automatically load Clash Of Clans
2015-01-07 13:02:15 : Restarting BlueStacks
2015-01-07 13:02:25 : Trying to get to main screen
2015-01-07 13:07:32 : Could not automatically load Clash Of Clans
2015-01-07 13:07:33 : Restarting BlueStacks
2015-01-07 13:07:43 : Trying to get to main screen
2015-01-07 13:12:49 : Could not automatically load Clash Of Clans
2015-01-07 13:12:50 : Restarting BlueStacks
2015-01-07 13:13:00 : Trying to get to main screen
2015-01-07 13:18:07 : Could not automatically load Clash Of Clans
2015-01-07 13:18:08 : Restarting BlueStacks
2015-01-07 13:18:18 : Trying to get to main screen
2015-01-07 13:23:25 : Could not automatically load Clash Of Clans
2015-01-07 13:23:27 : Restarting BlueStacks
2015-01-07 13:23:47 : Trying to get to main screen
2015-01-07 13:28:53 : Could not automatically load Clash Of Clans
2015-01-07 13:28:54 : Restarting BlueStacks
2015-01-07 13:29:04 : Trying to get to main screen
2015-01-07 13:34:11 : Could not automatically load Clash Of Clans
2015-01-07 13:34:12 : Restarting BlueStacks
2015-01-07 13:34:22 : Trying to get to main screen
2015-01-07 13:39:28 : Could not automatically load Clash Of Clans
2015-01-07 13:39:29 : Restarting BlueStacks
2015-01-07 13:39:40 : Trying to get to main screen
2015-01-07 13:44:46 : Could not automatically load Clash Of Clans
2015-01-07 13:44:47 : Restarting BlueStacks
2015-01-07 13:45:07 : Trying to get to main screen
2015-01-07 13:50:14 : Could not automatically load Clash Of Clans
2015-01-07 13:50:15 : Restarting BlueStacks
2015-01-07 13:50:25 : Trying to get to main screen
2015-01-07 13:55:31 : Could not automatically load Clash Of Clans
2015-01-07 13:55:32 : Restarting BlueStacks
2015-01-07 13:55:42 : Trying to get to main screen
2015-01-07 14:00:49 : Could not automatically load Clash Of Clans
2015-01-07 14:00:50 : Restarting BlueStacks
2015-01-07 14:01:00 : Trying to get to main screen
2015-01-07 14:06:07 : Could not automatically load Clash Of Clans
2015-01-07 14:06:08 : Restarting BlueStacks
Func GetResources() ;Reads resources
 While 1
 Local $i = 0
 While getGold($BSpos[0] + 51, $BSpos[1] + 66) = "" ; Loops until gold is readable
 getBSPos()
 _Sleep(800)
 If Not $RunState Then ExitLoop (2)
 $i += 1
 If $i >= 30 Then
   If checkNextButton() Then
  _Sleep(1800)
  SetLog("GETRESOURCES: Cannot Read within 30 loops...")
  Click(750, 500)
  $i = 0
   EndIf
   If $i >= 120 Then
  SetLog("Cannot locate Next button, Restarting Bot")
  checkMainScreen()
  $Restart = True
  SetLog("GETRESOURCES: Going to MainScreen Successful!!!")
  ExitLoop (2)
   EndIf
 EndIf
 WEnd
 If _Sleep(300) Or $RunState = False Then ExitLoop (2)

 $searchGold = getGold($BSpos[0] + 51, $BSpos[1] + 66)
 $searchElixir = getElixir($BSpos[0] + 51, $BSpos[1] + 66 + 29)
 $searchTrophy = getTrophy($BSpos[0] + 51, $BSpos[1] + 66 + 90)

 If $searchTrophy <> "" Then
 $searchDark = getDarkElixir($BSpos[0] + 51, $BSpos[01] + 66 + 57)
 Else
 $searchDark = 0
 $searchTrophy = getTrophy($BSpos[0] + 51, $BSpos[1] + 66 + 60)
 EndIf

 SetLog("(" & $SearchCount + 1 & ") [G]: " & $searchGold & Tab($searchGold, 12) & "[E]: " & $searchElixir & Tab($searchElixir, 12) & "[D]: " & $searchDark & Tab($searchDark, 12) & "[T]: " & $searchTrophy)
 $SearchCount += 1 ; Counter for number of searches
 ExitLoop
 WEnd
EndFunc   ;==>GetResources
Jan 7, 2015#54

@dinobot
If your error above came out right after restarting bluestacks by the bot,
try running Autoit window info and see if you still see the >>>control<<< details. I noticed that it goes blank when restarting bluestacks in autoit and thus pixel functions probably won't work. After closing bluestacks by the bot, try minimize windows and then mousclick COC app bluestack shortcut. I used imagesearch for the icon but you could just try it first and see if it'll work.

It may be an issue of bluestacks version as well so I'm not sure.

Jan 7, 2015#55

seeing my last log, why suddenly bot cant find barrack? It could also happen while beginning search or while searching. So see that the error looks random.

Dont think is the restarting process of bluestack that makes it unable to detect window. but will check control if i happened to see it again... too random.. dont know when it will happen...

I was thinking if we could make the bot reopen a duplicate bot after every attack, start it, end itself (1st bot), 2nd bot start working, after first attack, loop back to first bot.............

if we can do this and if the bot can last for more than 8hr... then we could confirm is memory issue?

Jan 7, 2015#56

@dinobot
Like these?

Restarter Bot

#RequireAdmin
#include <MsgBoxConstants.au3>

Global $Title="COC Bot Pre-Alpha v5.4"
Global $BotFile=@ScriptDir&"\COC Bot v5.4.exe"

WinKill($Title)
Sleep(2000)
ShellExecute($BotFile)
WinWaitActive($Title,"",10)
WinActivate($Title)
Sleep(3500)
ControlFocus($Title,"Start", "[CLASS:Button; INSTANCE:2]")
ControlClick($Title,"Start", "[CLASS:Button; INSTANCE:2]")
Sleep(500)
WinMove("COC Bot Pre-Alpha v5.3","",900,100)
Sleep(500)
ControlFocus($Title,"Ok", "[CLASS:Button; INSTANCE:1]")
ControlClick($Title,"Ok", "[CLASS:Button; INSTANCE:1]")

Function in apha bot

Func RestartBot()
   Local $BotTitle=""
   Local $BotFile= @ScriptDir&"\COC BOT v5 Restarter.au3" ;put filename here
      SetLog("RestartBOT: BOT RESTARTING NOW..")
  ShellExecute($BotFile)
  Sleep(1000)
  ControlFocus($BotTitle,"Ok", "[CLASS:Button; INSTANCE:1]")
  ControlClick($BotTitle,"Ok", "[CLASS:Button; INSTANCE:1]")
EndFunc
Jan 7, 2015#57

Oh yes.. going to test it out...

Jan 7, 2015#58

beautifully execute... going to leave it on for hours now... let wait and see....

Jan 7, 2015#59

isit working ?

Jan 7, 2015#60

isit working ?

Add the code, edit whatever and try it! works thus far; 1hour in.

Got something to add?

Log in to post a reply.

Join the conversation