I initially thought it has something to do with GUIRegisterMsg and GDI (as someone mentioned here: http://www.autoitscript.com/forum/topic/151396-gdi-hang-guiregistermsg/) but now to think of it it's very possibly be due to screen not completely zoomed out (which messed up all coords), thus failed checks and repeated restarting of BS. This is because sometimes you only need 10 DOWN to completely zoom out. Sometimes you need even more than 30. Just my speculation I'm thinking of a way to test
Video Game Reverse Engineering
BUG: 5.3.1: Bot hang/ blank windows
Started by dinobot · Jan 4, 2015
on previous version 5.3 the bot GUI hang when im using dead base mode, but completely fine if im using All base mode.
Using on my PC windows8 x64 8gb ram.
Tested 2 type of attack: All base and Dead base.
When using Dead base, the bot only last like 1-3hr and it turn to white screen. I set the loot limit low to 70k for the bot to use imagesearch. COC was opened but without zoomout but the bot just unable to detect it as it white out. Think nothing to do with zooming out.
When using All base, the bot will pass 6th hr limit and more without problem but eventually will come to a point of white windows.
Same as most. Below are log for dead base
2015-01-05 10:27:14 : (135) [G]: 50894 [E]: 55688 [D]: 131 [T]: 19
2015-01-05 10:27:33 : Cannot locate Next button, Restarting Bot
2015-01-05 10:27:33 : Trying to get to main screen
2015-01-05 10:32:39 : Could not automatically load Clash Of Clans
2015-01-05 10:32:40 : Restarting BlueStacks
2015-01-05 10:32:50 : Trying to get to main screen
2015-01-05 10:37:55 : Could not automatically load Clash Of Clans
2015-01-05 10:37:56 : Restarting BlueStacks
2015-01-05 10:38:06 : Trying to get to main screen
2015-01-05 10:43:12 : Could not automatically load Clash Of Clans
2015-01-05 10:43:13 : Restarting BlueStacks
2015-01-05 10:43:23 : Trying to get to main screen
2015-01-05 10:48:28 : Could not automatically load Clash Of Clans
2015-01-05 10:48:29 : Restarting BlueStacks
2015-01-05 10:48:39 : Trying to get to main screen
2015-01-05 10:53:45 : Could not automatically load Clash Of Clans
2015-01-05 10:53:46 : Restarting BlueStacks
2015-01-05 10:53:56 : Trying to get to main screen
2015-01-05 10:59:01 : Could not automatically load Clash Of Clans
2015-01-05 10:59:02 : Restarting BlueStacks
2015-01-05 10:59:12 : Trying to get to main screen
2015-01-05 11:04:18 : Could not automatically load Clash Of Clans
2015-01-05 11:04:19 : Restarting BlueStacks
2015-01-05 11:04:39 : Trying to get to main screen
2015-01-05 11:09:44 : Could not automatically load Clash Of Clans
2015-01-05 11:09:45 : Restarting BlueStacks
2015-01-05 11:09:55 : Trying to get to main screen
2015-01-05 11:15:00 : Could not automatically load Clash Of Clans
2015-01-05 11:15:01 : Restarting BlueStacks
2015-01-05 11:15:21 : Trying to get to main screen
2015-01-05 11:20:27 : Could not automatically load Clash Of Clans
2015-01-05 11:20:28 : Restarting BlueStacks
2015-01-05 11:20:38 : Trying to get to main screen
2015-01-05 11:25:43 : Could not automatically load Clash Of Clans
2015-01-05 11:25:44 : Restarting BlueStacks
2015-01-05 11:25:54 : Trying to get to main screen
2015-01-05 11:31:00 : Could not automatically load Clash Of Clans
2015-01-05 11:31:01 : Restarting BlueStacks
2015-01-05 11:31:11 : Trying to get to main screen
2015-01-05 11:36:16 : Could not automatically load Clash Of Clans
2015-01-05 11:36:17 : Restarting BlueStacks
2015-01-05 11:36:27 : Trying to get to main screen
2015-01-05 11:41:33 : Could not automatically load Clash Of Clans
2015-01-05 11:41:34 : Restarting BlueStacks
2015-01-05 11:41:44 : Trying to get to main screen
2015-01-05 11:46:49 : Could not automatically load Clash Of Clans
2015-01-05 11:46:50 : Restarting BlueStacks
2015-01-05 11:47:00 : Trying to get to main screen
2015-01-05 11:52:06 : Could not automatically load Clash Of Clans
2015-01-05 11:52:07 : Restarting BlueStacks
2015-01-05 11:52:27 : Trying to get to main screen
2015-01-05 11:57:32 : Could not automatically load Clash Of Clans
2015-01-05 11:57:33 : Restarting BlueStacks
2015-01-05 11:57:53 : Trying to get to main screen
2015-01-05 12:02:59 : Could not automatically load Clash Of Clans
2015-01-05 12:03:00 : Restarting BlueStacks
2015-01-05 12:03:10 : Trying to get to main screen
2015-01-05 12:08:15 : Could not automatically load Clash Of Clans
2015-01-05 12:08:16 : Restarting BlueStacks
2015-01-05 12:08:26 : Trying to get to main screen
2015-01-05 12:13:32 : Could not automatically load Clash Of Clans
2015-01-05 12:13:33 : Restarting BlueStacks
2015-01-05 12:13:43 : Trying to get to main screen
2015-01-05 12:18:48 : Could not automatically load Clash Of Clans
2015-01-05 12:18:49 : Restarting BlueStacks
2015-01-05 12:18:59 : Trying to get to main screen
2015-01-05 12:24:04 : Could not automatically load Clash Of Clans
2015-01-05 12:24:05 : Restarting BlueStacks
2015-01-05 12:24:25 : Trying to get to main screen
2015-01-05 12:29:31 : Could not automatically load Clash Of Clans
2015-01-05 12:29:32 : Restarting BlueStacks
2015-01-05 12:29:42 : Trying to get to main screen
2015-01-05 12:34:47 : Could not automatically load Clash Of Clans
2015-01-05 12:34:48 : Restarting BlueStacks
2015-01-05 12:35:08 : Trying to get to main screen
2015-01-05 12:40:14 : Could not automatically load Clash Of Clans
2015-01-05 12:40:15 : Restarting BlueStacks
2015-01-05 12:40:25 : Trying to get to main screen
2015-01-05 12:45:30 : Could not automatically load Clash Of Clans
2015-01-05 12:45:31 : Restarting BlueStacks
2015-01-05 12:45:51 : Trying to get to main screen
2015-01-05 12:50:57 : Could not automatically load Clash Of Clans
2015-01-05 12:50:58 : Restarting BlueStacks
2015-01-05 12:51:08 : Trying to get to main screen
2015-01-05 12:56:13 : Could not automatically load Clash Of Clans
2015-01-05 12:56:14 : Restarting BlueStacks
2015-01-05 12:56:24 : Trying to get to main screen
2015-01-05 13:01:30 : Could not automatically load Clash Of Clans
2015-01-05 13:01:31 : Restarting BlueStacks
2015-01-05 13:01:51 : Trying to get to main screen
2015-01-05 13:06:56 : Could not automatically load Clash Of Clans
2015-01-05 13:06:57 : Restarting BlueStacks
2015-01-05 13:07:17 : Trying to get to main screen
2015-01-05 13:12:22 : Could not automatically load Clash Of Clans
2015-01-05 13:12:23 : Restarting BlueStacks
2015-01-05 13:12:33 : Trying to get to main screen
2015-01-05 13:17:39 : Could not automatically load Clash Of Clans
2015-01-05 13:17:40 : Restarting BlueStacks
2015-01-05 13:17:50 : Trying to get to main screen
2015-01-05 13:22:55 : Could not automatically load Clash Of Clans
2015-01-05 13:22:56 : Restarting BlueStacks
2015-01-05 13:23:06 : Trying to get to main screen
2015-01-05 13:28:12 : Could not automatically load Clash Of Clans
2015-01-05 13:28:13 : Restarting BlueStacks
2015-01-05 13:28:33 : Trying to get to main screen
2015-01-05 13:33:38 : Could not automatically load Clash Of Clans
2015-01-05 13:33:39 : Restarting BlueStacks
2015-01-05 13:33:49 : Trying to get to main screen
2015-01-05 13:38:55 : Could not automatically load Clash Of Clans
2015-01-05 13:38:56 : Restarting BlueStacks
2015-01-05 13:39:16 : Trying to get to main screen
2015-01-05 13:44:21 : Could not automatically load Clash Of Clans
2015-01-05 13:44:22 : Restarting BlueStacks
2015-01-05 13:44:32 : Trying to get to main screen
2015-01-05 13:49:38 : Could not automatically load Clash Of Clans
2015-01-05 13:49:39 : Restarting BlueStacks
2015-01-05 13:49:49 : Trying to get to main screen
2015-01-05 13:54:54 : Could not automatically load Clash Of Clans
2015-01-05 13:54:55 : Restarting BlueStacks
2015-01-05 13:55:05 : Trying to get to main screen
2015-01-05 14:00:11 : Could not automatically load Clash Of Clans
2015-01-05 14:00:12 : Restarting BlueStacks
2015-01-05 14:00:22 : Trying to get to main screen
2015-01-05 14:05:27 : Could not automatically load Clash Of Clans
2015-01-05 14:05:28 : Restarting BlueStacks
2015-01-05 14:05:38 : Trying to get to main screen
2015-01-05 14:10:43 : Could not automatically load Clash Of Clans
2015-01-05 14:10:44 : Restarting BlueStacks
2015-01-05 14:10:55 : Trying to get to main screen
2015-01-05 14:16:00 : Could not automatically load Clash Of Clans
2015-01-05 14:16:01 : Restarting BlueStacks
2015-01-05 14:16:11 : Trying to get to main screen
2015-01-05 14:21:16 : Could not automatically load Clash Of Clans
2015-01-05 14:21:17 : Restarting BlueStacks
2015-01-05 14:21:27 : Trying to get to main screen
2015-01-05 14:26:33 : Could not automatically load Clash Of Clans
2015-01-05 14:26:34 : Restarting BlueStacks
2015-01-05 14:26:44 : Trying to get to main screen
2015-01-05 14:31:49 : Could not automatically load Clash Of Clans
2015-01-05 14:31:50 : Restarting BlueStacks
2015-01-05 14:32:00 : Trying to get to main screen
2015-01-05 14:37:06 : Could not automatically load Clash Of Clans
2015-01-05 14:37:07 : Restarting BlueStacks
2015-01-05 14:37:17 : Trying to get to main screen
2015-01-05 14:42:22 : Could not automatically load Clash Of Clans
2015-01-05 14:42:23 : Restarting BlueStacks
2015-01-05 14:42:33 : Trying to get to main screen
2015-01-05 14:47:39 : Could not automatically load Clash Of Clans
2015-01-05 14:47:40 : Restarting BlueStacks
2015-01-05 14:47:50 : Trying to get to main screen
2015-01-05 14:52:55 : Could not automatically load Clash Of Clans
2015-01-05 14:52:56 : Restarting BlueStacks
2015-01-05 14:53:06 : Trying to get to main screen
2015-01-05 14:58:11 : Could not automatically load Clash Of Clans
2015-01-05 14:58:12 : Restarting BlueStacks
2015-01-05 14:58:33 : Trying to get to main screen
2015-01-05 15:03:38 : Could not automatically load Clash Of Clans
2015-01-05 15:03:39 : Restarting BlueStacks
2015-01-05 15:03:49 : Trying to get to main screen
This has been a persistent issue since 5.3, I'll try to isolate the issue, but it's very likely due to excessive recursion of MainScreenCheck() (whether zoom out cause the trigger or not). It's the classic cause of hanging GUI
Is there a way to make bot restart after say 5 times unable to get main screen. Since COC has start up and ready to be zoom out but bot malfunction. If we could make bot restart, maybe it will solve the problem?
it actually does restart after 5 minutes without getting to mainscreen, it is implemented here:
If $counter >= 150 Then ;Five minutes
SetLog("Could not automatically load Clash Of Clans")
If _Sleep(1000) Or $RunState = False Then ExitLoop (2)
SetLog("Restarting BlueStacks")
WinActive("BlueStacks App Player")
Local $RunApp = StringReplace(_WinAPI_GetProcessFileName(WinGetProcess("BlueStacks App Player")), "Frontend", "RunApp")
ProcessClose("HD-Frontend.exe")
If _Sleep(5000) Or $RunState = False Then ExitLoop (2)
Run($RunApp & " Android com.supercell.clashofclans com.supercell.clashofclans.GameApp")
Do
If _Sleep(10000) Or $RunState = False Then ExitLoop (2)
Until ControlGetHandle("BlueStacks App Player", "", "BlueStacksApp1") <> 0
checkMainScreen()
ExitLoop (2)
it cannot restart the same way as you press stop and start button, as the process is single-threaded, it has to call itself again (recursion), if for some reason it cannot get passed main screen check, it will call itself multiple times which might lead to memory issue
i thought this 5 min was meant for 6th hr mark. Anyway, how about creating a duplicate bot and make first bot open and start 2nd bot then close first bot. Then make 2nd bot do the same but loop back to first bot?
@Antidote @GkevinOD
So I watched the bot and "luckily" I saw the beginning (I guess it is the beginning) of this error.
1.Bot is searching for bases.
2.Bot cannot find next button.
3. Bot waites until the time is run up.
4.Clash of clans shows :"You have been defeated. Lost 0 trophies, since the bot is not attacking but instead searching for next button.
- Bot checks whether it is at main screen and restart COC.
- Clash of clans restarts and it shows the homebase "zoomed-in".
and then we come to the loop I mentioned in my post yesterday.
As a solution:
When the bot cant find the next button, instead of restarting coc/bluestacks how about the following procedure:
1.Bot cannot find next button
2.Check if he can find the "return home button" or the red one at the left bottom (just forgot the name, the one that lets you return back to home while searching for bases).
3.then: Checkmainscreen(), if not, zoom_out else as the "last option": restart
I think the freeze of the bot is caused by the endless loop the bot creates when he cannot find next button and then always restarts bluestacks because he cannot get a true for checkmainscreen.
The one thing that irritates me is, when the bot restarts on and on, it is in main screen, but zoomed in, and even if I zoom out manually the bot doesn't recognise it's in mainscreen.
This are just my 2 cents, as I am not as advanced as you guys are, just trying to support this awesome project!
So, what are your thoughts on this?
I had it blank while training troops so it isn't exclusively related to the finding next button, I think that while searching it does the most checks so it happens most often then.
I managed to screencapture it. Hopefully , it will be of help
Got something to add?
Join the conversationLog in to post a reply.