Pages (104):    118 19 20 21 22104   
korpsx   12-22-2014, 07:52 AM
I wish i could test kojometa's bot, but I don't know what to do with the script he posted on pastebin Sad
Antidote   12-22-2014, 08:11 AM
GkevinOD   12-22-2014, 08:40 AM
GkevinOD   12-22-2014, 10:11 AM
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.
kojometa   12-22-2014, 10:23 AM
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?
Antidote   12-22-2014, 11:52 AM
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
GkevinOD   12-22-2014, 12:07 PM
kojometa   12-22-2014, 12:22 PM
kojometa   12-22-2014, 02:22 PM
vanadium   12-22-2014, 05:01 PM
(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.
Pages (104):    118 19 20 21 22104   
  
Users browsing this thread: 8 Guest(s)
Konloch Software - Bytecode Viewer - Reverse Engineering Forum
Copyright © 2014-2025 The Bytecode Club. Powered By MyBB.
CC0 Unless Specified Otherwise.