Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BUG: 5.3.1: Bot hang/ blank windows
#21
Reply
#22
Reply
#23
Oh now I see it. In checkmainscreen once it doesn't find main village it will click home button in BS and start the game again. However the game doesn't load from start but continue at where it was left at, thus stuck at checkmainscreen. After 5 minutes it will quit BS and start again but by then it would have already gone blank. So I think to be on the safe side we could modify it to quit BS and restart immediately once it can't detect mainscreen. A fresh start will be easier to manage, what do you guys think?
Reply
#24
But to be sure does it only happen after the bot click home button in BS and start game again? Anyone can confirm? If that is the case then a fix would be easy I think
Reply
#25
yes , pretty much.
Reply
#26
Hey guys,
I've been debugging this issue for a couple of days now and following every single fix that has been posted and suggested along with many of my own fixes (that failed) and I still have the issue but this is the behavior I have seen (using 5.3.4 with SetB experimental):

Scenario 1 (Success on getting back on its feet):
1. Fails to find Next Button
2. Closes Clash
3. Reloads Clash
4. Bot is looking for the pixels on the village screen to start new loop (like was already attacked, etc.) but it still in the battle screen and the counter is still counting down. I had a debug log running and I see the 5 minute counter to restart bluestacks has already begun. (The bot should click on the next button or if the battle already begins, wait and click on the "Return Home" button and start over. But I later found out it is only to optimize the bot)
5. 5 minute counter kicks in, bluestacks is restarted. Clash is loaded. Bot now finds those pixels and continues.

Logs (with my debug logs):
Quote:2015-01-02 02:01:22 : (72) [G]: 103781 [E]: 91632 [D]: 198 [T]: 18
2015-01-02 02:01:24 : ~~~~~~~Not dead base, skipping~~~~~~~
2015-01-02 02:01:49 : Cannot locate Next button, Restarting Bot
2015-01-02 02:01:49 : Trying to get to main screen
2015-01-02 02:01:49 : DEBUG: Check for out of sync or inactivity
2015-01-02 02:01:56 : DEBUG: Has found BlueStacks App Player (counter = 0)
2015-01-02 02:01:56 : DEBUG: Has found BlueStacks App Player and all the checks failed) (counter = 0)
2015-01-02 02:01:58 : DEBUG: Has found BlueStacks App Player (counter = 1
2015-01-02 02:01:58 : DEBUG: Has found BlueStacks App Player and all the checks failed) (counter = 1)
2015-01-02 02:02:00 : DEBUG: Has found BlueStacks App Player (counter = 2)
2015-01-02 02:02:00 : DEBUG: In main screen (counter = 2)
2015-01-02 02:02:08 : Training Troops...

Scenario 2 (White screen bug):
1. Fails to find Next Button (!!!! At this point the bot is already on white screen but continues to log and executes some things!!!!!) - Need confirmation but I have seen this several times while watching it run.
2. Closes Clash
3. Reloads Clash
4. Bot is looking for the pixels on the village screen to start new loop (like was already attacked, etc.) but it still in the battle screen and the counter is still counting down.
5. 5 minute counter kicks in, bluestacks is restarted. Clash is loaded. Bot fails to find the pixels because the bot is hung but not entirely because it is still logging...!
6. Repeats step 5 endlessly.

Logs:
Quote:2015-01-05 03:01:28 : Training Troops...
2015-01-05 03:01:45 : Training Troops Complete
2015-01-05 03:01:45 : Full Army
2015-01-05 03:01:52 : ===============Searching For Base===============
2015-01-05 03:01:54 : (1) [G]: 28916 [E]: 41300 [D]: 282 [T]: 28
2015-01-05 03:01:58 : (2) [G]: 16897 [E]: 23422 [D]: 88 [T]: 21
2015-01-05 03:02:03 : (3) [G]: 77847 [E]: 14794 [D]: [T]: 21
2015-01-05 03:02:21 : Cannot locate Next button, Restarting Bot
2015-01-05 03:02:36 : Trying to get to main screen
2015-01-05 03:07:42 : Could not automatically load Clash Of Clans
2015-01-05 03:07:43 : Restarting BlueStacks
2015-01-05 03:08:08 : Trying to get to main screen
2015-01-05 03:13:14 : Could not automatically load Clash Of Clans
2015-01-05 03:13:15 : Restarting BlueStacks
2015-01-05 03:13:40 : Trying to get to main screen
2015-01-05 03:18:46 : Could not automatically load Clash Of Clans
2015-01-05 03:18:47 : Restarting BlueStacks
Reply
#27
I like the idea of go home and then just start coc as the recovery time is shorter and less prone to attack.

Question here is why the bot fail to Find Next button when it is there? Seems like everyone is having this problem so I assume it is not because of performance of pc speed. I think there is some coding. Need more checking mechanism to say if can't find next button, search for End battle instead.
Reply
#28
So for now we are sure that the event is triggered during the 5 minutes count down. I've tried to optimized the processs, including
- close BS process and restart (failsafe but takes 3 minutes on average to get to main screen)
- click home button on BS, wait 30 seconds, reload games. It still loads on previous screen, you need to close Clash of Clans process by clicking task manager, drag close CoC, but MouseDrag would defeat the purpose of backgrounding.
Does anyone knows how to close an app in BS with command prompt or any shortcut in BS without using gesture? You can go to all apps and click force close but that's not efficient and prone to error
Reply
#29
About it failing to detect Next button, I think it's because GkevinOD set maximum waiting time to 10 seconds (including loading time and reading resource) so in some instances on slow machines or slow connection next village hasn't loaded --> 10 seconds passed --> bot restart.
Actually you can increase waiting time to 15 or 20 seconds (as long as < 30 seconds count down before battle start) but it's not failproof
Reply
#30
(01-06-2015, 12:02 AM)Antidote Wrote:  So for now we are sure that the event is triggered during the 5 minutes count down. I've tried to optimized the processs, including
- close BS process and restart (failsafe but takes 3 minutes on average to get to main screen)
- click home button on BS, wait 30 seconds, reload games. It still loads on previous screen, you need to close Clash of Clans process by clicking task manager, drag close CoC, but MouseDrag would defeat the purpose of backgrounding.
Does anyone knows how to close an app in BS with command prompt or any shortcut in BS without using gesture? You can go to all apps and click force close but that's not efficient and prone to error

Just to be sure we're on the same page. I don't think the hang happens during the 5 minute countdown. It happens between finding the next target and looking for the next button. In scenario 2 that I mentioned above, once it fails to find the next button, it has already hung / white screen.

In terms of my fixes, I tried to optimize the 5 minute countdown in many different ways and I noticed it would still hang but maybe I didn't find the right combination. But if it does hang before the countdown right before finding the next button, then the issue lies elsewhere.

edit: Added this and gonna let it run for awhile and to confirm if it does hang right before looking for the next button.
Quote: _ScreenCapture_CaptureWnd(@ScriptDir & "\NextButton\" & $Date & " at " & $Time & ".jpg", $HBotWnD) ; DEBUG
SetLog("Cannot locate Next button, Restarting Bot")
Reply
 


Forum Jump:


Users browsing this thread: 2 Guest(s)

About The Bytecode Club

We're a community forum 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