Thread Rating:
  • 7 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Developing Bot
I wish i could test kojometa's bot, but I don't know what to do with the script he posted on pastebin Sad
I have found the pattern of the 1 pixel-off in the y value. When the base has no Dark Elixir Storage the y value is 1 off. I am in a higher TH and 99% of the time, they do have the storage.
man that sounds damn nice. i'm really looking forward for your method getting implemented into the script. tesseract seems to be far less successful than your script. would you mind posting your current version?
I've managed to tweak GkevinOD's code a bit to get both gold & elixir reading. It's super fast (it was nexting faster than you can read). Should've added parameters to it but I was lazy and ended up making 2 separate au3 files for gold and elixir lol. Below is the link to Bot.au3, GkevinODGoldFunction.au3 and GkevinODElixirFunction.au3. Just download all 3 to the same folder, run Bot.au3 and test for yourself. And since gold reading is much reliable now, I followed vanadium and modified ReturnHome to monitor gold change. It seems to be working but I haven't tested thoroughly yet. Also added a little extra button Keep Alive to help you guy prevent from being disconnect (what it does is send Down keyboard every 10 seconds). Enjoy!

http://www37.zippyshare.com/v/24789377/file.html
http://www37.zippyshare.com/v/92125782/file.html
http://www37.zippyshare.com/v/90677559/file.html
(12-22-2014, 05:40 AM)Antidote Wrote:  Make sense to me now since I tend to always use up all troops in battle I might overlook that. By detecting gold & elixir change, do you detect change in that screen region (pixelchecksum) or actually read gold & elixir to compare? How would it handle when you get 3 stars or battle end early (out of troops)?
Also I believe config file can be done in Autoit as well, requires very organized and flexible coding though. From what I see, your bot seems way ahead :D

This is the pseudo algorithm:
Quote:function waitForEndOfBattle() {
int delayInSeconds = config.getEndOfBattleDelay();
int resources = 0;
while(delayInSeconds > 0) {
int newResources = opponent.getGold() + opponent.getElixir();
if(newResources == resources) {
delayInSeconds--;
}
resources = newResources;
sleep(one second);
}
log.info("No resources change for "+count+" sec, Stopping battle");
surrender();
endBattle();
return image.wait(RETURN_HOME, 3000);
}

In the case the battle ends with 3 stars, the surrender() and endOfBattle() function do nothing because they did not detect either the surrender or the end of battle buttons.
 


Forum Jump:


Users browsing this thread: 100 Guest(s)

About The Bytecode Club

We're a community forum focused on Reverse Engineering, we try to target Java/Android but we also include other langauges/platforms. We pride ourselves in supporting and free and open sourced applications.

Website