Thread Rating:
  • 7 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Developing Bot
Also, i dont have any issue with imagesearch on barracks, troops etc. But i'm developing my bot in java, notre using autour.
(12-20-2014, 11:40 PM)vanadium Wrote:  Also, i dont have any issue with imagesearch on barracks, troops etc. But i'm developing my bot in java, notre using autour.

what pixel size are the images your are searching for? and how much accuracy do you use?
(12-20-2014, 04:01 PM)DiviniT3a Wrote:  Same problem as MDMA. I also have level 5 walls so that may be the issue however it isn't clicking the walls, it just never clicks the attack button to start looking for targets.
Also it seems like it has trouble recognizing that clash of clans is open. If I repeatedly zoom in and out it recognizes it.
I made this account just to let you know and help out in anyway I could. Good luck man.

Try to change the $Attack Value from 0xF0E5D6 to 0xD39783 and let me know if it worked Wink
I've looked through all errors and make modifications to the code. Here's the latest installer:
http://www22.zippyshare.com/v/55848174/file.html
Source: https://pastebin.com/ry8RJEqr

Basically what it does is extract Tesseract-OCR, BS-Resolution folders and Source.au3. I've included the source inside the installer so you can run straight from the installer or make your modification to the source and compile from there. I think this is the most convinient way for everyone to start on working/testing the code without having to go through Tesseract setting and traineddata. Here's the changes I made:
- Use coord for button. I've been experimenting with PixelSearch and PixelGetColor but since colors are a bit tricky I'll just stick to coord from now.
- Use PixelCheckSum for main screen check. Since the screen become static when an error message appear, pixelchecksum is much more reliable than pixelgetcolor.  
- Let the script wait around 2min40s after dropping troops before pressing return home since I can't reliably determine when battle finish. Rotating light in the background make pixelchecksum useless
- Script send 30 down button instead of 20 to ensure screen is completely zoomed out. I can't find a way to determine if it has been fully zoomed out. If anyone manage to do it it would prevent lots of possible errors.
- Add Locate Barrack, Train, Attack and Village Search button for easier testing. You can test each part individually to test if there's error.
To use Village Search, make sure you are fully zoomed out, click attack, find a match and click Village Search. It will begin searching until match is found. If you want to continue searching, just click again.

A few things to note:
- When you first start the script, it will look like it's clicking randomly on the screen. This is just the script trying to zoom out (repeatedly press Down button on keyboard)
- Gold & Elixir readings are currently only about 60 to 70% accurate. I and many people here are working on a way to improve it, in the mean time just expect some possible mismatch, the script is just intended for testing only.
- Troops are deployed according to the selection in barrack drop down, not according to your army camps. So if your army camps contain troops that are not in the selection, it'll likely to mess it up. To read army camp I'll have to get imagesearch to work.
- For now troops deployment are not effective. I just put around 3 giants, ~30 barbarian, ~30 archers per wave near the edge for testing.
(12-21-2014, 04:10 AM)Antidote Wrote:  I've looked through all errors and make modifications to the code. Here's the latest installer:
http://www3.zippyshare.com/v/39333226/file.html

Basically what it does is extract Tesseract-OCR, BS-Resolution folders and Source.au3. I've included the source inside the installer so you can run straight from the installer or make your modification to the source and compile from there. I think this is the most convinient way for everyone to start on working/testing the code without having to go through Tesseract setting and traineddata. Here's the changes I made:
- Use coord for button. I've been experimenting with PixelSearch and PixelGetColor but since colors are a bit tricky I'll just stick to coord from now.
- Use PixelCheckSum for main screen check. Since the screen become static when an error message appear, pixelchecksum is much more reliable than pixelgetcolor.  
- Let the script wait around 2min40s after dropping troops before pressing return home since I can't reliably determine when battle finish. Rotating light in the background make pixelchecksum useless
- Script send 30 down button instead of 20 to ensure screen is completely zoomed out. I can't find a way to determine if it has been fully zoomed out. If anyone manage to do it it would prevent lots of possible errors.
- Add Locate Barrack, Train, Attack and Village Search button for easier testing. You can test each part individually to test if there's error.
To use Village Search, make sure you are fully zoomed out, click attack, find a match and click Village Search. It will begin searching until match is found. If you want to continue searching, just click again.

A few things to note:
- When you first start the script, it will look like it's clicking randomly on the screen. This is just the script trying to zoom out (repeatedly press Down button on keyboard)
- Gold & Elixir readings are currently only about 60 to 70% accurate. I and many people here are working on a way to improve it, in the mean time just expect some possible mismatch, the script is just intended for testing only.
- Troops are deployed according to the selection in barrack drop down, not according to your army camps. So if your army camps contain troops that are not in the selection, it'll likely to mess it up. To read army camp I'll have to get imagesearch to work.
- For now troops deployment are not effective. I just put around 3 giants, ~30 barbarian, ~30 archers per wave near the edge for testing.


Could you upp the code itself to pastbin again? Would be awesome. Its not against you but i mostly feel unconforable opening .exe Wink
sure, here's the script, i'll be updating this link with latest one so you guys can easily keep track
https://pastebin.com/ry8RJEqr
nice, thats perfect! Smile
thanks a lot!

i also tested the script of GkevinOD and at it works incredibly good for me as wel!
i think that in the future it would definetly be the better option than tesseract.
 


Forum Jump:


Users browsing this thread: 111 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