The Bytecode Club - Reverse Engineering Forum
Developing Bot - Printable Version

+- The Bytecode Club - Reverse Engineering Forum (https://the.bytecode.club)
+-- Forum: Lobby (https://the.bytecode.club/forumdisplay.php?fid=1)
+--- Forum: Game Cheating, Botting & Reverse Engineering (https://the.bytecode.club/forumdisplay.php?fid=97)
+--- Thread: Developing Bot (/showthread.php?tid=155)



RE: Developing Bot - korpsx - 12-22-2014

I wish i could test kojometa's bot, but I don't know what to do with the script he posted on pastebin Sad


RE: Developing Bot - Antidote - 12-22-2014




RE: Developing Bot - GkevinOD - 12-22-2014




RE: Developing Bot - GkevinOD - 12-22-2014

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.


RE: Developing Bot - kojometa - 12-22-2014

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?


RE: Developing Bot - Antidote - 12-22-2014

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


RE: Developing Bot - GkevinOD - 12-22-2014




RE: Developing Bot - kojometa - 12-22-2014




RE: Developing Bot - kojometa - 12-22-2014




RE: Developing Bot - vanadium - 12-22-2014

(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.