Jump to content

pingpong24

Active Members
  • Posts

    101
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

pingpong24's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. I just downloaded that program from the link and it has put lots of stuff on my start up can someone check if its a virus and if so remove it from the site.
  2. feels so good that someone used my OCR, program and actually mange to get it to work. next version will have recursion so it should be much faster.
  3. can anyone help, i am trying the same thing, java to autoit com automation... but no luck.. someone post a simple code
  4. you can try mine, but only works with numbers... and if you want letters you can code the modifications your self.
  5. Oky now you can create a difination very easily!! most of the professonal will look and laugh at the coding but i coded as one off, so i used any random verable name, as i dont plan on EVER going back and updating this piece of code. Java version of this OCR is coming out shortly, here is a un-debuged semi-working version, all it needs is the serialise array part fixing. scroll down for images of the difinition maker. Enjoy. /** * This is a number ocr program that can be used to * take data from the window and put into machine readable writing format. * All cridits goes to Royal Miah, for making this wonderful piece of code * * @author Royal Miah * @version v1.0 OCT 2006 */ import java.awt.Color; import java.awt.*; public class OCR { // constructor private Robot robot; public int p = 0; public String RESULT_OF_OCR; public OCR() { try { robot = new Robot(); } catch (AWTException e) { } } public String convertColorToHexString(java.awt.Color c) { String str = Integer.toHexString( c.getRGB() & 0xFFFFFF ); return ("000000".substring( str.length() ) + str.toUpperCase() ); } public String xyscan(int y, int x) { Color c = robot.getPixelColor(x,y); String xy = convertColorToHexString(c); return xy; } //ocr method, here the use declars the top left X and Y // and the bottom right X and Y public String OCR(int ax, int ay, int dx, int dy) { int width = dx - ax; // works out how much the width is from top to bottom int length = dy - ay; // works out the length of the scan from lef tto right String[][] Character = new String[width][length]; int[] Diff = new int[width]; for (int xwidth = 0; xwidth < width -1; xwidth++) { for (int xlength =0; xlength < length -1; xlength++) { Character[xwidth][xlength] = xyscan(ax, ay); // ENTIRE AREA HAS BEEN SCANNED AND PUT INTO AN ARRAY if (Character[xwidth][xlength] == "000000") //serialising array { if (p==1) { p++; } int div = xwidth; int ps = xwidth - div; Diff[ps] = Diff[ps]+1; } } ay++; } ax = ay +1; ay = ay - length; // END of formal OCR code reminder is diffination // insert difination here for (int xwidth = 0; xwidth < width -1; xwidth++) { if ( Diff[xwidth+0] == 1 && Diff[xwidth+1] == 1 && Diff[xwidth+2] == 7) { RESULT_OF_OCR = "1"; } } return RESULT_OF_OCR; } } #cs // This difinition creator was created by ROYAL MIAH, all rights reserved OCT 2006 // If you wish to make any modification please do so, just keep my name // All cridits got to Royal Miah // Ntl_cable_guy (@T) hotmail.com #ce #include <GUIConstants.au3> $Form1 = GUICreate("NumCR Definition Creator by Royal Miah (c) 2006 v1.0", 757, 525, 269, 178) $CharName = GUICtrlCreateInput("", 560, 59, 161, 21) GUICtrlCreateLabel("Name of the character i.e. number", 559, 35, 165, 17) $DifRow = GUICtrlCreateCombo("1", 560, 106, 121, 21) GUICtrlSetData(-1,"2|3|4|5|6|7|8|9|10","11"); GUICtrlCreateLabel("What is the width of the character", 560, 86, 164, 17) $Define = GUICtrlCreateButton("Define", 560, 136, 81, 25, 0) $ASource = GUICtrlCreateEdit("", 48, 184, 665, 145) GUICtrlSetData($ASource, "") GUICtrlCreateLabel("Autoit Source", 48, 160, 68, 17) $Edit1 = GUICtrlCreateEdit("", 48, 360, 665, 129) GUICtrlCreateLabel("Java Source", 48, 336, 64, 17) $Edit2 = GUICtrlCreateEdit("", 32, 16, 481, 129, 0, 0) GUICtrlSetData($Edit2, "Instruction on how to use this program"&@CRLF&""&@CRLF&"Select the number of width of the character you want to create a difinition for"&@CRLF&"then type the name of the character i.e. "&Chr(34)&"1"&Chr(34)&" without "&Chr(34)&""&Chr(34)&" once you have done"&@CRLF&"that all you have to do next is enter the values of each black pixels of your"&@CRLF&"character manually, where it says #."&@CRLF&""&@CRLF&"Each black pixel per row.") GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Define $som = GUICtrlRead($DifRow) $somels = GUICtrlRead($CharName) $rox = _CreateDiffAu($som,$somels) $pox = _CreateDiffJava($som, $somels) GUICtrlSetData($ASource,$rox) GUICtrlSetData($Edit1,$pox) Case Else ;;;;;;; EndSelect WEnd Func _CreateDiffAu($rows, $charaname) $STRINGVERIABLE = "" For $xwidth = 0 To $rows -1 $STRINGVERIABLE &= " $row[$xwidth+"&$xwidth&"] = # And" Next $presult = "If "&StringTrimRight($STRINGVERIABLE, 4) $presult &= " Then $result &= """&$somels&""" EndIf" $result = $presult Return $result EndFunc Func _CreateDiffJava($rows, $charaname) $STRINGVERIABLE = "" For $xwidth = 0 To $rows -1 $STRINGVERIABLE &= " row[xwidth+"&$xwidth&"] == # &&" Next $presult = "If ("&StringTrimRight($STRINGVERIABLE, 2) $presult &= ") { result &= """&$somels&""" }" $result = $presult Return $result EndFunc Exit OCRdif.au3
  6. stalliont you are totally correct, The best way would be to work out the position of each pixel releating to the entire chareacter, but that would be slow. and AZU this will work on constantly changing background or image etc, long as the chareacter text does not change in colour. however you can add extra coding to recognise hue differences.
  7. func _msnsendtext($win, $msg) if not IsObj($win) then return 0 $win.SendText($msg) return 1 endfunc How does this method work, I want to send a text to a window that is currently open.
  8. I am back going to be working on this project part time, cant wait for uni to start then i can work on programming like before. and yeah its only searching for black pixels you need to change that. Please dont email me asking for help or PMing me, ask someone else on the forum, I am only going to be improving the script and cant help anyone else with their OCR needs. Going to add an YOUTUBE video to show how to run the exxample and how the code actually works, this should be done in few weeks time LOL to lazy to do it right now and going to make a better implementation of OCR diffination creator.
  9. Just like to say that desing looks like a pro-made software!! keep up the good work!!
  10. It said this person loves me dearly yet she has a boy friend.
  11. will you can do all the things in AUTOIT all you have to is change the output so that it can be displayed on a webserver, so now you have the power to make programs with WEB interface, i.e. instead of having GUI you can create a webpage that has the GUI and use that as the front end for your program, you can do so many things remotely.
  12. Thank you theguy0000!! I really love this, now i can code all the things that i always wanted haha not that i couldnt before but this is awesome!! 10/10 Just like to thank you once again.
  13. this bot is impresive now only if i could get it to chat on msn, hehe while you are away.
  14. well done from me too. Really impressed.
  15. can we add some Uk poviders thanks
×
×
  • Create New...