The Bytecode Club
Log inJoin the club
Video Game Reverse Engineering

Developing Bot

Started by Antidote · Dec 5, 2014

1,033 replies21,297,466 viewsLocked
Dec 19, 2014#131

The most important thing is your village has to be zoomed out maximum, as all co-ordinate relies on that. The bot will do the zoom out itself, but sometimes it might fail to zoom out all the way, so better you zoom out first to reduce chance of error

Dec 19, 2014#132

@AtoZ: great, how did you do it? Last time I tried creating my own set of digits bmp from the game but still fails imagesearch. Seems like it's very picky with bmp not created by Autoit..

Dec 19, 2014#133

@Antidote
Can u release that source ? (Can i make some changes on source and apply for a BS screen 1440x900) ?
or release a separate search func only ?
ty.

Dec 19, 2014#134

@Antidote The bot will not attack for me.
I think the reason for not attacking is: my walls are level 5
Wich can conflict with the color of the attack button since it will select my wall when saying attack search

--MDMA

Dec 19, 2014#135

I'm using the no wait version. So this is what happens when I use the bot. Looks pretty good!! 🙂

After starting the bot it zooms out and finds my barracks (after I configured it) and trains troops. It starts searching for attacks, but it stops at the very first base it finds without meeting the gold and elixir requirements.

At the base, I get a message immediately on CoC "you cannot deploy troops in the red area".

No troops are sent out during the duration of the attack timer and it doesn't press next.

I wouldn't even know how to start making a bot 😛 , can't believe you guys are developing one. I'll continue to test and post my findings 🙂

Thanks for all your hard work :D

Dec 19, 2014#136

here's the script: https://pastebin.com/ry8RJEqr
I did make sure to get all coord auto adjusted to BS resolution so you can try first see if it works for you. If you want to compile from the script you must make sure to have Tesseract.au3 and Tesseract-OCR in the right folder for it to run.

Dec 19, 2014#137

@MDMA: right I didn't think of that. Maybe I should switch back to absolute value instead of Pixelcheck as it's not reliable enough.
@GeoByte: I think it's because your village hasn't been zoomed out completely. That's why you got the message "you cannot deploy troops in the red area". (since it deploy troops near the edge if you're not zoomed out it will get stuck in enemy's base.
I edit attack button and set bot to press down 30 times to zoom for you two here: http://www14.zippyshare.com/v/48158606/file.html

I'm gonna get some sleep now. If there's any error you guys just leave it here and I'll reply to it later..

Dec 19, 2014#138

@GeoByte, check if you BS are on 800x600 or 800x720... source are compiled on that screen i think.

Dec 19, 2014#139

First of all thx for this bot Antidote .
i tested the .exe file ( without waiting)
my bluestack running on 860x720 resolution
After saving the coordinates for barracks it starting to find a enemy but always hangs up on first enemy he find and doing nothing

Its the same problem like geobyte have

Dec 19, 2014#140

@AtoZ: great, how did you do it? Last time I tried creating my own set of digits bmp from the game but still fails imagesearch. Seems like it's very picky with bmp not created by Autoit..

I was experimenting a lot of things before I was able to make it work. I even tried silly things like capturing image into a GUI window and see if it will locate. I also downloaded a lot of ImageSearch au3 and dll versions that I found. Up til now I did not know which made It work but probably it's the HBITMAP version of imagesearch dll along with au3.

I only managed to locate the gem values in the coc main screen in BMP and PNG format. It's really quite hard to use imagesearch as it is really picky on the image. Image size is also a big concern. I browsed again on the coc-en files and found out a lot of similar numbers of different sizes. Btw the folder is organized as per window or use (ex. battle, camp, troop donation). And another concern is the snowfall but we can lock image search in a loop.

This discussion is closed.