12-21-2014, 04:22 AM
(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