You can try to modify this code yourself or if you can get me a screenshot of what you need scanned <control + Printscreen, Open new mspaint..paste and save...email that to me or post it here...> ill see if i can get it to scan for you...
my OCR script
Code:
coordmode,pixel ,screen
coordmode,mouse ,screen
IfNotExist, give
{
FileCreateDir, give ;if you dont have a give folder make one
}
notfound :=999
beginagain:
begin:
onexit, exitsub ;always delete colors.txt
iniread, x,myfile.ini,ocr3,5 ;get location to start ocr
iniread, y,myfile.ini,ocr3,6 ;get location to start ocr
ye :=(y + 20) ;Define search box height in pixels
xe :=(x + 20) ;Define search box width in pixels
sleep, 200 ;make sure values had time to load. Needed??
Start:
;mousemove, x,y ;Uncoment to check the area being scanned.
PixelGetColor, color, X, Y ;search for start of character
if color = 0x000000 ;Change this to the color of the character you are scanning..careful because the edges of the lines may shade a bit
{
Start2:
;mousemove, x,y ; Uncomment to check the area searched SLOWS IT
PixelGetColor, color, X, Y ;black found start saving results
fileappend, %color%, give\colors.txt ;add current color to txt
if color = 0x000000 ;Change this to the color of the character you are scanning..careful because the edges of the lines may shade a bit
count=0 ;black was found reset count for end of string trim
else
{
count+=8 ;black not found trim 8 more chars off at end
}
if x>%xe% ;IF END OF SEARCH AREA
{ ;Start processing data to black or white
fileread tobetrimmed, give\colors.txt
count2 = 1 ;start at first character in file
loop
{
StringMid, check, tobetrimmed, %count2%, 8 ;this replaces 8 non "0x000000" at a time
if check = ;no more characters to replace
break
if check != 0x000000
StringReplace, tobetrimmed, tobetrimmed, %check%, 0xFFFFFF, All
count2 += 8 ;change to next 8 characters
}
StringTrimRight, trimmed, tobetrimmed, %count% ;trim and save colors
filedelete give\colors.txt ;
fileappend, %trimmed%, give\colors.txt ;
loopcount=0 ; count loops so you dont search infinatly
char=0 ; set char to 0 so you search from 0-9
start3: ;start of compare current colors vs saved
if (loopcount > 500) ; DIDNT FIND A MATCH in up to 500 files
{
InputBox, UserInput, i didnt recognize #, what number was that?., , 200, 100
fileappend, %trimmed%, give\%userinput%.txt
filedelete, give\colors.txt
exitapp
}
fileread, sig, give\%char%.txt
IfInString, sig, %trimmed%
{
Msgbox, I recognized %char%
filedelete give\colors.txt
exitapp
}
else
{
char+=1
loopcount+=1
gosub, start3
}
msgbox !!!!!
FileMove, give\colors.txt, give\%UserInput%.txt ,1 ;rename colors.txt
exitapp
gosub, begin
}
else
{
y+=1
}
if y>%ye% ;Bottom of search area reached goto next colum and top
{
x+=1
iniread, y,myfile.ini,ocr3,6
}
gosub, start2
}
;black wasnt found yet keep searching
if x>%xe% ;if far right wall passed
{
filedelete, give\colors.txt
gosub, exitsub
}
else
{
y+=1 ;check the next pixel down
}
if y>%ye% ;if the bottom wall has been passed
{
x+=1 ;go to next column
iniread, y,myfile.ini,ocr3,6 ;Reset Y to top of search area
}
gosub, start
exitsub:
filedelete, give\colors.txt ;clean up colors.txt so next ocr doesnt append to it
exitapp
This script was meant to be called when needed....scan the pre defined area and give the option to save a new character/number if it didnt recognize it....i used an INI file to save locations i needed to scan but you should be able to delete the INI part and add a hard coded x, y location
You may want to paste THIS
Code:
[ocr3]
boxstart= This section is for locations the bot should check 5 is X 6 is Y
5=69
6=548
Into a file called myfile.ini... another program i used to set this up drew a box around the area to be scanned and saved the location so you could outline the area to scan...but it was done in pieces.. so it would be like 3 more scripts but if you need that you can check the forums for MTGO and find Atrain , Part1 and Part2