Skip to content
CodeSlinger69 edited this page Feb 2, 2016 · 11 revisions

All run-time operations of the bot are controlled by one window. Your settings in this window are saved in a .ini file in between sessions. The .ini file also contains some other settings that are not intended to be altered as the bot is running. Comments in the .ini file document these settings.

Note: There is no need to layout your base in any particular way for the bot; the bot searches the play field for the elements it needs to act upon. Some other bots make you lay out your base in a certain way, or make you identify the location of your buildings. Not mine.

Match filters

On the top left of the window are "Match Filters". These are the key settings for which most of the other bot's actions operate off of. In here are filters for Gold, Elixir, Dark Elixir and Town Hall Level. If all the filters are matched, then the bot proceeds with whatever it is doing. It is a logical AND fitler. As an example, if the bot is looking for a base to raid, and you have set Gold>=125000, Elixir>=125000, Dark>=0 and Town Hall<=8, then the bot will not execute a raid until all four of those conditions are true.

These settings mentioned in the previous paragraph are my standard settings when farming at TH9, by the way.

If all you were interested in was gold, you might set: Gold>=150000, Elixir>=0, Dark>=0 and Town Hall<=8.

Note 1: In my experience you should be raiding town halls one level less than your current town hall, for best results, thus I set Town Hall<=8 as my target when I am at TH9.

Note 2: The process the bot uses to check filters is gold, elixir and dark elixir first. If those are a match, it checks if the TH level is a match. The reason for this is that searching for the town hall and identifying its level is somewhat resource intensive. By only doing this search if the other filters match, then it saves on CPU a bit. Also, since the Town Hall can be off of the visible screen, the bot may shift the screen up and down in its search; this is time consuming, which is another reason to only do this if the other filters match.

Background Mode

This is an option to change how the bot interacts with the BlueStacks window. In a simplified form, there is a foreground mode and a background mode.

In foreground mode, the bot simulates mouse clicks just like a human would be doing. It takes snapshots of the screen similar to the way a human would do. The problem with the foreground approach is that it requires the BlueStacks window to not be obscured, or else the mouse clicks might go to the wrong window and the screen shots might be incomplete.

Background mode uses a "Control Click" method of AutoIt to send mouse clicks directly to the BlueStacks window. It also uses a Windows API call to get an image of the screen. The benefit of this is that the BlueStacks window can be obscured or even off screen, and the bot will still work. The BlueStacks window cannot be minimized, however, this will still not work due to a limitation inherent to Windows itself.

When the "Background Mode" option is checked, the bot will run a test to make sure that background mode works with your setup, and will notify if there is a problem. In certain circumstances, such as running BlueStacks within another virtual machine, say VMWare, background mode just does not work.

Things to do

On the middle left part of the window is where you select the actions for the bot to do.

:: Keep Online :: This will ensure that you stay online as long as possible, to avoid being raided and having your loot stolen. The game will kick you out for a few minutes avery 6 hours or so. There is nothing that any bot can do about this.

:: Collect Loot :: This will periodically click on your collectors and move their loot to your storages.

:: Donate Troops :: Will donate troops to your clan mates, based on their requests. Only troops that are in your barracks from 1) the auto-raid queuing, or from 2) you manually adding them, are available to be donated. There is no "queue to stock" function for donate-able troops. https://github.com/CodeSlinger69/ClAsHbOt/wiki/Auto-Donate

:: Reload Defenses :: Periodically, as configured in the .ini file, or every 20 minutes by default, the bot will click on the town hall and see if any defenses need reloading, and then reload them if needed.

:: Find Match :: This will begin a search for a base that meets the filters specified. Once a base is found, the bot will pause for you to manually execute your raid.

:: Auto Push :: This will try to find a base where the Town Hall is on a corner of the base, and thus available to easily snipe. Once found, the bot will snipe the Town Hall. Maximum distance from the corner can be specified in the .ini file. This is really only useful for trophy pushing. Really, this has limited utility in Gold League or higher, due to the December 10, 2015 update that effectively eliminated Town Hall sniping.

:: Auto Raid :: This will automatically search for bases to raid based on the filter specified, will execute a raid based on the selected strategy, and will queue up troops based on the selected Auto Raid Options. Then it will repeat over and over again. This is the "grindy" part of the game that I hate.

:: Defense Farm :: This will automatically collect defenses, the only current purpose of which is to attain the "Unbreakable" achievement. The bot will 1) dump cups until they are below the limit specified in the Dump Cups option, 2) go offline for 20 minutes (adjustable in the .ini), then 3) come back online and restart with #1. Effectiveness of this is dependent on your TH level and the Dump Cups setting. At TH11, I use 850 cups as the threshold.

"Find Match", "Find Snipable TH", "Auto Raid" and "Defense Farm" are mutually exclusive; in other words, only one can be chosen at a time. My standard farming setup is "Keep Online", "Collect Loot", "Donate Troops", "Reload Defenses" and "Auto Raid".

Auto raid options

On the middle right part of the window is where you specify some detailed options for Auto Raiding.

:: Use Breakers :: If checked, the bot will deploy breakers in addition to the other troops specified in the selected strategy. You can specify the number you want deployed. I never use this, as in practice is has not resulted in better results.

:: Dump Cups :: If your Trophy Count exceeds the specified amount, the bot will dump trophies to keep you under this amount. Useful for finding a good trophy level for farming, and staying there.

:: Dead Bases Only :: This option looks at the league shield in the upper left of the window, and only raids bases where that shield is gray. The idea is that it is likely that people who have not attacked in the current league season are likely not currently playing the game.

:: Ignore Storages :: This option calculates an estimate of loot in storages based on the math on this web page: http://clashofclans.wikia.com/wiki/Raids. It then figures the amount that is likely in collectors, and only allows bases to be raided if the amount in collectors exceeds the limits set in the match filters section.

:: Snipe Exposed TH :: This option instructs ClAsHbOt to snipe Town Halls that are in the corners of the base if they are available, and if the "Match Filters" do not match. The bot will only execute the snipe if the base has Gold, Elixir and Dark Elixir that exceeds what is specified in the match filters. The purpose of this option is to easily grab the loot that is now stored in the Town Hall after the December 10, 2015 update. This is really only useful in Silver League, as once you get to Gold League and above, snipable bases become difficult to find.

:: Wait For Heroes :: This option tells ClAsHbOt to wait until the specified number of heroes are available before launching a raid. If you specify more heroes than you have, then the bot will never raid! (e.g. you only have Kind and Queen, but not Warden. If you specify "3", the bot will never raid.)

:: Strategy :: This is where the raid strategy is selected. Until the 2015-06-23 release, there was only one strategy "Barcher". I have never found a better farming strategy, and as I have moved to TH10, this strategy still works very well when the "Ignore Storages" option is used. However, as I was seeking an effective farming strategy for TH10, I added "BAM" and "GiBarch" strategies as well. However, since the purpose of this bot is primarily farming, the addition of new raiding strategies, such as GoWiPe, Lavaloon, GoWiWi, or Loonion is unlikely at this time.

The Barcher and BAM strategies will attempt to find the half of the screen with the most collectors, and will launch the attack from that half. Due to text on the screen obscuring collectors, this is not always perfect. It will then rapidly distribute the troops in waves, including heroes if available. Rather than describing it here, it is really just best to watch it work. The GiBarch strategy does the same, but looks for which half of the screen has the most storages, as the purpose of GiBarch is to penetrate to the center of the base and attack those storages.

Other information

The other sections on the window are for displaying various elements of the bots operation, and should be self explanatory.