Git Product home page Git Product logo

auto-coc's Introduction

Clash of Clans Bot

Cooler name coming soon...?

This is my Clash of Clans bot. Built to play Clash of Clans on the BlueStacks Android emulator for Windows (built and tested on Windows 8). It is powered by SikuliX v1.0.1.

See below for setup and usage instructions

Feature Overview

This bot is fully featured and is capable of amazing things when left to it's own devices. This includes (but is not limited to):

  • Donate troops to clan members
  • Train troops, auto-balanced between all barracks
  • Collect resources from Elixir Collectors, Gold Mines, and Dark Elixir Drills
  • Accurately parse statistics from your village (Gold/Elixir/DE levels, Gems, etc.)
  • Raid other villages according to configurable farming goals
    • Gold/Elixir/DE heavy emphasis
    • Balanced loot
    • Etc.
  • Track raid statistics for later review and analysis
  • Find and clear obstacles (trees, bushes, gem boxes, etc.)

Initial Setup

To get setup you'll need:

  • Bluestacks App Player
  • A copy of SikuliX v1.0.1 (NOT v1.1.0) installed (either the IDE or the command line utility)
  • A copy of the files in this repository

BlueStacks

Download and install the BlueStacks App Player

Once installed, open the player and install Clash of Clans. You'll need to set it up and link it to your account so you can pick up where you left off on your phone/tablet or you'll need to start a new village.

SikuliX

  • Download SikuliX v1.0.1 (.jar file)
  • Move the downloaded file (sikuli-setup.jar) to an empty folder
  • Double-click the sikuli-setup.jar file to run the installer.
  • Choose Option 1 for the full IDE -or- Option 4 for just the command-line utility (I recommend Option 1)

This repository

Download the files in this repository here and extract it wherever you want. Just keep in mind the folder name must end in .sikuli, for example auto-coc.sikuli. You'll also need to change the name of the python script from attack-and-rebuild-troops.py to the name of the folder, auto-coc.py.

Usage

Option 1 (Using the SikuliX IDE)

  • Open the auto-coc.sikuli folder (or whatever you named it) in the SikuliX IDE and run it (Ctrl + R)

Option 2 (Using the command line)

  • Open your command prompt
  • Execute the command [Sikuli Base Dir]/runIDE -r [/path/to/auto-coc.sikuli] -s

The easiest way to run/debug the script is through the IDE. You also have the added benefit of the IDE loading and displaying all of the referenced images for you.

You may need to tweak the settings/reference images to match your base/setup. Sikuli is very sensitive in it's matching algorithms so what works on my machine may not work on yours, just update the images to match your BlueStacks/COC setup and you should be fine.

If you run into any problems please submit an issue. If you get creative and fix it yourself or add some new functionality to the original script please submit a pull request

Changelog

  • v0.0.1a
    • Initial release.
    • Works well on my machine but untested on other machines/setups
  • v0.0.2a
    • Better attack strategy (works on ~99% of bases)

Roadmap

  • Add support for dark troops
    • Donations
    • Training
  • Fix support for minimum Dark Elixir when raiding
  • Test on other base configurations
  • Implement "game loop" and time tracking

auto-coc's People

Contributors

darrensapalo avatar jeffreyhyer avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.