{"action":"created","issue":{"url":"https://api.github.com/repos/emiln/cljck/issues/19","labels_url":"https://api.github.com/repos/emiln/cljck/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/emiln/cljck/issues/19/comments","events_url":"https://api.github.com/repos/emiln/cljck/issues/19/events","html_url":"https://github.com/emiln/cljck/issues/19","id":104936167,"number":19,"title":"Locate upper-left corner of ClickerHeroes window","user":{"login":"emiln","id":1078925,"avatar_url":"https://avatars.githubusercontent.com/u/1078925?v=3","gravatar_id":"","url":"https://api.github.com/users/emiln","html_url":"https://github.com/emiln","followers_url":"https://api.github.com/users/emiln/followers","following_url":"https://api.github.com/users/emiln/following{/other_user}","gists_url":"https://api.github.com/users/emiln/gists{/gist_id}","starred_url":"https://api.github.com/users/emiln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emiln/subscriptions","organizations_url":"https://api.github.com/users/emiln/orgs","repos_url":"https://api.github.com/users/emiln/repos","events_url":"https://api.github.com/users/emiln/events{/privacy}","received_events_url":"https://api.github.com/users/emiln/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-04T17:43:51Z","updated_at":"2015-10-01T14:13:41Z","closed_at":null,"body":"It would be great to have the bot locate the upper left corner of the Clicker Heroes window. This would allow movement commands relative to the inside of the game frame. I imagine the commands `[:relative-move-to 100 100]` and `[:absolute-move-to 100 100]` to replace the current `[:move-to 100 100]`.\r\n\r\n- [ ] Replace `:move-to` with `:absolute-move-to`.\r\n- [ ] Introduce `:relative-move-to`."},"comment":{"url":"https://api.github.com/repos/emiln/cljck/issues/comments/144740012","html_url":"https://github.com/emiln/cljck/issues/19#issuecomment-144740012","issue_url":"https://api.github.com/repos/emiln/cljck/issues/19","id":144740012,"user":{"login":"emiln","id":1078925,"avatar_url":"https://avatars.githubusercontent.com/u/1078925?v=3","gravatar_id":"","url":"https://api.github.com/users/emiln","html_url":"https://github.com/emiln","followers_url":"https://api.github.com/users/emiln/followers","following_url":"https://api.github.com/users/emiln/following{/other_user}","gists_url":"https://api.github.com/users/emiln/gists{/gist_id}","starred_url":"https://api.github.com/users/emiln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emiln/subscriptions","organizations_url":"https://api.github.com/users/emiln/orgs","repos_url":"https://api.github.com/users/emiln/repos","events_url":"https://api.github.com/users/emiln/events{/privacy}","received_events_url":"https://api.github.com/users/emiln/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T14:13:41Z","updated_at":"2015-10-01T14:13:41Z","body":"Some thoughts on actually finding the game window's borders:\r\n\r\nTake a screenshot and pick _n_ random coordinates within it.\r\n\r\n1. Calculate the _fitness_ of each coordinate. If the best coordinate has optimal fitness, assume we've found the point we're looking for and stop.\r\n2. Pick the _n/3_ best coordinates so far ranked by fitness + _n/3_ random coordinates + mutations of the _n/3_ best coordinates. Repeat 1.\r\n\r\nAn idea for _fitness_ could be the following:\r\n\r\nSample both a horizontal and vertical line centered on the pixel and see how many pixels match the background color of the area around the game window. The contributes positively to fitness.\r\n\r\nSample the pixels below and to the right of the pixels. These should _not_ match the background color above.\r\n\r\nAssuming we find a pixel of optimal fitness, it should be the pixel next to the top left corner of the game window. From here it should be easy to trace the outline of the game window."}}