Code:
#include <Tesseract.au3>
HotKeySet("a", "ReadValue")
Func ReadValue()
$Read = _TesseractWinCapture("BlueStacks App Player","",0,"",1,2,42,70,660,490,0) ;Capture screen region with gold and elixir
msgbox (0, "Result", $read)
$Read = StringSplit(StringStripWS($Read, 1+2+4), @CRLF) ;Strip whitespaces & blank lines and split into array
$Gold = Number(StringStripWS($Read[2], 8)) ;Convert gold to number
$Elixir = Number(StringStripWS($Read[3], 8)) ;Convert exlir to number
$Dark = Number(StringStripWS($Read[4], 8)) ;Convert dark to number
MsgBox(0,"Result", "Gold: " & $Gold & @CR & "Elixir: " & $Elixir & @CR & "Dark: " & $Dark)
EndFunc
while 1
sleep(200)
WEnd
First of all thanks .
Based on the details you given out so far, I have
1. Installed Tesseract-OCR (https://code.google.com/p/tesseract-ocr/)
2. Placed the coctraineddata into Tesseract-OCR/tessdata/ (What else should I do other than placed into the folder?)
3. Installed supercell-magic_5.ttf font
4. Used Tesseract.au3 (http://www.autoitscript.com/forum/topic/...n-ocr-udf/)
5. Launched bluestacks and COC. Zoom out all the way before start search war.
6. So far, the decoding is pretty much working but success rate of 10% or less.
7. Each time the decoding executed, the tesseract command window (black window) will appear and disappear (Pretty annoying - How to prevent the black window show up?)
8. Next, the $read msgbox will pop up and some of the captured are letters. (Screen shot below)
9. The part that i do not understand is "you can add "digits" to tesseract shell command to make it recognize only numbers"
10. Did i missed out anything?