Jump to content

rocko

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by rocko

  1. Ok, so I'm smashing my head with autoit and tesseract and I have a problem. The code works and does what it needs to do on one environment but not on another. When running it on Windows Server 2012 (2 DELL monitors connected) it works, but when I used on my home environment, Windows 8 (2 TVs connected) it does not. Here is the code: #include <SimpleTesseract.au3> #include <ScreenCapture.au3> #include <Array.au3> #include <String.au3> GLOBAL $var1 GLOBAL $num1 GLOBAL $var2 GLOBAL $num2 GLOBAL $diff GLOBAL $x GLOBAL $z ;Tesseract Path for temp files (where you put the app) _TesseractTempPathSet("D:\AUTOIT") ;Get First Val Screenshot SplashImageOn ( "Test", "D:\AUTOIT\tst1.jpg" , 135 , 30 , 0 , 0, 1) sleep(200) _ScreenCapture_Capture("D:\AUTOIT\TEST1.jpg", 0, 0, 135, 30) sleep(1000) ;Get First Val SplashImageOn ( "Test", "D:\AUTOIT\TEST1.jpg" , 135 , 30 , 0 , 0, 1) sleep(200) $var1 = _TesseractScreenCapture(0, "", 0, 3, 0, 0, 135, 30, 0) sleep(200) ;Get Second Val Screenshot SplashImageOn ( "Test", "D:\AUTOIT\tst2.jpg" , 135 , 30 , 0 , 0, 1) sleep(200) _ScreenCapture_Capture("D:\AUTOIT\TEST2.jpg", 0, 0, 135, 30) sleep(1000) ;Get Second Val SplashImageOn ( "Test", "D:\AUTOIT\tst2.jpg" , 135 , 30 , 0 , 0, 1) sleep(200) $var2 = _TesseractScreenCapture(0, "", 0, 4, 0, 0, 135, 30, 0) sleep(200) ;Parse First Val $var1 = StringReplace($var1, ",", "") $num1 = Number($var1) ;Parse Second Val $var2 = StringReplace($var2, ",", "") $num2 = Number($var2) ;Calculate $diff = $num2 - $num1 ;Parse XP Number =========================== $x = StringLen($diff) $z = Int($x/3) if IsInt($x/$z) then if $z = 1 Then $diff = _StringInsert ($diff, ",", $x-3); under 1,000,000 XP else for $i = 1 to $z-1 $diff = _StringInsert ($diff, ",", $x-3*$i); under 1,000,000,000 XP Next endif else for $i = 1 to $z $diff = _StringInsert ($diff, ",", $x-3*$i); under 1,000,000,000,000 XP Next Endif ;End Of Parse XP Number ==================== ;Display Tooltip("First Image: " & $var1 & " Second Image: " & $var2 & " Difference: " & $diff, 500, 0) sleep(10000) Here are the needed files: http://www.filedropper.com/simpletesseract http://www.filedropper.com/tst1 http://www.filedropper.com/tst2 Please help if you have any idea. You should always set it up with 0 at the end. It always does something. If it "does" nothing when set with 0 at the end it means that the array is null. When you set it up with 1 at the end you will get that error which you stated. Also if you configured a path two files will be created. Random name having the following: 1. file .tiff with image on which tesseract performs OCR 2. file .txt with result after ocr was performed on image Here is an image if it is not clear: http://www.filedropper.com/explanation
  2. *I want the script to simply detect if any action is performed in a 2 minute interval. If actions ar performed i dont want it to do anything, if actions *aren't* performed i will write some instructions . Or is there a way to detect if the script stops runnning and to restart the script automatically?
  3. Hi, I'm new to AutoIt and i need some help. I want a script to be able to detect if an action is performed. By action i mean either a mouseclick or a key stroke. I want to do smth simple like : Function Detect { i = 0 while 1 do if (mouseclick) or (keystroke) then i = i + 1 endif wend sleep(120000) if i = 0 then ... endif else call(detect) } I want the script to simply detect if any action is performed in a 2 minute interval. If actions ar performed i dont want it to do anything, if actions are performed i will write some instructions . Thanks in advance
×
×
  • Create New...