Jump to content
Sign in to follow this  

[Features] All LunaEclipse's Features - All in One Thread [May 8, 2016]

Recommended Posts

This thread now has all my released features, these features are available for download in DIFF format from the GoogleDrive links below.  These DIFF files can be applied to a base bot, or can be applied by MOD authors to their compilation mods.  While you are free to modify this code however you wish, I would ask that if you are releasing it as part of a compilation mod that you respect any specific requests made in this thread, for example the request if you use Custom Attacks to include the warning boxes for Custom Attacks on your main post.





Note:  MOD authors from now on will be responsible for checking out this thread for updates.  I will no longer be notifying authors when I update a feature as it's too difficult to keep track of who is using what feature.  I would suggest any MOD authors using my features follow this thread for notifications on updates.

Custom Attacks v 1.3.2 for MyBot.run v5.3.2 - Updated May 8, 2016



Note:  I request that any MOD authors using this in their MODs include the yellow warning boxes to their main post as this contains important information users should know, and will save me getting PMs of the same question from multiple people, simply because they have not seen this thread to know the information.  Aside from this one request you are to free to use the system and even modify it however you wish.  Thank you!

This attack system re-write removes the old official bot DE Side attack and TH Side attack.

Please note that Redline deployment is far from perfect, but this is a limitation of the detection used by the BOT.  It gets the redline points, and then it creates deploy points by moving those points a set number of pixels away from the center, meaning if the point is in the bottom left quadrant it moves the drop point to the bottom left. 


However as bases can have strange layouts and there is sometimes a gap, and then another building, it is possible for the points given to actually be inside another red area of an outlying building and so when it tries to drop the troops the message appears on the screen, "Can not deploy troops in the red area" however the bot can not detect that the troops were not dropped and it continues dropping troops as if they were dropped.


This can leave left over troops at the end of the battle, and depending which areas did not deploy can weaken your attack.  Unfortunately, try as much as I could this last week or so, I have not been able to find any solution to this problem.  The team is working on improved redline detection and deploy point creation and its my hope once this is finished the Attack System can be as great as it was before.



  • Smart Attack UI option has been removed, all attacks are now Redline attacks, its now impossible to disable this.
  • Unit and Wave deploy delays have been altered to offer more natural deployment.


One, Two, Three and All Sides Attacks:

  • Complete re-write of the code.
  • Removed the option to sellect collector types to deploy near, if you want to attack collectors specifically use Save Troops for Collectors.
  • Choses the sides to attack from at random from the four available sides, however it will never chose a side more than once.  The order of attack is still in the same order.


Save Troops for Collectors:

  • Smart selection of collectors, based on which resources you need.
  • UI Configuration for percentage of collectors that must be exposed.
  • UI Configuration for maximum distance from the redline for a collector to be considered exposed.
  • Delays for Save Troops for Collectors is different than delays for other attacks as the troops are more vunerable because they are deployed in small groups.
  • Ability to switch to an All Sides attack if the base does not have exposed collectors, simple check the switch to all sides option.
  • Ability to exit the attack if the base does not have exposed collectors, simply make sure switch to multi-finger is not checked.
  • Will attempt to deploy giants as a distraction, instead of deploying a giant for each collector, it only deploys giants with a minimum distance between them to act as a more intelligent distraction.
  • Save troops for collectors will exit the attack as soon as all exposed collectors are destroyed, saving troops and allowing for a quicker turn around with battles.
  • Ability to restrict which collectors it will search for, simply select the collector types that you wish the bot to check.  Please note, this does not force attacking for selected collector types, they will still be skipped if your storage is full, however unchecking the boxes can allow you to skip resources types that you are not interested in, even if your storage is not full.
  • Unlike milking, collector clean up troops can include, Barbarians, Archers, Goblins, Wizards and Minions.


The item highlighted in green will cause the bot to attack dead bases even if the collectors are not exposed, however the red highlighted item will cause the bot to exit without dropping any troops if the collectors are not exposed.  Make sure you have the Switch to Multi-finger set for which option you wish.

Save Troops for Collectors is not a trophy gaining attack, most attacks will finish with less than 50% destruction as it's sole purpose is to get in destroy the exposed collectors and exit, using as few troops as possible.

Custom Deployment:

  • Customizable options for choosing which side to attack from, this is done by setting values to important buildings, the side chosen is the side with the most points.
  • Only buildings required are used for calculating the attack side, so for example if you are full on gold, it will not check mines or gold storages.
  • Spells are targeted to a priority structure, this will be the DE Storage if you are level 7 or higher, and you have room to store DE, otherwise it will choose the Town Hall.  In the rare occasion that it can't find the Town Hall it will default to the center.
  • Allows you to attack with spells, specifying a percentage of distance from the attacking side to the priorty spell target.
  • Allows you to specify the order of troops to deploy, and even configure delays between waves.  Troops can be deployed from 1 position in the center of the side, two positions on the side, or as a wave covering the whole side (position set to 0).
  • Allows you to specify a drop from one corner, for example Left or Right, so that more complex actions such as a Queen Walk can be done.
  • Will wait for 4 earthquakes, and the king to be present before using earthquakes.
  • Special troops such as wall breakers will always drop specific number of troops if one or two points is selected.  Wall breakers always drop in pairs for maximum wall destruction.
  • Detects clan castle spells and uses them if needed.
  • Deploys troops close to the redline to help avoid bans.

Note:  Even though there is a UI setting for Gold Storages and Elixir Storages, the calculation of these has been disabled in code, because the functions to get their locations return multiple locations for the same storage.  As such calculating points would result in storages being counted twice, which is not suitable for this deployment.  Storages require more accurate images that will return only one result per storage structure.

There is an issue with Earthquake detection when on the 8th button if the king is present.  This is an issue with the DLL and can not be fixed with AutoIt code.


Save Troops for Collectors, and Custom Deployment attacks are smart attacks.  As such they perform many complex calculations before attacking and this means that sometimes the battle timer may start before troops are deployed. 


Be aware that even though it may not start attacking until after the battle starts, it ALWAYS decides during the 30 second preparation period if it will ATTACK or SKIP.

Change Log:


May 8, 2016: v1.3.2 for MyBot.run v5.3.2

  • Change for delays on Save Troops for Collectors as the troops deploy in small groups and are more vunerable, they need to deploy faster.
  • Fix for CC and Heroes sometimes not getting a valid drop point and causing an error, if a valid drop point is not obtained it will just skip deployment.


May 5, 2016: v1.3.1 for MyBot.run v5.3.2

  • Minor code fix to ensure One, Two, Three and All Sides creates drop points correctly and doesn't give an error.


May 4, 2016: v1.3 for MyBot.run v5.3.2

  • Hardcoded all attacks to use redline attacks only, the UI option has been removed.
  • Removed Multi-finger attacks and Fast ADB Deploy as these options were high ban risk.
  • Complete re-write of One, Two, Three and All Sides attacks, also removed collector targetting on these attacks as Save Troops for Collectors does this.
  • One, Two and Three side attacks will choose the sides randomly, it will always attack in the same order, but the sides chosen will be random.
  • Save Troops for Collectors now will default back to All Sides if there is no enough exposed collectors.
  • Modification on Save Troops for Collectors which should in theory get rid of the loop if the battle runs out of time.
  • Complete re-write of how remaining troops are deployed.
  • Modified the delay times for troops and waves to be more humanlike, and removed the option for 0 delay.
  • Any other changes that I have forgotten to mention.


April 15, 2016: v1.2 for MyBot.run v5.3.2

  • New Experimental ADB Fast Deploy mode added for Multi-Finger mode only.  This should deploy troops at speeds similar to Fast Deploy CSV files without breaking "True Background Mode".  If you experience problems please disable this option - This has a high risk of your account being banned, use this at your own risk!
  • New option to limit which collector types will be scanned by Smart Save for Collectors.  This does not choose which collectors will be attacked, what is attacked is still based on storage fill level.  This option only controls which collector types are checked.


April 8, 2016: v1.1 for MyBot.run v5.3.2

  • Button added to reset to default Custom Deployment configuration.
  • Fixed the auto-applying of the default Custom Deployment configuration.  If you have provlems a Reset button has been added to the UI to reset it manually.
  • Changed PrepareAttack, this should should now respect restricted troop dropping options.
  • Updated Custom Attacks and Multi-finger now calculate all drop points for troops before starting battle to increase speed.  This is the fastest I can make the system without breaking MEmu and Droid4x "True Background" mode such as the modified CSV system for fast deploy does.
  • Updated checks for Save Troops for Collectors so that it shouldn't get stuck in an infinite loop if the battle ended before all collectors were destroyed.
  • Minor code tidy up such as removing unused functions.


April 3, 2016: v1.0.1 for MyBot.run v5.3.2

  • Changed PrepareAttack, this should fix the lightning spell issue with SmartZap, please let me know if the problem persists.
  • Updated both DIFFs to fix a missing enum for Milking which could cause problems with Milking attacks.
  • Updated Custom Attacks with SmartZap to include handling of profile settings for SmartZap which I forgot in the inital release.
  • Updated both DIFFs to remove left over debugging code while testing earthquake problem.
  • Declared variables in StandAttack.au3 which I had forgotten.
  • Added extra information to spell cast logging to aid with the debugging of Lightning Spells not being cast with SmartZap. 


April 2, 2016: v1.0 for MyBot.run v5.3.2

  • Initial Release, two versions, Custom Attacks, and Custom Attacks with SmartZap

    SmartZap v1.1.1 for MyBot.run v5.3.2 - Updated April 8, 2016


    Features:  What makes it different then the original!

    • I have added a lot of extra escape conditions to the SmartZap, these include things like, exiting if your DE storage is full, etc...
    • I have re-worked the code so it works 100% for Town Hall 11, also my code changes should ensure that it will never again fail even if they add new Town Hall levels.
    • Town Halls below Town Hall 7 will not zap at all, because what's the point, they can't store the DE anyways.
    • New option to only zap Dead Bases, this is actually recommended because Live Bases will generally have drills that are only partially full, however it is your choice.
    • New option to skip zap on a Town Hall Snipe if your heroes were deployed to save their health for a quicker recovery.
    • Detailled logging every step of the process.  Never again ask yourself, is SmartZap working?  If it zaps you will know why, if it doesn't zap you will also know why.
    • Auto training was removed, to train lightning spells automatically simply assign the number of lightning spells you want on the Troops Tab.
    • Added the ability to call SmartZap from code overriding the UI setting for minimum DE required.

    Example Logging Messages:

    • You do not have the ability to store Dark Elixir, time to go home!"
    • "Your Dark Elixir Storage is full, no need to zap!"
    • "No drills found, time to go home!"
    • "Number of Dark Elixir Drills: <x>"
    • "No lightning spells trained, time to go home!"
    • "Number of Lightning Spells: <x>"
    • "No Dark Elixir so lets just exit!"
    • "Not a dead base so lets just go home!"
    • "Dark Elixir is below minimum value, exiting now!"
    • "First condition: <x>+ Spells so attack any drill."
    • "Second condition: Attack Lvl <x>+ drills if you have <y>+ spells"
    • "Third condition: Attack Lvl <x>+ drills with more then 30% estimated DE if you have less than <y> spells"
    • "Drill did not match any attack conditions, so we will remove it from the list."
    • "Gained: <x>, Expected: <y>"
    • "Last zap gained less DE then expected, removing the drill from the list."
    • "Gained: <x>. Adjusting amount left in this drill."
    • "DE from last zap: <x>, Total DE from SmartZap: <y>"
    • "Removing drill since it wasn't found, so it was probably destroyed."
    • "Estimated stealable DE in Drills: <x>, <y>"


    Do not mistake failing to zap with the available DE is higher than the amount specified in the UI as it not working, this even applies to the message that says estimated stealable.  You can have the DE minimum set to 250 and SmartZap can report an estimated amount of 308 and still not zap. 



    Because the minimum DE is just one of several checks applied to drills to determine if it should zap.  SmartZap applies 3 rather complex checks to see if it should zap or not, and all the parts of the these checks must be true for SmartZap to actually zap a drill. 


    If you see the message "Drill did not match any attack conditions, so we will remove it from the list.", this means that even if the estimated DE in the drill or the available DE is higher than the UI setting, the other requirements for zapping were not met, so it skipped zapping. 


    Change Log:


    April 8, 2016:  v1.1.1 for MyBot.run v5.3.2

    • Bugfix for stats displaying incorrectly because of a variable declared in the wrong place after the changes made to logic in v1.1.


    April 7, 2016:  v1.1 for MyBot.run v5.3.2

    • Added the ability to call SmartZap from code with a parameter to override UI setting for minimum Dark Elixir required.
    • Changed the logic for exiting so drills are no longer located if its not necessary, this should show a speed increase when zapping will be skipped because there is no enough DE or your storage is full etc...
    • Added safety checks before zapping to make sure we are still in the battle, so it doesn't get stuck trying to zap after the Return Home screen has been shown.
    • Added a new log message to show speciifically that zapping was skipped if the users town hall level is below 7.
    • Changed the tab to MOD tab, for extra compatability with my other downloadable features.
    • Other minor changes where necessary.


    March 25, 2016:  v1.03 for MyBot.run v5.3.1

    • Added option on Town Hall snipe to skip zapping if your heroes were used to save health.  This will give a faster recovery time, and allow your heroes to be used in battle sooner.
    • Rearranged the UI a little, now the stats are in the same group box as the options, although they are still in the same positions on the tab.


    March 24, 2016:  v1.02 for MyBot.run v5.3.1

    • Updated SmartZap to work with Town Hall Snipe.  Will skip the standard wait several seconds if a Zap is performed as this takes several seconds.


    March 22, 2016:  v1.01 for MyBot.run v5.3.1 

    • Updated so that it can read the DE available after the latest COC update on March 21, 2016.
    • Added new function to determine if DE storage is full, as the bar is in a different position when in combat. Thanks to @zengzeng for pointing this out.

    March 21, 2016:  v1.0 for MyBot.run v5.3.1 

    • Initial Release

      Android Settings in the Profile v1.1 for MyBot.run v 5.3.2 - Updated April 7, 2016


      Features:  What does this modification do?

      • Adds an tab to the bot to control several of the features of the android client.
      • Emulator drop down list is filled with available emulators on the computer only.
      • If you have no supported emulators installed you will get a message warning you of this, the bot will also close.
      • For emulators that support multiple instances such as MEmu, Droid4X and Nox, you will be able to specify which instance you wish to use with your profile.
      • Hide Android Task Bar icon, please note the UI has a warning beside this option.  Enabling this option can have unexpected results, if you withness any undesired behaviour please uncheck this option.  (Only works in background mode)
      • Window alignments have been extended to allow you to align the android window to the Bot's position.  This is useful for emulators such as MEmu which always starts in the center of the screen.  It makes more sense to move the android window in this case than to move the Bot window.
      • Removes the need for complex command line switches, now you can multi-bot requiring you to launch with nothing more than the profile you wish to run.  Simply use MyBot.run.exe "Profile Name", nothing else is needed.


      This code was created by me for the official bot, however at this time it is still considered development code.  These modifications have been running in my own personal MOD now for about 6-8 weeks without issues.  While these features are planned for the next major release of the Bot, the code and functionality of these features may change between now and official release.


      This is basically just a sneak peak of a feature of the next major release.


      MyBot.run Multi Launcher

      I have provided an executable that I have written in C# that can be used alongside this feature to launch multiple bots at once.  Simply download the MyBot.run Multi Launcher below and place it inside your MyBot.run directory.  As the download is an EXE file, please follow standard precautions of virus scanning the file, for your own peace of mind.


      The first time you run it, you will have to select the MyBot.run program file through the menu at the top of the application.  You are able to chose either an EXE File, or an AU3 file to run the bot in source code mode if you have AutoIt installed.  Once you have selected the program file it will be saved and will use that file whenever you load the application.


      To use simply select as many profiles from the list as you wish to launch and it will start a bot for each profile selected.  Please note I put a delay of 1 second between each bot starting to ensure it loads everything correctly, so if you are starting 5 bots you could see a delay.


      Change Log:


      May 6, 2016:  MyBot.run Multi Launcher v1.0

      • New program written by me in C# to launch several bots at once, simply select which profiles you wish to load, and it will load the bots using those profiles, and the emulator and instance specified in the profile. 
      • This is only useful when run alongside the Android Settings in the Profile Feature.


      April 7, 2016:  v1.1 for MyBot.run v5.3.2

      • Changed the tab to MOD tab, for extra compatability with my other downloadable features.


      March 25, 2016:  v1.0 for MyBot.run v5.3.1

      • Initial release


        Downloads - Various features in DIFF format as well as Extra Tools


        Custom Attacks without SmartZap v1.3.2 for MyBot.run v5.3.2:  GoogleDrive Download (No login required)

        Custom Attacks with SmartZap v1.3.2 for MyBot.run v5.3.2:  GoogleDrive Download (No login required)

        SmartZap v1.1.1 for MyBot.run v5.3.2:  GoogleDrive Download (No login required)

        Android Settings in the Profile v1.1 for MyBot.run v5.3.2:  GoogleDrive Download (No login required)


        MyBot.run Multi Launcher v1.0 (Standalone EXE File):  GoogleDrive Download (No Login required)


        Note:  Anyone having trouble applying these DIFF files to a base bot can follow the following tutorial.

        Edited by LunaEclipse
        • Upvote 24

        Share this post

        Link to post
        Share on other sites

        Like always LunaEclipse ...

        You're the one !

        Edited by Eloy

        Share this post

        Link to post
        Share on other sites
        On 06/04/2016 at 11:13 AM, LunaEclipse said:

        Currently SmartZap and Android Settings in the Profile has been updated, the information added to this thread and the newest download, the Custom Attacks will follow when I complete it.


        Its the very first line of the thread.


        On 06/04/2016 at 11:13 AM, LunaEclipse said:

        What I am doing is going to merge them all into one thread, the reason it is not up yet is because I am also updating several of the system, which means testing before uploading the new DIFFs, give me a couple of days to get it all sorted out, and then this thread will be the one stop shop for all my modifications.


        Thats a little further down.  I am doing a fairly major rewrite of deployment trying to get increased speed, it will be available when I am happy with the changes are working as they should.

        Share this post

        Link to post
        Share on other sites
        This topic is now closed to further replies.
        Sign in to follow this  

        • Create New...