Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2024 in all areas

  1. Hi @1stPK I made it work with this: #include <GUIConstantsEx.au3> #include <InetConstants.au3> #include <StringConstants.au3> #include "./Include/HTMLParser.au3" Opt("GUIOnEventMode", 1) #cs # taken from https://techblog.willshouse.com/2012/01/03/most-common-user-agents/ # Helps to avoid bot detection #ce HttpSetUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36') $sDate = "27-10-2024" $sHTML = FetchData($sDate) If @error <> 0 Then ConsoleWriteError(StringFormat("Failed to fetch data for ""%s""\n", $sDate)) Exit 1 EndIf ; Fix issue with missing space between multiple html element attributes $sHTML = StringRegExpReplace($sHTML, '(="[^"]+")([^ \/>;,])', "$1 $2") ; Fix issue with multiple lt $sHTML = StringRegExpReplace($sHTML, '<{2,}', "<") $tHTML = ParseData($sHTML) If @error <> 0 Then ConsoleWriteError(StringFormat("Failed to parse data for ""%s""\n", $sDate)) Exit 1 EndIf $pNode = _HTMLParser_GetFirstStartTag($tHTML.head) If @error <> 0 Then ConsoleWriteError(StringFormat("Failed to find first tag in data for ""%s""\n", $sDate)) Exit 1 EndIf $hWnd = GUICreate("kết quả xổ số", 700, 320) GUISetOnEvent($GUI_EVENT_CLOSE, "GuiClose", $hWnd) $label1 = GUICtrlCreateLabel("Giải đặc biệt: đang tải...", 10, 10, 680, 20) $label2 = GUICtrlCreateLabel("Giải nhất: đang tải...", 10, 30, 680, 20) $label3 = GUICtrlCreateLabel("Giải nhì: đang tải...", 10, 50, 680, 20) $label4 = GUICtrlCreateLabel("Giải ba: đang tải...", 10, 70, 680, 20) $label5 = GUICtrlCreateLabel("Giải tư: đang tải...", 10, 90, 680, 20) $label6 = GUICtrlCreateLabel("Giải năm: đang tải...", 10, 110, 680, 20) $label7 = GUICtrlCreateLabel("Giải sáu: đang tải...", 10, 130, 680, 20) $label8 = GUICtrlCreateLabel("Giải bảy: đang tải...", 10, 150, 680, 20) GUISetState(@SW_SHOW, $hWnd) $sText = ExtractText($pNode, "giaidb") GUICtrlSetData($label1, "Giải đặc biệt: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai1") GUICtrlSetData($label2, "Giải nhất: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai2") GUICtrlSetData($label3, "Giải nhì: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai3") GUICtrlSetData($label4, "Giải ba: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai4") GUICtrlSetData($label5, "Giải tư: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai5") GUICtrlSetData($label6, "Giải năm: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai6") GUICtrlSetData($label7, "Giải sáu: " & (@error <> 0 ? "Lỗi" : $sText)) $sText = ExtractText($pNode, "giai7") GUICtrlSetData($label8, "Giải bảy: " & (@error <> 0 ? "Lỗi" : $sText)) While 1 Sleep(10) Wend Func FetchData($sDate) Local $sURL = StringFormat("https://www.minhngoc.net.vn/ket-qua-xo-so/mien-bac/%s.html", $sDate) Local $dData = InetRead($sURL, BitAND($INET_BINARYTRANSFER, $INET_FORCEBYPASS)) If @error <> 0 Then ConsoleWriteError(StringFormat("Failed to fetch data for ""%s""\n", $sURL)) Return SetError(1) EndIf Return BinaryToString($dData) EndFunc Func ParseData($sHTML) Local $tTokenList = _HTMLParser($sHTML) If @error <> 0 Then Return SetError(1) ; Check if all HTML was parsed If @extended < StringLen($sHTML) Then Return SetError(2) Return $tTokenList EndFunc Func ExtractText($pNode, $sClassName) Local $aNodes = _HTMLParser_GetElementsByClassName($sClassName, $pNode) If @error <> 0 Then Return SetError(1) $pNode = $aNodes[0] Local $aText = _HTMLParser_Element_GetText($pNode) Local $sText = "" For $pText In $aText $tNode = __doublyLinkedList_Node($pText) $sText &= " " & StringRegExpReplace(__HTMLParser_GetString($tNode.data), "^\s+|\s+$", "") Next Return $sText EndFunc Func GuiClose() Exit EndFunc I used my html parser for this, but a better parser solution could also work, or go back to regex I used google translate for the Vietnamese strings i added, so they might be wrong I'll also attach my solution with includes to this post. Hope it helps! 212413.zip
    2 points
  2. ioa747

    OCR from a small area

    difficult pattern for OCR program but it has an easy pattern i played with it a bit here are the results #AutoIt3Wrapper_UseX64=N ;Update to Version: 2.0 #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <Array.au3> #include <File.au3> #include <Misc.au3> Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info ; Initialization DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", "int", -4) ; -4=PerMonitorAwareV2 Global $hDLL = DllOpen("user32.dll") HotKeySet("{END}", "_Main") ; * <- selection of outer area with margin HotKeySet("{ESC}", "_Exit") ;************************************************ While 1 Sleep(100) WEnd ;************************************************ ;-------------------------------------------------------------------------------------------------------------------------------- Func _Exit() DllClose($hDLL) Exit EndFunc ;==>_Exit ;-------------------------------------------------------------------------------------------------------------------------------- Func _Main() ; Main Program ; $aArea = [18, 181, 182, 434] Local $aArea = SelectArea() ; Define the area to scan Local $hColor = 0x00FF00 ; Capture the color map for the specified area Local $aColorMap = CaptureAreaColorMap($aArea) ;_ArrayDisplay($aColorMap) Local $Result = FindNumberUsingColorMap($aColorMap, $hColor) MsgBox($MB_SYSTEMMODAL, "$Result", $Result) EndFunc ;==>_Main ;-------------------------------------------------------------------------------------------------------------------------------- Func CaptureAreaColorMap($aArea) ; Initialize GDI+ to work with bitmaps _GDIPlus_Startup() ; Capture the screen area as a bitmap Local $hBitmap = _ScreenCapture_Capture("", $aArea[0], $aArea[1], $aArea[2], $aArea[3]) ; Convert the captured bitmap to a GDI+ bitmap Local $hGDIPlusBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) ; Get the width and height of the captured area Local $width = $aArea[2] - $aArea[0] Local $height = $aArea[3] - $aArea[1] ; Create an array to store color values Local $aColorMap[$width][$height] ; Loop through each pixel in the bitmap and retrieve its color For $y = 0 To $height - 1 For $x = 0 To $width - 1 ; Get the pixel color from the bitmap in ARGB format Local $argbColor = _GDIPlus_BitmapGetPixel($hGDIPlusBitmap, $x, $y) ; Convert ARGB to BGR for comparison (ignore the alpha channel) Local $bgrColor = BitAND($argbColor, 0x00FFFFFF) $aColorMap[$x][$y] = $bgrColor Next Next ; Cleanup resources _GDIPlus_BitmapDispose($hGDIPlusBitmap) _WinAPI_DeleteObject($hBitmap) _GDIPlus_Shutdown() Return $aColorMap EndFunc ;==>CaptureAreaColorMap ;-------------------------------------------------------------------------------------------------------------------------------- Func FindNumberUsingColorMap($aColorMap, $hColor = 0x00FF00) Local $width = UBound($aColorMap, 1) Local $height = UBound($aColorMap, 2) Local $firstRow = -1, $lastRow = -1, $firstCol = -1, $lastCol = -1, $blockWidth = 0 ; Scan for the first and last rows and columns with green pixels For $y = 0 To $height - 1 For $x = 0 To $width - 1 If $aColorMap[$x][$y] = $hColor Then If $firstRow = -1 Then $firstRow = $y $lastRow = $y If $firstCol = -1 Or $x < $firstCol Then $firstCol = $x If $lastCol = -1 Or $x > $lastCol Then $lastCol = $x EndIf Next Next If $firstRow = -1 Or $lastRow = -1 Or $firstCol = -1 Or $lastCol = -1 Then MsgBox($MB_SYSTEMMODAL, "LineNumber:" & @ScriptLineNumber, "No color found" & @TAB & @TAB) Exit EndIf ; Calculate block size for one digit For $x = $firstCol To $width - 1 For $y = $firstRow To $height - 1 If $aColorMap[$x][$y] = $hColor Then For $w = $x To $width - 1 If $aColorMap[$w][$y] = $hColor Then $blockWidth += 1 Else ExitLoop 3 EndIf Next EndIf Next Next $blockSize = $blockWidth / 2 ; Adjust based on actual digit width Local $numberWidth = 14 * $blockSize ; Adjust based on number of columns per digit Local $numberSpace = 2 * $blockSize ; Space between digits Local $numberStart = $firstCol Local $aNum[11][3] ; Define boundaries for each number position For $i = 1 To 10 $aNum[$i][0] = $numberStart $aNum[$i][1] = $numberStart + $numberWidth If $numberStart + $numberWidth + $numberSpace > $lastCol Then ExitLoop $numberStart += $numberWidth + $numberSpace $aNum[0][0] = $i + 1 Next Local $sNumber ; Generate patterns for each found number For $i = 1 To $aNum[0][0] Local $sPattern = "" For $y = $firstRow To $lastRow For $x = $aNum[$i][0] To $aNum[$i][1] - 1 If $aColorMap[$x][$y] = $hColor Then $sPattern &= "1" Else $sPattern &= "." EndIf Next $sPattern &= @CRLF Next $sNumber &= _GetNumber($sPattern) Next ; each number Display is a matrix of 14x20 Vpoint ; each Vpoint is a 3x3 pixel ; each number Display is 42x60 pixel ConsoleWrite("Display_boundaries firstRow:" & $firstRow & " lastRow:" & $lastRow & " firstCol:" & $firstCol & " lastCol:" & $lastCol & @CRLF) Return $sNumber EndFunc ;==>FindNumberUsingColorMap ;-------------------------------------------------------------------------------------------------------------------------------- Func _GetNumber($sPattern) ConsoleWrite("############### $sPattern ################" & @CRLF & $sPattern & @CRLF) Local $aNumber[10] ; Define simplified patterns for each digit $aNumber[0] = "" ; Pattern for '0' $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= "111111.....................111111...111111" & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= "111111............111111............111111" & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= "111111...111111.....................111111" & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= "111111..............................111111" & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........................................." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[0] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] = "" ; Pattern for '1' $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........111111...111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= "..................111111.................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........................................." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[1] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] = "" ; Pattern for '2' $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........111111...111111...111111........." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= "111111..............................111111" & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= "....................................111111" & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= "..................111111...111111........." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........111111..........................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= "111111...................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= ".........................................." & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[2] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[3] = "" ; Pattern for '3' $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= "..................111111...111111........." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= "....................................111111" & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= "111111..............................111111" & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........................................." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[3] &= ".........111111...111111...111111........." & @CRLF $aNumber[4] = "" ; Pattern for '4' $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= "..................111111...111111........." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........111111............111111........." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= "111111.....................111111........." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= ".........................................." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[4] &= "...........................111111........." & @CRLF $aNumber[5] = "" ; Pattern for '5' $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= "111111...................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= "111111...111111...111111...111111........." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= "....................................111111" & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= "111111..............................111111" & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........................................." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[5] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] = "" ; Pattern for '6' $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= "..................111111...111111........." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........111111..........................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= "111111...................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= "111111...111111...111111...111111........." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= "111111..............................111111" & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........................................." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[6] &= ".........111111...111111...111111........." & @CRLF $aNumber[7] = "" ; Pattern for '7' $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= "111111...111111...111111...111111...111111" & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= "....................................111111" & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= "...........................111111........." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= "..................111111.................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........................................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[7] &= ".........111111..........................." & @CRLF $aNumber[8] = "" ; Pattern for '8' $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= "111111..............................111111" & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........................................." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[8] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] = "" ; Pattern for '9' $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........111111...111111...111111........." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= "111111..............................111111" & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........111111...111111...111111...111111" & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= "....................................111111" & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= "...........................111111........." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........................................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF $aNumber[9] &= ".........111111...111111.................." & @CRLF Switch $sPattern Case $aNumber[0] Return 0 Case $aNumber[1] Return 1 Case $aNumber[2] Return 2 Case $aNumber[3] Return 3 Case $aNumber[4] Return 4 Case $aNumber[5] Return 5 Case $aNumber[6] Return 6 Case $aNumber[7] Return 7 Case $aNumber[8] Return 8 Case $aNumber[9] Return 9 Case Else Return SetError(1, 0, "") EndSwitch EndFunc ;==>_GetNumber ;-------------------------------------------------------------------------------------------------------------------------------- Func SelectArea() ; SelectArea Local $aRecPos[4], $aMPos[2], $tPos ;, $aTipPos[4], $iX, $iY Local $iDeskWidth, $iDeskHeight, $iDeskLeft, $iDeskTop Local $sDevice, $hMonitor, $sCurDevice, $aData, $Status = 0 ; make Capture gui $hGUICapture = GUICreate("Capture_gui", 1, 1, 1, 1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) GUISetBkColor("0xFFFF00", $hGUICapture) ; $COLOR_YELLOW WinSetTrans($hGUICapture, "", 50) ; make mouse block gui $block_gui = GUICreate("block_gui", 1, 1, 1, 1, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) WinSetTrans($block_gui, "", 1) GUISetState(@SW_SHOW, $block_gui) GUISetCursor($MCID_CROSS, 1, $block_gui) Sleep(200) Local $iMaxLoop = 1200, $iCntLoop = 0 While Sleep(10) $iCntLoop += 1 If $iCntLoop = $iMaxLoop Then ExitLoop ; get mouse coordinates $tPos = _WinAPI_GetMousePos() $aMPos[0] = DllStructGetData($tPos, 1) $aMPos[1] = DllStructGetData($tPos, 2) ; get $hMonitor from previously defined Mouse coordinates $hMonitor = _WinAPI_MonitorFromPoint($tPos) ; get monitor $aData appropriate for previously defined coordinates $aData = _WinAPI_GetMonitorInfo($hMonitor) If Not @error Then $sDevice = $aData[3] $iDeskLeft = DllStructGetData($aData[0], 1) $iDeskTop = DllStructGetData($aData[0], 2) $iDeskWidth = DllStructGetData($aData[0], 3) $iDeskHeight = DllStructGetData($aData[0], 4) EndIf ;move the $block_gui to active monitor If $sCurDevice <> $sDevice Then $sCurDevice = $sDevice ;ConsoleWrite("- $sCurDevice=" & $sCurDevice & @CRLF) WinMove($block_gui, "", $iDeskLeft, $iDeskTop, $iDeskWidth, $iDeskHeight) EndIf ; whait Left_mouse_button _IsPressed If _IsPressed("01", $hDLL) Then $Status = 1 $aMPos = MouseGetPos() $aRecPos[0] = $aMPos[0] $aRecPos[1] = $aMPos[1] ; Wait until key is released. While _IsPressed("01", $hDLL) Sleep(50) $aMPos = MouseGetPos() $aRecPos[2] = $aMPos[0] $aRecPos[3] = $aMPos[1] ; show Capture gui GUISetState(@SW_SHOW, $hGUICapture) WinMove($hGUICapture, "", $aRecPos[0], $aRecPos[1], $aRecPos[2] - $aRecPos[0], $aRecPos[3] - $aRecPos[1]) WEnd ElseIf _IsPressed("1B", $hDLL) Then ;1B=ESC key - emergency exit GUIDelete($hGUICapture) GUIDelete($block_gui) Return SetError(1, 1, 0) EndIf If $Status = 1 Then ExitLoop WEnd GUIDelete($hGUICapture) GUIDelete($block_gui) ConsoleWrite("outer area: " &$aRecPos[0] & ";" & $aRecPos[1] & ";" & $aRecPos[2] + $aRecPos[0] & ";" & $aRecPos[3] + $aRecPos[1] & @CRLF) Return $aRecPos EndFunc ;==>SelectArea ;--------------------------------------------------------------------------------------------------------------------------------
    1 point
  3. Hi @genius257 👋 , the fix was to add these two flags (constants) to InetRead, right? Local $dData = InetRead($sURL, BitAND($INET_BINARYTRANSFER, $INET_FORCEBYPASS)) Good work, as usually 😀 . Best regards Sven
    1 point
  4. Hello @pixelsearch I hope you're doing well. Would this be a useful change to your script for displaying an Array of Arrays? Func _GenerateCode() Local $sClipTxt, $sSubject, $sPattern $sSubject = _TextSplit(GUICtrlRead($ebTest), "$sSubject") ; Prepare subject text $sPattern = _TextSplit(GUICtrlRead($ebRegExp), "$sPattern") ; Prepare search pattern ; Check if the subject or pattern is empty If $sSubject = "" Or $sPattern = "" Then MsgBox(0, "Generating code", "Error: Match Text or Search Pattern is empty", 0, $hGUI) Return EndIf ; Generate code for handling array of arrays (Mode 4) If $nMode = 4 Then $sClipTxt = "#include <Array.au3>" & @CRLF & @CRLF & _ "Local $sSubject, $sPattern, $aArray" & @CRLF & @CRLF & _ "$sSubject = " & $sSubject & @CRLF & @CRLF & _ "$sPattern = " & $sPattern & @CRLF & @CRLF & _ "$aArray = StringRegExp($sSubject, $sPattern, 4)" & @CRLF & _ "If @error Then" & @CRLF & _ " MsgBox(0, 'Error', 'No matches found or invalid pattern')" & @CRLF & _ " Exit" & @CRLF & _ "EndIf" & @CRLF & @CRLF & _ "; Loop through the array of arrays" & @CRLF & _ "For $i = 0 To UBound($aArray) - 1" & @CRLF & _ " Local $aMatch = $aArray[$i]" & @CRLF & _ " ConsoleWrite('Match ' & ($i + 1) & @CRLF)" & @CRLF & _ " ConsoleWrite('Full Match: ' & $aMatch[0] & @CRLF)" & @CRLF & _ " ConsoleWrite('Group 1: ' & $aMatch[1] & @CRLF)" & @CRLF & _ " ConsoleWrite('Group 2: ' & $aMatch[2] & @CRLF & @CRLF)" & @CRLF & _ "Next" & @CRLF Else ; Generate standard code for modes other than 4 $sClipTxt = "Local $sSubject, $sPattern, $aArray" & @CRLF & @CRLF & _ "$sSubject = " & $sSubject & @CRLF & @CRLF & _ "$sPattern = " & $sPattern & @CRLF & @CRLF & _ "$aArray = StringRegExp($sSubject, $sPattern, " & $nMode & ")" & @CRLF & _ "If @error Then" & @CRLF & _ " MsgBox(0, 'Error', 'No matches found or invalid pattern')" & @CRLF & _ " Exit" & @CRLF & _ "EndIf" & @CRLF & _ "_ArrayDisplay($aArray)" EndIf ; Copy generated code to clipboard ClipPut($sClipTxt) MsgBox(0, "Code (copied to Clipboard)", ClipGet(), 0, $hGUI) EndFunc ;==>_GenerateCode Example output code: #include <Array.au3> Local $sSubject, $sPattern, $aArray $sSubject = 'name1@gmail.com, name2@yahoo.com' $sPattern = '(\w+)@(\w+\.\w+)' $aArray = StringRegExp($sSubject, $sPattern, 4) If @error Then MsgBox(0, 'Error', 'No matches found or invalid pattern') Exit EndIf ; Loop through the array of arrays For $i = 0 To UBound($aArray) - 1 Local $aMatch = $aArray[$i] ConsoleWrite('Match ' & ($i + 1) & @CRLF) ConsoleWrite('Full Match: ' & $aMatch[0] & @CRLF) ConsoleWrite('Group 1: ' & $aMatch[1] & @CRLF) ConsoleWrite('Group 2: ' & $aMatch[2] & @CRLF & @CRLF) Next Console output: Match 1 Full Match: name1@gmail.com Group 1: name1 Group 2: gmail.com Match 2 Full Match: name2@yahoo.com Group 1: name2 Group 2: yahoo.com Thank you for a great tool. taurus905
    1 point
  5. Version 1.6.1 has just been released! The function snippet, now uses "func" instead of "fun" for the string prefix. Variables declared via for loops are now recognized by the extension. include statements that fail to resolve, should no longer have links added to them. Sorry for the slow release. Personal things, combined with my vscode and docker that keeps crashing due to running out of memory, have delayed this release by at least a month. 😕 Anyway, i am currently looking into: adding errors for things like include statements that fail to resolve. improving the function signature helper (currently it disappears if the parser fails on that line, like when adding a comma within the parentheses, but there is nothing between the comma and the closing parenthesis) adding setting for omitting included functions and variables with the "__" prefix from the completion suggestions.
    1 point
  6. Hi I don't know if this is the right place for this but I thought it might come in useful to someone and I couldn't find it while I was searching for posts that address it. This: Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1) Will automatically get rounded corners in Windows 11... But this: Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1, $WS_POPUP) Will not. I usually like to ditch the windows title bar and replace it with my own, so it was annoying, that on Windows 11, my stuff didn't look the part. The trick is to use DwmSetWindowAttribute to set DWMWA_WINDOW_CORNER_PREFERENCE (33) to DWMWCP_ROUND (2) as explained here: Apply rounded corners in desktop apps for Windows 11 I modified the function in WinAPIGdi.au3 to accept 33 as a valid parameter and used the function from there: Func _WinAPI_DwmSetWindowAttribute($hWnd, $iAttribute, $iData) Switch $iAttribute Case 2, 3, 4, 6, 7, 8, 10, 11, 12, 33 Case Else Return SetError(1, 0, 0) EndSwitch Local $aCall = DllCall('dwmapi.dll', 'long', 'DwmSetWindowAttribute', 'hwnd', $hWnd, 'dword', $iAttribute, _ 'dword*', $iData, 'dword', 4) If @error Then Return SetError(@error, @extended, 0) If $aCall[0] Then Return SetError(10, $aCall[0], 0) Return 1 EndFunc ;==>_WinAPI_DwmSetWindowAttribute Example: #include <WinAPIGdi.au3> #include <GUIConstantsEx.au3> #include <Windowsconstants.au3> Global $exampleGUI = GUICreate("Rounded corners", 400, 300, -1, -1, $WS_POPUP) _WinAPI_DwmSetWindowAttribute($exampleGUI,33,2) Local $label = GUICtrlCreateLabel(" This is an example.", 50, 150,200, 50) GUISetState(@SW_SHOW, $exampleGUI) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd
    1 point
  7. Blaxxun

    Tesseract Simple Example

    That URL is.... exactly from the Github page you refer to. https://github.com/tesseract-ocr/tesseract/wiki/Downloads Under "3rd party Windows exe's/installer" The URL is from a German Univercity i guess. I tested it with your Autoit script but changed the Filepath to the install path. Works perfectly. Thanks for that.
    1 point
×
×
  • Create New...