{"action":"created","issue":{"url":"https://api.github.com/repos/norecha/pokubot/issues/61","labels_url":"https://api.github.com/repos/norecha/pokubot/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/norecha/pokubot/issues/61/comments","events_url":"https://api.github.com/repos/norecha/pokubot/issues/61/events","html_url":"https://github.com/norecha/pokubot/issues/61","id":76907282,"number":61,"title":"\"SEVERE: de: ffc2b847\"","user":{"login":"kaiziru","id":12467650,"avatar_url":"https://avatars.githubusercontent.com/u/12467650?v=3","gravatar_id":"","url":"https://api.github.com/users/kaiziru","html_url":"https://github.com/kaiziru","followers_url":"https://api.github.com/users/kaiziru/followers","following_url":"https://api.github.com/users/kaiziru/following{/other_user}","gists_url":"https://api.github.com/users/kaiziru/gists{/gist_id}","starred_url":"https://api.github.com/users/kaiziru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaiziru/subscriptions","organizations_url":"https://api.github.com/users/kaiziru/orgs","repos_url":"https://api.github.com/users/kaiziru/repos","events_url":"https://api.github.com/users/kaiziru/events{/privacy}","received_events_url":"https://api.github.com/users/kaiziru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-16T00:55:54Z","updated_at":"2015-05-21T00:04:38Z","closed_at":null,"body":"After it click find a match, the first base it happen. sever : de : ffc2b841.\r\n\r\n[05.16.15 8:46:16 AM] aok.coc.controller.MainWindowController$9 handle WARNING: Setup is cancelled. \r\n[05.16.15 8:46:20 AM] aok.coc.launcher.Setup setup INFO: Setting up ConfigUtils... \r\n[05.16.15 8:46:20 AM] aok.coc.launcher.Setup setup INFO: Setting up ConfigUtils... \r\n[05.16.15 8:46:20 AM] aok.coc.launcher.Setup setup INFO: Make sure in-game language is English. \r\n[05.16.15 8:46:20 AM] aok.coc.launcher.Setup setup INFO: Make sure in-game language is English. \r\n[05.16.15 8:46:20 AM] aok.coc.util.ConfigUtils initialize INFO: Found barracks coordinates <403, 466> \r\n[05.16.15 8:46:20 AM] aok.coc.launcher.Setup setup INFO: Setting up BlueStacks App Player window... \r\n[05.16.15 8:46:20 AM] aok.coc.controller.MainWindowController$8 handle SEVERE: Setup is failed: ConfigUtils is already initialized. \r\njava.lang.IllegalStateException: ConfigUtils is already initialized.\r\n\tat aok.coc.util.ConfigUtils.initialize(ConfigUtils.java:115)\r\n\tat aok.coc.launcher.Setup.setup(Setup.java:50)\r\n\tat aok.coc.launcher.BotLauncher.setup(BotLauncher.java:52)\r\n\tat aok.coc.controller.MainWindowController$6$1.call(MainWindowController.java:189)\r\n\tat aok.coc.controller.MainWindowController$6$1.call(MainWindowController.java:184)\r\n\tat javafx.concurrent.Task$TaskCallable.call(Unknown Source)\r\n\tat java.util.concurrent.FutureTask.run(Unknown Source)\r\n\tat javafx.concurrent.Service.lambda$null$488(Unknown Source)\r\n\tat javafx.concurrent.Service$$Lambda$269/1763894632.run(Unknown Source)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javafx.concurrent.Service.lambda$executeTask$489(Unknown Source)\r\n\tat javafx.concurrent.Service$$Lambda$267/1612857430.run(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat java.lang.Thread.run(Unknown Source)\r\n\r\n[05.16.15 8:46:29 AM] aok.coc.launcher.Setup setupBsRect FINEST: The corner locations for the window \"BlueStacks App Player\" are [8, 4, 874, 753] \r\n[05.16.15 8:46:29 AM] aok.coc.launcher.Setup setup INFO: Setting up BlueStacks App Player resolution... \r\n[05.16.15 8:46:29 AM] aok.coc.launcher.Setup setup INFO: Setting up RobotUtils... \r\n[05.16.15 8:46:29 AM] aok.coc.launcher.Setup setup INFO: Setting up Barracks... \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Setting up ConfigUtils... \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Make sure in-game language is English. \r\n[05.16.15 8:46:42 AM] aok.coc.util.ConfigUtils initialize INFO: Found barracks coordinates <403, 466> \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Setting up BlueStacks App Player window... \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setupBsRect FINEST: The corner locations for the window \"BlueStacks App Player\" are [8, 4, 874, 753] \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Setting up BlueStacks App Player resolution... \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Setting up RobotUtils... \r\n[05.16.15 8:46:42 AM] aok.coc.launcher.Setup setup INFO: Setting up Barracks... \r\n[05.16.15 8:46:42 AM] aok.coc.controller.MainWindowController$7 handle INFO: Setup is successful. \r\n[05.16.15 8:46:42 AM] aok.coc.controller.MainWindowController$7 handle INFO: Click start to run. \r\n[05.16.15 8:46:53 AM] aok.coc.launcher.BotLauncher start INFO: Starting disconnect detector... \r\n[05.16.15 8:46:53 AM] aok.coc.launcher.DisconnectChecker run INFO: Running disconnect detector... \r\n[05.16.15 8:46:53 AM] aok.coc.state.Context setState FINEST: Setting next state to: StateIdle \r\n[05.16.15 8:46:53 AM] aok.coc.state.StateIdle handle INFO: StateIdle \r\n[05.16.15 8:46:54 AM] aok.coc.state.Context setState FINEST: Setting next state to: StateMainMenu \r\n[05.16.15 8:46:54 AM] aok.coc.state.StateMainMenu handle INFO: StateMainMenu \r\n[05.16.15 8:46:54 AM] aok.coc.util.RobotUtils zoomUp INFO: Zooming out... \r\n[05.16.15 8:47:08 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 403 466 \r\n[05.16.15 8:47:36 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 617 588 \r\n[05.16.15 8:47:37 AM] aok.coc.state.StateMainMenu handle INFO: Camp is full \r\n[05.16.15 8:47:37 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 729 146 \r\n[05.16.15 8:47:37 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 62 598 \r\n[05.16.15 8:47:39 AM] aok.coc.state.Context setState FINEST: Setting next state to: StateFindAMatch \r\n[05.16.15 8:47:39 AM] aok.coc.state.StateFindAMatch handle INFO: StateFindAMatch \r\n[05.16.15 8:47:39 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 147 529 \r\n[05.16.15 8:47:40 AM] aok.coc.util.RobotUtils leftClickWin32 FINEST: clicking 512 396 \r\n[05.16.15 8:47:45 AM] aok.coc.state.Context setState FINEST: Setting next state to: StateAttack \r\n[05.16.15 8:47:45 AM] aok.coc.state.StateAttack handle INFO: StateAttack \r\n[05.16.15 8:47:45 AM] aok.coc.launcher.BotLauncher loop SEVERE: de: ffc2b847 \r\naok.coc.exception.BotBadBaseException: de: ffc2b847\r\n\tat aok.coc.util.ImageParser.hasDE(ImageParser.java:171)\r\n\tat aok.coc.util.ImageParser.parseGold(ImageParser.java:176)\r\n\tat aok.coc.util.ImageParser.parseLoot(ImageParser.java:342)\r\n\tat aok.coc.util.ImageParser.parseLoot(ImageParser.java:354)\r\n\tat aok.coc.state.StateAttack.handle(StateAttack.java:46)\r\n\tat aok.coc.state.Context.handle(Context.java:20)\r\n\tat aok.coc.launcher.BotLauncher.loop(BotLauncher.java:86)\r\n\tat aok.coc.launcher.BotLauncher.start(BotLauncher.java:72)\r\n\tat aok.coc.controller.MainWindowController$3$1.call(MainWindowController.java:153)\r\n\tat aok.coc.controller.MainWindowController$3$1.call(MainWindowController.java:149)\r\n\tat javafx.concurrent.Task$TaskCallable.call(Unknown Source)\r\n\tat java.util.concurrent.FutureTask.run(Unknown Source)\r\n\tat javafx.concurrent.Service.lambda$null$488(Unknown Source)\r\n\tat javafx.concurrent.Service$$Lambda$269/1763894632.run(Unknown Source)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javafx.concurrent.Service.lambda$executeTask$489(Unknown Source)\r\n\tat javafx.concurrent.Service$$Lambda$267/1612857430.run(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\r\n\tat java.lang.Thread.run(Unknown Source)\r\n\r\n[05.16.15 8:47:45 AM] aok.coc.launcher.BotLauncher loop INFO: Waiting for dc checker to wake me up... \r\n\r\n\r\n\r\n![bad_base_1431737265069](https://cloud.githubusercontent.com/assets/12467650/7664009/d1378b0e-fba8-11e4-9105-8eb87e38e85c.png)\r\nbug folder\r\n\r\n\r\nhow to fix it?\r\n"},"comment":{"url":"https://api.github.com/repos/norecha/pokubot/issues/comments/104075948","html_url":"https://github.com/norecha/pokubot/issues/61#issuecomment-104075948","issue_url":"https://api.github.com/repos/norecha/pokubot/issues/61","id":104075948,"user":{"login":"code-borker","id":11745137,"avatar_url":"https://avatars.githubusercontent.com/u/11745137?v=3","gravatar_id":"","url":"https://api.github.com/users/code-borker","html_url":"https://github.com/code-borker","followers_url":"https://api.github.com/users/code-borker/followers","following_url":"https://api.github.com/users/code-borker/following{/other_user}","gists_url":"https://api.github.com/users/code-borker/gists{/gist_id}","starred_url":"https://api.github.com/users/code-borker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-borker/subscriptions","organizations_url":"https://api.github.com/users/code-borker/orgs","repos_url":"https://api.github.com/users/code-borker/repos","events_url":"https://api.github.com/users/code-borker/events{/privacy}","received_events_url":"https://api.github.com/users/code-borker/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T00:04:38Z","updated_at":"2015-05-21T00:04:38Z","body":"Wow, so I started digging into the code, and I'm really not sure what's going on.  I think to work around, for the time being, set the bot to attack only bases that have DE..\r\n\r\nFrom my understanding, it takes the image you have above, and looks at the pixel at 20,0 (which is where the gold coin is to determine if the base has DE..  (I'd need to see the same image produced from a base with DE to see what is different that lets the bot know whether or not a base has DE or not)\r\n\r\nAnyways, the bot is expecting 1 of 2 pixel colors under 20, 0 in the image with about a 2.7% accuracy in red, green, and blue values.  Either #b1a841 or #80752b, which are oddly enough is a shade of bright gold, or dark gold.  If it finds neither, then you get the exception.  \r\n\r\nYour image at 20,0 returns c2b847, which is still a shade of yellow, since you're still on that gold coin, but it's outside the bounds on the RGB values.\r\n\r\nSo for RGB values we have:\r\n\r\n#b1a841 = 177, 168, 65\r\n#80752b = 128, 117, 43\r\n#c2b847 = 194, 184, 71 (yours)\r\n\r\nBasically you need to be within 7 on all 3 values, and you are not.\r\n\r\nSo either your bluestacks player is not in 860x720 (which is odd, because normally there's a different issue when that happens).  Or for some reason something is shifting the available loot area out of where it would otherwise be expected.\r\n\r\nThat said, if you're not afraid of grabbing the source, and building it yourself, you can just change the RGB values to match what you're getting.  Just add:\r\n\r\n```java\r\n} else if (RobotUtils.compareColor(deCheck, 0xffc2b847, 7)) {\r\n  return false;\r\n}\r\n```\r\n\r\nYou'll probably need to do something similar for bases containing DE, as I'm guessing you'll have a different color to match against, I'm not sure, so:\r\n\r\n```java\r\n} else if (RobotUtils.compareColor(deCheck, 0xff<hex_color_here>, 7)) {\r\n  return true;\r\n}\r\n```"}}