01-27-2015, 03:26 AM
(This post was last modified: 01-27-2015, 03:31 AM by FastFrench.)
Hello,
as I got some time today to play with the code, I've done some changes on the source script (still have to test them):
- I've splitted the big script file into several 3 smaller files:
* the main file, with all the stuff except what is explicitely in one of the next 2
* one with pixels configuration (that's where you'll have to go when images are changing when a new version of is launched). I've removed most hardcoded coordinates and colors (but not all, some coordinates are still not clear for me, so can't name them) from the main script to isolate them in a specific file. This way the code is much more maintenable.
* OCR-related stuff. I also isolated this, as I guess it may be a temporary solution. For instance we will have to use a real OCR to make decent clan troops donations.
- I've greatly reduced code redundancy, so now the same is done with significatively less lines (it should easier to read and maintain)
- I now support only one "algorithm" for attacks with the following changes :
* it uses all the troops available (restricted to barbarian, archers, goblins, wallbreakers, giants, king and queen)
* you can ask it not to use the clan castle
* instead of dropping troops in 5 discret points for each edge, it now makes a uniform distribution amongst the edge (so less vulnerable to area attacks).
- Also added the possibility to attaque from a single edge (quite usefull when you uses giants and wallbreakers).
The fact some parts of the code are much smaller make it very EZ now to experiment new attack strategies (order, number and composition of waves, delays...).
It will probably take a couple of days to finalize and do some testing on this.
What do you think about those changes ?
And if someone is interested, where should I put the modified script ? (into a branch in GitHub, on the repository you use here, or somewhere else ?)
as I got some time today to play with the code, I've done some changes on the source script (still have to test them):
- I've splitted the big script file into several 3 smaller files:
* the main file, with all the stuff except what is explicitely in one of the next 2
* one with pixels configuration (that's where you'll have to go when images are changing when a new version of is launched). I've removed most hardcoded coordinates and colors (but not all, some coordinates are still not clear for me, so can't name them) from the main script to isolate them in a specific file. This way the code is much more maintenable.
* OCR-related stuff. I also isolated this, as I guess it may be a temporary solution. For instance we will have to use a real OCR to make decent clan troops donations.
- I've greatly reduced code redundancy, so now the same is done with significatively less lines (it should easier to read and maintain)
- I now support only one "algorithm" for attacks with the following changes :
* it uses all the troops available (restricted to barbarian, archers, goblins, wallbreakers, giants, king and queen)
* you can ask it not to use the clan castle
* instead of dropping troops in 5 discret points for each edge, it now makes a uniform distribution amongst the edge (so less vulnerable to area attacks).
- Also added the possibility to attaque from a single edge (quite usefull when you uses giants and wallbreakers).
The fact some parts of the code are much smaller make it very EZ now to experiment new attack strategies (order, number and composition of waves, delays...).
It will probably take a couple of days to finalize and do some testing on this.
What do you think about those changes ?
And if someone is interested, where should I put the modified script ? (into a branch in GitHub, on the repository you use here, or somewhere else ?)