Jump to content

longfields

Members
  • Posts

    11
  • Joined

  • Last visited

longfields's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. The problem I am experiencing is that the text replacement works fine for a while, and then I start to get a repetitive "I" sent as if it's from the keyboard. The following is my code, it is loading a text file at startup and using that to establish the array. The text file is 1077 lines long: #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <HotString.au3> Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 1) Global $aRetArray, $sFilePath = @ScriptDir & "\Test.txt" FileLoad() SetHotStrings() While 1 Sleep(100) WEnd Func FileLoad() _FileReadToArray($sFilePath, $aRetArray, Default , "¬") If @error = 1 Then MsgBox(0,"Error opening specified file","") ElseIf @error = 2 Then MsgBox(0,"Unable to split the file","") ElseIf @error = 3 Then MsgBox(0,"File lines have different numbers of fields","") ElseIf @error = 4 Then MsgBox(0,"No delimiters found","") EndIf _ArrayDisplay($aRetArray, "2D array - count", Default, 8) EndFunc ;==>FileLoad Func SetHotStrings() For $x = 1 to UBound($aRetArray) - 1 HotStringSet($aRetArray[$x][0],Expand) Next EndFunc ;==>SetHotStrings Func Expand($hotstring) Local $strlength = StringLen($hotstring) Send("{BACKSPACE " & $strlength & "}") For $x = 1 To UBound($aRetArray) - 1 If $aRetArray[$x][0] = $hotstring Then Send($aRetArray[$x][1]) ExitLoop EndIf Next EndFunc ;==>Expand
  2. Hello, I'd appreciate some help with this, I can't figure out how to make it work. I have installed Python version 3.2.3. In the 'pyexample.au3' script, I have changed: PyAutoit_OpenDll("python31") to read: PyAutoit_OpenDll("python32") and I have changed: PyAutoit_Main(StringSplit("./module1.py", " ")) to include the name of the Python file I want to convert, instead of 'module1.py'. I have then run the script, it completes without returning an error, but nothing happens. I've tried it with 'turtle.py' as someone mentions this above, but still no joy. This code is _way_ beyond my programming capabilities, and my approach is probably very simplistic. I can't understand how the UDF works. If someone could show me how to simply use this to convert a .py file to AutoIT code, I'd be very grateful.
  3. Many thanks for this update to SimpleTesseract - at last, this is delivering reasonable accuracy! Please note that: $iReadClean = StringStripWS($iRead, 2) Will remove the trailing carriage returns and leave the rest of the text intact.
  4. seangriffin, Many thanks for your work on this - I'm starting to get some results. A couple of observations: 1. Accuracy of OCR significantly deteriorates if you scan a very small part of the screen. I expect that this is an issue with Tesseract rather than with the UDF. 2. If you're scanning an area of the screen and then change the scale, a different part of the screen is then scanned. This doesn't seem very logical, but there may be a good reason for it. 3. It looks like there are things you can do to train tesseract - I haven't gone into this in detail yet. This looks really promising - thanks again.
  5. Hey, yeah, looks like that should work. Will try it shortly. Many, many thanks for all your help - you're a star!!
  6. I'd prefer both, but I could manage with position only. Thanks for your help!
  7. OK, I'm sure you mean to help, but like I said, I read the helpfile. In describing this parameter it says: but there are no practical examples. I have been trying it in different ways, but I must be misunderstanding how the syntax works. Anyone got a working example? Thanks.
  8. Hello, Can anyone advise on the correct syntax for this special window description? I have tried it various ways, for example: WinWaitActive("[200\ 200\ 100\ 100]", "") but nothing seems to work. I can't find any examples either in the help file or on this forum. Thanks in advance for your assistance.
  9. It doesn't seem to work. Syntax of the call: $gamwind = WinGetTitle("[ACTIVE]", "") $newdata = _TextractCapture($gamwind, "", "", "", 1, 1, 1) I get the following error message: C:\Program Files\AutoIt3\Include\Textract.au3 (111) : ==> The requested action with this object has failed.: $TextractOCX.ReadWindow(Number($hwnd)) $TextractOCX.ReadWindow(Number($hwnd))^ ERROR Any thoughts?
  10. This is a very welcome addition - thanks very much. However, its a pain that you can only extract text from a rectangle within a window if you have a control ID. Some proprietary programs don't provide control IDs and so you have to scrape the whole window. That's much better than nothing, but I'd still like to be able to target a particular area. Is there any way to change this? Once again, many thanks!
×
×
  • Create New...