{"id":22394849,"url":"https://github.com/blakley/clash","last_synced_at":"2025-10-15T14:31:56.726Z","repository":{"id":157487698,"uuid":"391822838","full_name":"Blakley/Clash","owner":"Blakley","description":"Clash Of Clans clan-member invitation automation","archived":false,"fork":false,"pushed_at":"2024-09-06T04:27:34.000Z","size":51,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T07:51:21.558Z","etag":null,"topics":["bluestacks","clash-of-clans","clashofclansapi","cv2","pillow","pyautogui","tesseract-ocr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blakley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-02T05:12:47.000Z","updated_at":"2025-03-21T12:41:56.000Z","dependencies_parsed_at":"2025-02-01T04:26:21.601Z","dependency_job_id":"c4ea05a7-2b6b-47df-82e4-40e54321f81b","html_url":"https://github.com/Blakley/Clash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blakley/Clash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blakley%2FClash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blakley%2FClash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blakley%2FClash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blakley%2FClash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blakley","download_url":"https://codeload.github.com/Blakley/Clash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blakley%2FClash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279085462,"owners_count":26100017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluestacks","clash-of-clans","clashofclansapi","cv2","pillow","pyautogui","tesseract-ocr"],"created_at":"2024-12-05T05:11:55.901Z","updated_at":"2025-10-15T14:31:56.395Z","avatar_url":"https://github.com/Blakley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clash\n\nClash Of Clans clan-member invitation automation\n\n![alt text](https://img.redbull.com/images/c_crop,x_0,y_0,h_1000,w_1167/c_fill,w_650,h_540/q_auto,f_auto/redbullcom/2019/05/09/b6398f12-7d51-4279-a335-d9ba63e50199/clash-of-clans)\n\n## Features\n * Ability to invite and filter players to your clan via townhall, player rank, and troop rank\n * Can modify code to add additional filter parameters such as by builder hall\n\n## Understanding the Code\nBy default, some of the core functionality is based upon `pyautogui.position()` which is a function\nin the `pyautogui` module that allows you to get the (x, y) coordinates of your mouse.\nWe use this function to get the values of specific Clash of Clans buttons and input areas.\n\nBelow is a code snippet that shows how buttons from the game are assigned to (x, y) coordinate pairs on the screen.\nYou can adjust these values if you experience any issue or if your screen resolution differs from 1920 by 1080p.\n - \u003cb\u003eNote: Run BlueStacks5 in full-screen mode with 1920 x 1080 resolution\u003c/b\u003e.\n```\nself.positions = {\n\t\t\t'game_area' : (1373, 35),\n\t\t\t'my_clan' : (809, 66),\n\t\t\t'find_new_members': (516, 733),\n}\n```\n\nTo get the townhall and trophy amount of players, we use the official Clash of Clans API.\nYou will need to create a developer's account to get started. [Clash API](https://developer.clashofclans.com/#/login)\nAfter creating an account and obtaining your `clash API token`\nchange the following snippet of code to accept your token.\n```\nself.token = 'your_clash_api_token'\n```\n\nCurrently, we invite players that are th9 with 1000 trophies. We can easily edit this as well as add other filters taken from the clash API.\nBelow is a code snippet that shows how to filter members. This filter is based on the player's archer and barbarian troop levels. Here we only will invite you if your level is above 4.\n```\ntroops = response.get('troops')\n\t\tbarb = troops[0]\n\t\tarcher = troops[1]\n\t\tif int(archer['level']) \u003c 4 and int(barb['level']) \u003c 4:\n\t\t\treturn False \n```\n\n## Dependencies\n\nYou will need to have both `bluestacks5` and `pip` installed on your system and then install the following using pip.\n```\n$ pip install requests\n$ pip install opencv-python\n$ pip install Pillow\n$ pip install numpy\n$ pip install pynput\n$ pip install pyautogui\n$ pip install pyperclip\n$ pip install pytesseract\n```\n\n## Usage\n1. Simply have Clash of Clans running in BlueStacks5, then run the following:\n   - execute `python clash.py`\n2. After executing the command and inputting 'Number of players to invite:', immediately click into your BlueStacks window to focus it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakley%2Fclash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblakley%2Fclash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblakley%2Fclash/lists"}