-
Posts
21 -
Joined
-
Last visited
Everything posted by akurakkauaaa
-
update, new tab: Include Helper (Include Optimizer). example: Instruction. If not work: 1. run: "Scite Helper" 2. open tab: "Include" 3. used button: 1, 2, 3 4. ;Instruction. ;If not work: ;1. run: "Scite Helper" ;2. open tab: "Include" ;3. used button: 1, 2, 3 ;4. :) Global Const $GUI_AVISTOP = 0 Global Const $GUI_AVISTART = 1 #include "RichEditConstants.au3" #include "Word.au3" Global Const $GUI_AVICLOSE = 2 $Form1 = GUICreate("test") $StatusBar1 = _GUICtrlStatusBar_Create($Form1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If _IsPressed("51") then Exit ;q Sleep(20) WEnd func _IsPressed($test) return false endfunc
-
maybe u have wrong format. create picture: #include <ScreenCapture.au3> _ScreenCapture_Capture(@ScriptDir & "testscren.bmp", 100, 100, 120 , 120) find: #include <myImageSearch.au3> HotKeySet("{F10}", "exittheprog") Global $Number0 Global $Error Global $ImageSearch = @ScriptDir & "testscren.bmp" While 1 $Number0 = myImageSearch_Desktop($ImageSearch) $Error = @error If $Error Then ConsoleWrite("sorry image not exist. Error nr:" & $Error & @CRLF) If IsArray($Number0) Then ConsoleWrite("Pos: " & $Number0[0] & " : " & $Number0[1] & @CRLF) MouseMove($Number0[0], $Number0[1]) EndIf Sleep(1000) WEnd Func exittheprog() Exit EndFunc ;==>exittheprog
-
translator: #include <inet.au3> Global $language = '' ;$language &= "auto Detect Language|" $language &= "af Afrikaans|" $language &= "sq Albanian|" $language &= "ar Arabic|" $language &= "hy Armenian|" $language &= "az Azeri|" $language &= "eu Basque|" $language &= "bn Bengali|" $language &= "be Belarusian|" $language &= "bg Bulgarian|" $language &= "zh CN Chinese|" $language &= "hr Croatian|" $language &= "cs Czech|" $language &= "da Danish|" $language &= "en English|" $language &= "et Estonian|" $language &= "tl Filipino|" $language &= "fi Finnish|" $language &= "fr French|" $language &= "gl Galician|" $language &= "de German|" $language &= "el Greek|" $language &= "ka Georgian|" $language &= "gu Gujarati|" $language &= "iw Hebrew|" $language &= "hi Hindi|" $language &= "hu Hungarian|" $language &= "id Indonesian|" $language &= "it Italian|" $language &= "ga Irish|" $language &= "is Icelandic|" $language &= "ja Japanese|" $language &= "yi Yiddish|" $language &= "kn Kannada|" $language &= "ca Catalan|" $language &= "ko Korean|" $language &= "ht Haitian Creole|" $language &= "lt Lithuanian|" $language &= "la Latin|" $language &= "lv Latvian|" $language &= "mk Macedonian|" $language &= "ms Malay|" $language &= "mt Maltese|" $language &= "nl Netherlands|" $language &= "no Norwegian|" $language &= "fa Persian|" $language &= "pl Polish|" $language &= "pt Portuguese|" $language &= "ru Russian|" $language &= "ro Romanian|" $language &= "sr Serbian|" $language &= "sk Slovak|" $language &= "sl Slovenian|" $language &= "sw Swahili|" $language &= "sv Swedish|" $language &= "es Spanish|" $language &= "th Thai|" $language &= "ta Tamil|" $language &= "te Telugu|" $language &= "tr Turkish|" $language &= "uk Ukrainian|" $language &= "ur Urdu|" $language &= "cy Welsh|" $language &= "vi Vietnamese" Global $string = "you like bananas?" Global $trans Global $arrayLang = StringSplit($language, "|", 3) For $i = 0 To UBound($arrayLang) - 1 $trans = myGoogleTranslate($string, "en", $arrayLang[$i], "en") ConsoleWrite($arrayLang[$i] & ' = ' & $trans & @CRLF) Next ConsoleWrite(@CRLF) ConsoleWrite(myGoogleTranslate("kociak", "PL", "EN", "EN") & @CRLF) Exit #region Google Translate Func myGoogleTranslate($sText, $sTo = "en", $sFrom = "pl", $sCode = "en") $sTo = StringRegExpReplace($sTo, '(\w+)|(.*)', '\1') $sFrom = StringRegExpReplace($sFrom, '(\w+)|(.*)', '\1') $sCode = StringRegExpReplace($sCode, '(\w+)|(.*)', '\1') If (Not $sText) Or (Not $sTo) Or (Not $sFrom) Or (Not $sCode) Then Return SetError(1, 0, 0) If StringRegExpReplace($sText, '([a-zA-Z0-9]+)', '') Then $sText = StringToBinary($sText) $sText = StringTrimLeft($sText, 2) $sText = StringRegExpReplace($sText, '(.{2})', '%\1') EndIf Local $GoogleURL = 'http://translate.google.com/translate_a/t?client=t&text=' & $sText & '&hl=' & $sCode & '&sl=' & $sTo & '&tl=' & $sFrom & '&multires=1&ssel=0&tsel=0&sc=1' ;ConsoleWrite($GoogleURL & @CRLF) Local $sSource = _INetGetSource($GoogleURL) ;If @error Then ; Local $TempFileDir = @ScriptDir & "\t.js" ; Local $hDownload = InetGet($GoogleURL, $TempFileDir, 1, 1) ; Local $begin = TimerInit() ; Do ; Until (InetGetInfo($hDownload, 2)) Or (TimerDiff($begin) >= 4000) ; InetClose($hDownload) ; $sSource = FileRead($TempFileDir) ; FileDelete($TempFileDir) ;EndIf ;ConsoleWrite($sSource & @CRLF) If (Not $sSource) Then Return SetError(2, 0, 0) Local $s_saveSource = $sSource Local $sPattern = '],,"' & $sTo & '",,[' $sSource = StringLeft($sSource, StringInStr($sSource, $sPattern)) If $sSource Then ; jesli to cale zdanie $sSource = StringRegExpReplace($sSource, '[[]["](.*?)["][,]["]|(.*?)', '\1') $sSource = myGoogleTranslate_Hex_to_ChrW($sSource) Else ; jesli to pojedynczy wyraz $sPattern = '],"' & $sTo & '",,[' $sSource = StringLeft($s_saveSource, StringInStr($s_saveSource, $sPattern)) $sSource = StringRegExpReplace($sSource, '[,][[][[]?(.*?)[[](.*?)[]]|(.*?)', '\1\2') $sSource = myGoogleTranslate_Hex_to_ChrW($sSource) $sSource = StringReplace($sSource, '","', @CRLF & @TAB) $sSource = StringReplace($sSource, '"', @CRLF) EndIf $sSource = StringReplace($sSource, '\"', '"') $sSource = StringFormat($sSource) If (Not $sSource) Then Return SetError(3, 0, 0) Return $sSource EndFunc ;==>myGoogleTranslate Func myGoogleTranslate_Hex_to_ChrW($sText) Local $searchHex, $aText Do $searchHex = StringInStr($sText, '\u') If $searchHex Then $aText = StringRegExp($sText, '(.{' & ($searchHex - 1) & '})(.{2})(.{4})(.*)', 3) ;_ArrayDisplay($aText) If IsArray($aText) Then $sText = $aText[0] & ChrW(Dec($aText[2])) & $aText[3] EndIf EndIf Until $searchHex <= 0 Return $sText EndFunc ;==>myGoogleTranslate_Hex_to_ChrW #endregion Google Translate
-
my version
-
of course my is slow. but has more option.
-
description: search image in desktop / picture. not require dll. include: myImageSearch.au3 #include-once #include <ScreenCapture.au3> ; #INDEX# ======================================================================================================================= ; Title .........: myImageSearch ; AutoIt Version: 3.3.6.1 ; Script Version: 1.0 (31.10.2011) ; Language: English, Polski. ; Description: Search image. ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; myImageSearch_Desktop ; myImageSearch_Picture ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: myImageSearch_Desktop ; Description ...: Znajdz obrazek na pulpicie. ; Syntax.........: myImageSearch_Desktop($Image, $x = 0, $y = 0, $iIW = @DesktopWidth, $iIH = @DesktopHeight, $TransColorRGB = '', $OnlyFirst = True) ; Parameters ....: $Image - znajdz obrazek: adres do szuaknego obrazka, lub bitmapa (format .bmp 24-bit) ; $x - lewe koordynaty [Default is 0 (pierwszy pixel).] ; $y - gorne koordynaty. [Default is 0 (pierwszy pixel).] ; $iIW - prawe koordynaty. [Default is @DesktopWidth.] ; $iIH - dolne koordynaty. [Default is @DesktopHeight.] ; $TransColorRGB - Kolor przezroczystosci / Ignorowany kolor. Musi byc string i format RGB. a.g: "0xFFFFFF".[Default is "".] ; $OnlyFirst - [Default is True.] ; |True = Success: Zwraca tablice 2-elementowa z koordynatami. ; $array[0] = x koordynaty ; $array[1] = y koordynaty ; |False = Success: Zwraca 2D tablice z koordynatami. ; $array[0][0] = 1st x coordinate ; $array[0][1] = 1st y coordinate ; $array[1][0] = 2nd x coordinate ; $array[1][1] = 2nd y coordinate ; $array[3][0] = 3rd x coordinate ; $array[3][1] = 3rd y coordinate ; $array[n][0] = nth x coordinate ; $array[n][1] = nth y coordinate ; ; UWAGA: Jesli uzyjesz "False" to max obszar przeszukiwania moze wynosic 800x600 pixeli, lub ekwiwalent max 480.000 pixeli!!! ; Nie wiecej. ; ; Return values . : On Success - Zwrot tablica 2-elementowa z koordynatami lub 2D tablica z koordynatami. ; On Failure - @Error = 1 - Sciezka do pliku jest bledna, lub bitmapa/obrazek jest bledna. ; @Error = 2 - Obrazka nie znaleziono (na pulpicie). ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: myImageSearch_Desktop ; Description ...: Image search in desktop. ; Syntax.........: myImageSearch_Desktop($Image, $x = 0, $y = 0, $iIW = @DesktopWidth, $iIH = @DesktopHeight, $TransColorRGB = '', $OnlyFirst = True) ; Parameters ....: $Image - search image: string adress for file, or bitmat (format .bmp 24-bit) ; $x - left coordinate. [Default is 0 (first pixel).] ; $y - top coordinate. [Default is 0 (first pixel).] ; $iIW - right coordinate. [Default is @DesktopWidth.] ; $iIH - bottom coordinate. [Default is @DesktopHeight.] ; $TransColorRGB - Color transparancy / Ignore color. Must be string and format RGB. a.g: "0xFFFFFF".[Default is "".] ; $OnlyFirst - [Default is True.] ; |True = Success: Returns a two-element array coordinates. ; $array[0] = x coordinate ; $array[1] = y coordinate ; |False = Success: Returns a 2D array coordinates. ; $array[0][0] = 1st x coordinate ; $array[0][1] = 1st y coordinate ; $array[1][0] = 2nd x coordinate ; $array[1][1] = 2nd y coordinate ; $array[3][0] = 3rd x coordinate ; $array[3][1] = 3rd y coordinate ; $array[n][0] = nth x coordinate ; $array[n][1] = nth y coordinate ; ; ATTENTION: If u use "False" max area for search must be 800x600 pixels, or equivalent maximal 480.000 pixels!!! ; No more. ; ; Return values . : On Success - Returns two-element array coordinates, or 2D array coordinates. ; On Failure - @Error = 1 - Path not found or invalid image/bitmap. ; @Error = 2 - Image not exist (in desktop). ; =============================================================================================================================== Func myImageSearch_Desktop($Image, $x = 0, $y = 0, $iIW = @DesktopWidth, $iIH = @DesktopHeight, $TransColorRGB = '', $OnlyFirst = True) Local $hBMP, $hImage1, $aReturn, $error, $i _GDIPlus_Startup() $hBMP = _ScreenCapture_Capture("", $x, $y, $iIW + $x, $iIH + $y, False) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $aReturn = myImageSearch_Picture($hImage1, $Image, 0, 0, $iIW, $iIH, $TransColorRGB, $OnlyFirst) $error = @error _GDIPlus_ImageDispose($hImage1) _WinAPI_DeleteObject($hBMP) _GDIPlus_Shutdown() Switch $error Case 0 If $OnlyFirst Then $aReturn[0] += $x $aReturn[1] += $y Else For $i = 0 To UBound($aReturn, 1) - 1 $aReturn[$i][0] += $x $aReturn[$i][1] += $y Next EndIf Return $aReturn Case 2 Return SetError(1, 1, '') Case Else Return SetError(2, 2, '') EndSwitch EndFunc ;==>myImageSearch_Desktop ; #FUNCTION# ==================================================================================================================== ; Name...........: myImageSearch_Picture ; Description ...: Znajdz obrazek na obrazku. ; Syntax.........: myImageSearch_Picture($hImage1, $hImage2, $x = 0, $y = 0, $iIW = 0, $iIH = 0, $TransColorRGB = '', $OnlyFirst = True) ; Parameters ....: $hImage1 - bazowy obrazek: adres do szuaknego obrazka, lub bitmapa (format .bmp 24-bit) ; $hImage2 - znajdz obrazek: adres do szuaknego obrazka, lub bitmapa (format .bmp 24-bit) ; $x - lewe koordynaty [Default is 0 (pierwszy pixel).] ; $y - gorne koordynaty. [Default is 0 (pierwszy pixel).] ; $iIW - prawe koordynaty. [Default is 0 (0 to ostani pixel (caly obrazek).] ; $iIH - dolne koordynaty. [Default is 0 (0 to ostani pixel (caly obrazek).] ; $TransColorRGB - Kolor przezroczystosci / Ignorowany kolor. Musi byc string i format RGB. a.g: "0xFFFFFF".[Default is "".] ; $OnlyFirst - [Default is True.] ; |True = Success: Zwraca tablice 2-elementowa z koordynatami. ; $array[0] = x koordynaty ; $array[1] = y koordynaty ; |False = Success: Zwraca 2D tablice z koordynatami. ; $array[0][0] = 1st x coordinate ; $array[0][1] = 1st y coordinate ; $array[1][0] = 2nd x coordinate ; $array[1][1] = 2nd y coordinate ; $array[3][0] = 3rd x coordinate ; $array[3][1] = 3rd y coordinate ; $array[n][0] = nth x coordinate ; $array[n][1] = nth y coordinate ; ; UWAGA: Jesli uzyjesz "False" to max obszar przeszukiwania moze wynosic 800x600 pixeli, lub ekwiwalent max 480.000 pixeli!!! ; Nie wiecej. ; ; Return values . : On Success - Zwrot tablica 2-elementowa z koordynatami lub 2D tablica z koordynatami. ; On Failure - @Error = 1 - 1 sciezka do pliku jest bledna, lub bitmapa/obrazek jest bledna. ; @Error = 2 - 2 sciezka do pliku jest bledna, lub bitmapa/obrazek jest bledna. ; @Error = 3 - Obrazka nie znaleziono (na obrazku). ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: myImageSearch_Picture ; Description ...: Image search in picture. ; Syntax.........: myImageSearch_Picture($hImage1, $hImage2, $x = 0, $y = 0, $iIW = 0, $iIH = 0, $TransColorRGB = '', $OnlyFirst = True) ; Parameters ....: $hImage1 - base image: string adress for file, or bitmat (format .bmp 24-bit) ; $hImage2 - search image: string adress for file, or bitmat (format .bmp 24-bit) ; $x - left coordinate. [Default is 0 (first pixel).] ; $y - top coordinate. [Default is 0 (first pixel).] ; $iIW - right coordinate. [Default is 0 (0 is last pixel (full imege).] ; $iIH - bottom coordinate. [Default is 0 (0 is last pixel (full imege).] ; $TransColorRGB - Color transparancy / Ignore color. Must be string and format RGB. a.g: "0xFFFFFF".[Default is "".] ; $OnlyFirst - [Default is True.] ; |True = Success: Returns a two-element array coordinates. ; $array[0] = x coordinate ; $array[1] = y coordinate ; |False = Success: Returns a 2D array coordinates. ; $array[0][0] = 1st x coordinate ; $array[0][1] = 1st y coordinate ; $array[1][0] = 2nd x coordinate ; $array[1][1] = 2nd y coordinate ; $array[3][0] = 3rd x coordinate ; $array[3][1] = 3rd y coordinate ; $array[n][0] = nth x coordinate ; $array[n][1] = nth y coordinate ; ; ATTENTION: If u use "False" max area for search must be 800x600 pixels, or equivalent maximal 480.000 pixels!!! ; No more. ; ; Return values . : On Success - Returns two-element array coordinates, or 2D array coordinates. ; On Failure - @Error = 1 - 1st path not found or invalid image/bitmap. ; @Error = 2 - 2nd path not found or invalid image/bitmap. ; @Error = 3 - Image not exist (in picture). ; =============================================================================================================================== Func myImageSearch_Picture($hImage1, $hImage2, $x = 0, $y = 0, $iIW = 0, $iIH = 0, $TransColorRGB = '', $OnlyFirst = True) Local $testiIW, $testiIH Local $hBitmap1, $Reslt, $width, $height, $stride, $format, $Scan0 Local $iIW_2, $iIH_2, $hBitmap2, $Reslt2, $width2, $height2, $stride2, $format2, $Scan02 Local $sREResult1, $sREResult2, $sREResult3 _GDIPlus_Startup() If IsString($hImage1) Then $hImage1 = _GDIPlus_ImageLoadFromFile($hImage1) EndIf $testiIW = _GDIPlus_ImageGetWidth($hImage1) $testiIH = _GDIPlus_ImageGetHeight($hImage1) If $hImage2 = "" Or $testiIW = 0 Or $testiIH = 0 Then Return SetError(1, 1, '') EndIf If $iIW = 0 Or $testiIW < $iIW Then $iIW = $testiIW If $iIH = 0 Or $testiIH < $iIH Then $iIH = $testiIH $hBitmap1 = _GDIPlus_BitmapCloneArea($hImage1, 0, 0, $iIW, $iIH, $GDIP_PXF32ARGB) $Reslt = _GDIPlus_BitmapLockBits($hBitmap1, $x, $y, $iIW - $x, $iIH - $y, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) $width = DllStructGetData($Reslt, "width") $height = DllStructGetData($Reslt, "height") $stride = DllStructGetData($Reslt, "stride") $format = DllStructGetData($Reslt, "format") $Scan0 = DllStructGetData($Reslt, "Scan0") $sREResult1 = DllStructCreate("byte[" & $height * $width * 4 & "]", $Scan0); Create DLL structure for all pixels $sREResult1 = DllStructGetData($sREResult1, 1) _GDIPlus_BitmapUnlockBits($hBitmap1, $Reslt); releases the locked region _GDIPlus_ImageDispose($hImage1) _GDIPlus_ImageDispose($hBitmap1) If IsString($hImage2) Then $hImage2 = _GDIPlus_ImageLoadFromFile($hImage2) EndIf $iIW_2 = _GDIPlus_ImageGetWidth($hImage2) $iIH_2 = _GDIPlus_ImageGetHeight($hImage2) If $hImage2 = "" Or $iIW_2 = 0 Or $iIH_2 = 0 Then Return SetError(2, 2, '') EndIf $hBitmap2 = _GDIPlus_BitmapCloneArea($hImage2, 0, 0, $iIW_2, $iIH_2, $GDIP_PXF32ARGB) $Reslt2 = _GDIPlus_BitmapLockBits($hBitmap2, 0, 0, $iIW_2, $iIH_2, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) $width2 = DllStructGetData($Reslt2, "width") $height2 = DllStructGetData($Reslt2, "height") $stride2 = DllStructGetData($Reslt2, "stride") $format2 = DllStructGetData($Reslt2, "format") $Scan02 = DllStructGetData($Reslt2, "Scan0") $sREResult2 = DllStructCreate("byte[" & $height2 * $width2 * 4 & "]", $Scan02); Create DLL structure for all pixels $sREResult2 = DllStructGetData($sREResult2, 1) _GDIPlus_BitmapUnlockBits($hBitmap2, $Reslt2); releases the locked region _GDIPlus_ImageDispose($hImage2) _GDIPlus_ImageDispose($hBitmap2) _GDIPlus_Shutdown() $sREResult1 = StringTrimLeft($sREResult1, 2) $sREResult2 = StringTrimLeft($sREResult2, 2) If IsString($TransColorRGB) Then ; ignore color $TransColorRGB = StringRegExpReplace($TransColorRGB, "0x(.{2})(.{2})(.{2})", "\3\2\1FF") If $TransColorRGB Then $sREResult2 = StringRegExpReplace($sREResult2, "(.{8})", "\1 ") $sREResult2 = StringReplace($sREResult2, $TransColorRGB, "........") $sREResult2 = StringReplace($sREResult2, " ", "") EndIf EndIf ;ConsoleWrite($sREResult2 & @CRLF) $sREResult2 = StringRegExpReplace($sREResult2, "(.{" & $iIW_2 * 8 & "})", "\\Q\1\\E.\{" & ($iIW - $iIW_2) * 8 & "\}") $sREResult2 = StringTrimRight($sREResult2, StringLen(($iIW - $iIW_2) * 8) + 3) ;ConsoleWrite($sREResult2 & @CRLF) If $TransColorRGB Then $sREResult2 = StringReplace($sREResult2, "........", "\E........\Q") $sREResult2 = StringReplace($sREResult2, "\Q\E", "") $sREResult2 = StringRegExpReplace($sREResult2, "([.}{\w]*)([\\].*[E])([.}{\w]*)", "\2") ; obcina kropki EndIf ;ConsoleWrite($sREResult2 & @CRLF) If $OnlyFirst Then $sREResult2 = '(?i)(.*?)' & $sREResult2 & ".*" ;ConsoleWrite($sREResult2 & @CRLF) $sREResult3 = StringRegExpReplace($sREResult1, $sREResult2, "\1") ; test pathern ("first") If Not @extended Then Return SetError(3, 3, '') ; extendet zero to nie znaleziono nic $sREResult3 = StringLen($sREResult3) / 8 Local $pozycja_Y = Int($sREResult3 / $iIW) + $y Local $pozycja_X = Int($sREResult3 - $pozycja_Y * $iIW) + ($y * $iIW) Local $aReturn[2] = [$pozycja_X, $pozycja_Y] Else $sREResult2 = '(?i)(.*?)(' & $sREResult2 & ".*?)" ; wersja dla wielu winikow ;ConsoleWrite($sREResult2 & @CRLF) $sREResult3 = StringRegExp($sREResult1, $sREResult2, 3) ; test pathern ("mulit") If @error Or Not IsArray($sREResult3) Then Return SetError(3, 3, '') Local $ile = UBound($sREResult3) Local $i Local $aReturn[$ile / 2][2] Local $sREResult4 = 0 Local $pozycja_Y Local $pozycja_X For $i = 0 To $ile - 1 Step 2 $sREResult4 += StringLen($sREResult3[$i]) / 8 If $i > 0 Then $sREResult4 += StringLen($sREResult3[$i + 1]) / 8 $pozycja_Y = Int($sREResult4 / $iIW) + $y $pozycja_X = Int($sREResult4 - $pozycja_Y * $iIW) + ($y * $iIW) $aReturn[$i / 2][0] = $pozycja_X $aReturn[$i / 2][1] = $pozycja_Y Next EndIf Return $aReturn EndFunc ;==>myImageSearch_Picture example: #include <array.au3> #include <myImageSearch.au3> ;Opt('MustDeclareVars', 1) ;########## test 1 Desktop ########## Global $pozycja1 Global $time1 Global $ImageSearch = @ScriptDir & "\recycle.bmp" Global $x = 0 Global $y = 0 Global $w = @DesktopWidth Global $h = @DesktopHeight Global $ColorTrans = '' Global $mOnlyFirst = True Sleep(10) $time1 = TimerInit() $pozycja1 = myImageSearch_Desktop($ImageSearch, $x, $y, $w, $h, $ColorTrans, $mOnlyFirst) If @error Then ConsoleWrite("sorry image not exist" & @CRLF) ConsoleWrite("time 1: " & TimerDiff($time1) / 1000 & ' sek.' & @CRLF) If IsArray($pozycja1) Then _ArrayDisplay($pozycja1) EndIf ;################################## ;########## test 2 Scren ########## Global $pozycja2 Global $time2 Global $ImageBazowe = @ScriptDir & "\where is wally.bmp" Global $ImageSearch = @ScriptDir & "\wanted wally.bmp" Global $x = 0 Global $y = 0 Global $w = 0 Global $h = 0 Global $ColorTrans = "0x00ffff" Global $mOnlyFirst = False ;False = search more image, but not all.., ; ;If u use "False" max area for search must be 800x600 pixels, ; ;or equivalent maximal 480.000 pixels!!! ; ;No more. ; ;Recommended is "True" Sleep(10) $time2 = TimerInit() $pozycja2 = myImageSearch_Picture($ImageBazowe, $ImageSearch, $x, $y, $w, $h, $ColorTrans, $mOnlyFirst) If @error Then ConsoleWrite("sorry image not exist" & @CRLF) ConsoleWrite("time 2: " & TimerDiff($time2) / 1000 & ' sek.' & @CRLF) If IsArray($pozycja2) Then _ArrayDisplay($pozycja2) EndIf ;##################################myImageSearch.au3 myImageSearch (Examples).au3 recycle.bmp where is wally.bmp wanted wally.bmp
-
my version
-
heh. good idea. ok. adding for tree "declared func".
-
dont understand
-
//1 post edit: simple modification. more options for search. np: *Au???t v* S*r?p*.au?
-
simple helper for scite 5 tabs 1. helper 2. search func/macro/string/const/etc... 3. find func / string in pc 4. google translator 5 include helper (include optimizer). update 1.3 added: new tab: Include Helper (Include Optimizer). update 1.2 file "helper.ini" for 3.3.8.0 au3 version. added: new tab: google translator.SciTE Helper 1.3.zip
-
myFileListToArray_AllFiles is simple modification _FileListToArray for all files work for unicode: ą,ż,ć,ę,ń, ect... include: myFileListToArray_AllFiles.au3 #include-once ; #FUNCTION# ==================================================================================================================== ; Name...........: myFileListToArray_AllFiles ; Description ...: Lists files and\or folders in a specified path ; Syntax.........: myFileListToArray_AllFiles($sPath[, $sFilter = "*.*"[, $iFlag = 1[, $full_adress = True[, $methody = 0[, $size_min = 0[, $size_max = 0[, $Accept_Attribute = 0[, $NO_Accept_Attribute = 0[, $LevelTooDown = 0]]]]\]]]]) ; Parameters ....: $sPath - Path to generate filelist for. ; $sFilter = [default is "*.*"]. The filter to use. Search the Autoit3 manual for the word "WildCards" For details, support now for multiple searches ; Example "*.exe; *.txt" will find all "*.exe" and "*.txt" files. ; '*' = 0 or more. '?' = 0 or 1. ; $iFlag = Optional: specifies whether to return files folders or both ; |$iFlag=0 Return both files and folders ; |$iFlag=1 (Default)Return files only ; |$iFlag=2 Return Folders only ; $full_adress = Optional: [default is true] ; |True - Return full adress for file ; |False - Return only file name ; $methody = Optional:[default is 1] search methody ; |$methody = 0 - simple ; |$methody = 1 - is full pattern ; $size_min = Optional:[default is 0] Minimal file size [MB] ; $size_max = Optional:[default is 0] Max file size [MB] ; $Accept_Attribute = Optional:[default is ""] Acccept only is file haw attributes. ; |"R" = READONLY ; |"A" = ARCHIVE ; |"S" = SYSTEM ; |"H" = HIDDEN ; |"N" = NORMAL ; |"D" = DIRECTORY ; |"O" = OFFLINE ; |"C" = COMPRESSED (NTFS compression, not ZIP compression) ; |"T" = TEMPORARY ; $NO_Accept_Attribute = Optional:[default is ""] NO acccept is file haw attributes. ; |"R" = READONLY ; |"A" = ARCHIVE ; |"S" = SYSTEM ; |"H" = HIDDEN ; |"N" = NORMAL ; |"D" = DIRECTORY ; |"O" = OFFLINE ; |"C" = COMPRESSED (NTFS compression, not ZIP compression) ; |"T" = TEMPORARY ; $LevelTooDown = Optional:[default is 0] how many level too down/up ; |0 = full tree (all files) ; |1 = search only one folder. ; |2 = 2 level down ; |3 = 3 level down ; |x = x level down ; |-1 = 1 level up (+ full tree) ; |-2 = 2 level up (+ full tree) ; |-x = x level up (+ full tree) ; Return values . : On Success - The array returned is one-dimensional and is made up as follows: ; $array[0] = Number of Files\Folders returned ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; @extended = How many files test ; On Failure - @Error = 1 - Path not found or invalid ; @Error = 2 - No File(s) Found ; @extended = How many files test ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: myFileListToArray_AllFiles ; Description ...: Zwraca liste plikow i/lub fodlderow ; Syntax.........: myFileListToArray_AllFiles($sPath[, $sFilter = "*.*"[, $iFlag = 1[, $full_adress = True[, $methody = 0[, $size_min = 0[, $size_max = 0[, $Accept_Attribute = 0[, $NO_Accept_Attribute = 0[, $LevelTooDown = 0]]]]]]]]]) ; Parameters ....: $sPath - Sciezka dostempu do pliku ; $sFilter = [default is "*.*"]. Filtr uzywany przy wyszukiwaniu. Mozna uzyc ich kilka oddzielajac kolejne znakiem ";" ; Naprzyklad skrut "*.exe; *.txt" zastapi dwa wyszukiwania "*.exe" i "*.txt". ; '*' = 0 lub wiecej. '?' = 0 lub 1. ; $iFlag = Optional: parametr ustalajacy czy zwracac tylko pliki, foldery, czy oba na raz. ; |$iFlag=0 Zwracaj wszystko ; |$iFlag=1 (Default)Zwracaj tylko pliki ; |$iFlag=2 Zwracaj tylko foldery ; $full_adress = [default is true] ; |True - Zwracaj pełny adress ; |False - Zwracaj tylko nazwe pliku ; $methody = [default is 1] - metoda szukania ; |$methody = 0 - metoda prosta (szukaj plik zawierajacy czesc podanej nazwy) ; |$methody = 1 - pelny pattern (to jest caly pattern) ; $size_min = [default is 0] Minimalny rozmiar pliku [MB] ; $size_max = [default is 0] maksymalny rozmiar pliku [MB] ; $Accept_Attribute = [default is ""] Akceptuj tylko te pliki co maja te atrybuty. ; |"R" = READONLY ; |"A" = ARCHIVE ; |"S" = SYSTEM ; |"H" = HIDDEN ; |"N" = NORMAL ; |"D" = DIRECTORY ; |"O" = OFFLINE ; |"C" = COMPRESSED (NTFS compression, not ZIP compression) ; |"T" = TEMPORARY ; $NO_Accept_Attribute = [default is ""] Nie akceptuj plikow z tymi atrybutami. ; |"R" = READONLY ; |"A" = ARCHIVE ; |"S" = SYSTEM ; |"H" = HIDDEN ; |"N" = NORMAL ; |"D" = DIRECTORY ; |"O" = OFFLINE ; |"C" = COMPRESSED (NTFS compression, not ZIP compression) ; |"T" = TEMPORARY ; $LevelTooDown = [default is 0] = Jak gleboko (poziom) szukac w dol/gore. ; |0 = cale drzewo (all files). ; |1 = Szukaj tylko w 1 folderze. ; |2 = 2 poziomy w dol. ; |3 = 3 poziomy w dol. ; |x = x poziomy w dol. ; |-1 = 1 poziom w gore (+ cale drzewo) ; |-2 = 2 poziom w gore (+ cale drzewo) ; |-x = x poziom w gore (+ cale drzewo) ; Return values . : On Success - Zwraca tablice wyników: ; $array[0] = Liczba znalezionych plikow i folderow ; $array[1] = 1st File\Folder ; $array[2] = 2nd File\Folder ; $array[3] = 3rd File\Folder ; $array[n] = nth File\Folder ; @extended = Ile plikow przeszukano na dysku ; On Niepowodzenie - @Error = 1 - Sciezka do katalogu jest bledna lub katalog nie istnieje ($sPath) ; @Error = 2 - Nie znaleziono plikow ; @extended = Ile plikow przeszukano na dysku ; =============================================================================================================================== Func myFileListToArray_AllFiles($sPath, $sFilter = "*.*", $iFlag = 1, $full_adress = 1, $methody = 1, $size_min = 0, $size_max = 0, $Accept_Attribute = 0, $NO_Accept_Attribute = 0, $LevelTooDown = 0) Local $hSearch, $sFile, $sFileList, $sDelim = "|", $HowManyFiles = 0, $aReturn $sPath = StringRegExpReplace($sPath, "[\\/]+\z", "") & "\" ; ensure single trailing backslash Local $c, $is_ok, $attrib, $FileSize, $lev, $levPath Local $foldery = '', $newFoldersSearch = '', $array_foldery, $extended, $a_Attribute, $NO_a_Attribute $iFlag = Number($iFlag) $full_adress = Number($full_adress) If $full_adress <> 0 Then $full_adress = 1 $methody = Number($methody) If $methody <> 0 Then $methody = 1 $size_min = Number($size_min * 100) / 100 $size_max = Number($size_max * 100) / 100 If $size_max - $size_min < 0 Then $size_max = 0 If $Accept_Attribute = Default Or $Accept_Attribute = -1 Or $Accept_Attribute = '' Or $Accept_Attribute = '0' Then $Accept_Attribute = 0 If $NO_Accept_Attribute = Default Or $NO_Accept_Attribute = -1 Or $NO_Accept_Attribute = '' Or $NO_Accept_Attribute = '0' Then $NO_Accept_Attribute = 0 If $Accept_Attribute Then $a_Attribute = StringSplit(StringRegExpReplace($Accept_Attribute, "[;, ]", ""), "", 3) If $NO_Accept_Attribute Then $NO_a_Attribute = StringSplit(StringRegExpReplace($NO_Accept_Attribute, "[;, ]", ""), "", 3) $LevelTooDown = Number($LevelTooDown) ; TREE - level up/down If $LevelTooDown > 0 Then StringReplace($sPath, '\', '\') $levPath = @extended - 2 ElseIf $LevelTooDown < 0 Then StringReplace($sPath, '\', '\') $levPath = @extended If $LevelTooDown <= $levPath Then $LevelTooDown = $levPath + $LevelTooDown If $LevelTooDown <= 0 Then $LevelTooDown = 1 $sPath = StringLeft($sPath, StringInStr($sPath, '\', 0, $LevelTooDown)) $LevelTooDown = 0 EndIf EndIf If Not FileExists($sPath) Then Return SetError(1, 0, '') $sFilter = StringRegExpReplace($sFilter, "\s*;\s*", "|") If ($sFilter = Default) or ($sFilter = -1) Or StringInStr("|" & $sFilter & "|", "|*.*|") Or StringInStr("|" & $sFilter & "|", "||") Then $sFilter = '(?i).*' Else If $methody = 0 Then ;$methody = 0 - "simple" $sFilter = StringReplace($sFilter, '*', '\E*\Q') $sFilter = StringReplace($sFilter, '?', '\E?\Q') $sFilter = StringReplace($sFilter, '.', '\E*[.]*\Q') $sFilter = StringReplace($sFilter, '|', '\E*|*\Q') $sFilter = '\Q' & $sFilter & '\E' $sFilter = StringReplace($sFilter, '\Q\E', '') $sFilter = StringReplace($sFilter, '*', '.*') $sFilter = StringReplace($sFilter, '?', '.?') $sFilter = '(?i).*' & $sFilter & '.*' $sFilter = StringRegExpReplace($sFilter, '([.][*]){2,}', '.*') Else ;$methody = 1 - "is full pattern" $sFilter = StringReplace($sFilter, '*', '\E*\Q') $sFilter = StringReplace($sFilter, '?', '\E?\Q') $sFilter = StringReplace($sFilter, '.', '\E[.]\Q') $sFilter = StringReplace($sFilter, '|', '\E|\Q') $sFilter = '\Q' & $sFilter & '\E' $sFilter = StringReplace($sFilter, '\Q\E', '') $sFilter = StringReplace($sFilter, '*', '.*') $sFilter = StringReplace($sFilter, '?', '.?') $sFilter = '(?i)' & $sFilter $sFilter = StringRegExpReplace($sFilter, '([.][*]){2,}', '.*') EndIf EndIf ;ConsoleWrite($sFilter & @CRLF) While 1 $hSearch = FileFindFirstFile($sPath & '*') If Not @error Then While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop $extended = @extended $HowManyFiles += 1 If $extended = 1 Then ;folder ;If $Accept_Attribute Or $NO_Accept_Attribute Then ;$attrib = FileGetAttrib($sPath & $sFile & '\') ;$is_ok = True ;If $Accept_Attribute Then ; test atrybutow - akceptowane ;For $c = 0 To UBound($a_Attribute) - 1 ;If Not StringInStr($attrib, $a_Attribute[$c]) Then $is_ok = False ;Next ;EndIf ;If $NO_Accept_Attribute Then ; test atrybutow - nie akceptowane ;For $c = 0 To UBound($NO_a_Attribute) - 1 ;If StringInStr($attrib, $NO_a_Attribute[$c]) Then $is_ok = False ;Next ;EndIf ;If $is_ok = False Then ContinueLoop ;EndIf If Not $LevelTooDown Then $newFoldersSearch &= $sPath & $sFile & '\' & $sDelim ;nowe foldery do szukania Else StringReplace($sPath & $sFile, '\', '\') $lev = @extended - $levPath If $LevelTooDown >= $lev Then $newFoldersSearch &= $sPath & $sFile & '\' & $sDelim EndIf EndIf EndIf If ($iFlag + $extended = 2) Then ContinueLoop $is_ok = Not StringRegExpReplace($sFile, $sFilter, '') ; test pattern If ($Accept_Attribute Or $NO_Accept_Attribute) And $is_ok Then ;test atrybutow $attrib = FileGetAttrib($sPath & $sFile) If $Accept_Attribute Then ; test atrybutow - akceptowane For $c = 0 To UBound($a_Attribute) - 1 If Not StringInStr($attrib, $a_Attribute[$c]) Then $is_ok = False Next EndIf If $NO_Accept_Attribute Then ; test atrybutow - nie akceptowane For $c = 0 To UBound($NO_a_Attribute) - 1 If StringInStr($attrib, $NO_a_Attribute[$c]) Then $is_ok = False Next EndIf EndIf If ($size_min Or $size_max) And $is_ok Then ; test size $FileSize = Round(FileGetSize($sPath & $sFile) / 1048576, 2) ; size = MB If $size_min And $size_min > $FileSize Then $is_ok = False If $size_max And $size_max < $FileSize Then $is_ok = False EndIf If $full_adress And $is_ok Then $sFileList &= $sDelim & $sPath & $sFile ElseIf Not $full_adress And $is_ok Then $sFileList &= $sDelim & $sFile EndIf WEnd EndIf FileClose($hSearch) $foldery = $newFoldersSearch & $foldery $newFoldersSearch = '' $array_foldery = StringSplit($foldery, $sDelim, 3) If UBound($array_foldery) <= 1 Then ExitLoop $foldery = StringTrimLeft($foldery, StringInStr($foldery, $sDelim)) $sPath = $array_foldery[0] WEnd If Not $sFileList Then Return SetError(2, $HowManyFiles, "") $aReturn = StringSplit(StringTrimLeft($sFileList, 1), $sDelim) $sFileList = 0 SetExtended($HowManyFiles) Return $aReturn EndFunc ;==>myFileListToArray_AllFiles ;############################################################## ; version 2 (only 4 parameters) ;############################################################## Func myFileListToArray_AllFilesEx($sPath, $sFilter = "*.*", $iFlag = 1, $full_adress = 1) Local $hSearch, $sFile, $sFileList, $sDelim = "|", $HowManyFiles = 0, $aReturn $sPath = StringRegExpReplace($sPath, "[\\/]+\z", "") & "\" ; ensure single trailing backslash Local $is_ok, $foldery = '', $newFoldersSearch = '', $array_foldery, $extended $iFlag = Number($iFlag) $full_adress = Number($full_adress) If $full_adress <> 0 Then $full_adress = 1 If Not FileExists($sPath) Then Return SetError(1, 0, '') $sFilter = StringRegExpReplace($sFilter, "\s*;\s*", "|") If ($sFilter = Default) or ($sFilter = -1) Or StringInStr("|" & $sFilter & "|", "|*.*|") Or StringInStr("|" & $sFilter & "|", "||") Then $sFilter = '(?i).*' Else $sFilter = StringReplace($sFilter, '*', '\E*\Q') $sFilter = StringReplace($sFilter, '?', '\E?\Q') $sFilter = StringReplace($sFilter, '.', '\E[.]\Q') $sFilter = StringReplace($sFilter, '|', '\E|\Q') $sFilter = '\Q' & $sFilter & '\E' $sFilter = StringReplace($sFilter, '\Q\E', '') $sFilter = StringReplace($sFilter, '*', '.*') $sFilter = StringReplace($sFilter, '?', '.?') $sFilter = '(?i)' & $sFilter $sFilter = StringRegExpReplace($sFilter, '([.][*]){2,}', '.*') EndIf ;ConsoleWrite($sFilter &@CRLF) While 1 $hSearch = FileFindFirstFile($sPath & '*') If Not @error Then While 1 $sFile = FileFindNextFile($hSearch) If @error Then ExitLoop $extended = @extended $HowManyFiles += 1 If $extended = 1 Then ;folder $newFoldersSearch &= $sPath & $sFile & '\' & $sDelim ;nowe foldery do szukania EndIf If ($iFlag + $extended = 2) Then ContinueLoop $is_ok = Not StringRegExpReplace($sFile, $sFilter, '') ; test pattern If $full_adress And $is_ok Then $sFileList &= $sDelim & $sPath & $sFile ElseIf Not $full_adress And $is_ok Then $sFileList &= $sDelim & $sFile EndIf WEnd EndIf FileClose($hSearch) $foldery = $newFoldersSearch & $foldery $newFoldersSearch = '' $array_foldery = StringSplit($foldery, $sDelim, 3) If UBound($array_foldery) <= 1 Then ExitLoop $foldery = StringTrimLeft($foldery, StringInStr($foldery, $sDelim)) $sPath = $array_foldery[0] WEnd If Not $sFileList Then Return SetError(2, $HowManyFiles, "") $aReturn = StringSplit(StringTrimLeft($sFileList, 1), $sDelim) $sFileList = 0 SetExtended($HowManyFiles) Return $aReturn EndFunc ;==>myFileListToArray_AllFilesEx example v1: #include <Array.au3> #include 'myFileListToArray_AllFiles.au3' $array = myFileListToArray_AllFiles(@WindowsDir) _ArrayDisplay($array, 'all files') $array = myFileListToArray_AllFiles(@WindowsDir , '', 2) _ArrayDisplay($array, 'all folders') $array = myFileListToArray_AllFiles(@WindowsDir , '*.txt ; *.rtf') _ArrayDisplay($array , 'only: txt & rtf') example v2: #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include 'myFileListToArray_AllFiles.au3' ;Opt('MustDeclareVars', 1) Global $gui, $label, $label_2, $bution, $listview, $Input_Filter, $Input_MinSiz, $Input_MaxSiz Global $label_sPath, $label_filter, $label_3 Global $Input_Flag, $Input_Adress, $Input_methody, $Input_AccAtryb, $Input_NO_AccAtryb, $Imput_LevDown Global $szukane = "*.mp? ; *.wma ; *.wav; *.avi ; *.rmvb ; *.flv" ;Global $szukane = "*Au???t v* S*r?p*.au?" Global $title = 'myFileListToArray_AllFiles()' $gui = GUICreate($title, 920, 585, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GUISetBkColor(0xF0F4F9) $label = GUICtrlCreateLabel($szukane, 10, 12, 590, 20) GUICtrlSetFont(-1, 12, 800) $Input_Filter = GUICtrlCreateInput($szukane, 10, 40, 380, 20) GUICtrlCreateLabel('* = 0 or more. ? = 0 or 1. ; = next pattern', 10, 60, 380, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0x0000ff) $bution = GUICtrlCreateButton("Search", 412, 36, 129, 25) $label_sPath = GUICtrlCreateLabel('$sPath = ', 715, 10, 200, 20, $SS_CENTERIMAGE) $label_filter = GUICtrlCreateLabel('$sFilter = ' & $szukane, 715, 40, 200, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('', 715, 70, 200, 3, $SS_SUNKEN) GUICtrlCreateLabel('$iFlag= 1 (Default) [Optional]', 715, 80, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_Flag = GUICtrlCreateInput('1', 715, 100, 40, 20, $ES_NUMBER + $ES_READONLY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 2, 0) GUICtrlCreateLabel('0 = all, 1 = files, 2 = folders', 760, 100, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('$full_adress = 1 (Default is True) [Optional]', 715, 140, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_Adress = GUICtrlCreateInput('1', 715, 160, 40, 20, $ES_NUMBER + $ES_READONLY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 1, 0) GUICtrlCreateLabel('0 = file name, 1 = full adress', 760, 160, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('$methody = 1 (Default) [Optional]', 715, 200, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_methody = GUICtrlCreateInput('1', 715, 220, 40, 20, $ES_NUMBER + $ES_READONLY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 1, 0) GUICtrlCreateLabel('0 = simple, 1 = is full pattern', 760, 220, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('$size_min = 0 (Default) [Optional]', 715, 260, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_MinSiz = GUICtrlCreateInput('0', 715, 280, 40, 20, $ES_NUMBER) GUICtrlCreateLabel('minmal size [MB]', 760, 280, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('$size_max = 0 (Default) [Optional]', 715, 320, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_MaxSiz = GUICtrlCreateInput('0', 715, 340, 40, 20, $ES_NUMBER) GUICtrlCreateLabel('maxymal size [MB]', 760, 340, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('$Accept_Attribute = "" (Default) [Optional]', 715, 380, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_AccAtryb = GUICtrlCreateInput('', 715, 400, 40, 20) GUICtrlCreateLabel('accept attribute', 760, 400, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('attribute: R,A,S,H,N,D,O,C,T', 740, 420, 140, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0x0000ff) GUICtrlSetTip(-1, 'String returned could contain a combination of these letters "RASHNDOCT":' & @CRLF & _ '"R" = READONLY' & @CRLF & '"A" = ARCHIVE ' & @CRLF & '"S" = SYSTEM ' & @CRLF & '"H" = HIDDEN ' & @CRLF & _ '"N" = NORMAL ' & @CRLF & '"D" = DIRECTORY ' & @CRLF & '"O" = OFFLINE ' & @CRLF & _ '"C" = COMPRESSED (NTFS compression, not ZIP compression) ' & @CRLF & '"T" = TEMPORARY') GUICtrlCreateLabel('$NO_Accept_Attribute = "" (Default) [Optional]', 715, 450, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Input_NO_AccAtryb = GUICtrlCreateInput('', 715, 470, 40, 20) GUICtrlCreateLabel('NO accept attribute', 760, 470, 140, 20, $SS_CENTERIMAGE) GUICtrlCreateLabel('attribute: R,A,S,H,N,D,O,C,T', 740, 490, 140, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0x0000ff) GUICtrlSetTip(-1, 'String returned could contain a combination of these letters "RASHNDOCT":' & @CRLF & _ '"R" = READONLY' & @CRLF & '"A" = ARCHIVE ' & @CRLF & '"S" = SYSTEM ' & @CRLF & '"H" = HIDDEN ' & @CRLF & _ '"N" = NORMAL ' & @CRLF & '"D" = DIRECTORY ' & @CRLF & '"O" = OFFLINE ' & @CRLF & _ '"C" = COMPRESSED (NTFS compression, not ZIP compression) ' & @CRLF & '"T" = TEMPORARY') GUICtrlCreateLabel('$LevelTooDown = 0 (Default) [Optional]', 715, 520, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0xff0000) $Imput_LevDown = GUICtrlCreateInput('0', 715, 540, 40, 20, $ES_NUMBER + $ES_READONLY) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateUpdown(-1) GUICtrlCreateLabel('0 = all, 1 = 1lev, x = xlev, ect', 760, 540, 200, 20, $SS_CENTERIMAGE) $label_2 = GUICtrlCreateLabel('"+" = tree level down, "-" = level up', 740, 560, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0x0000ff) GUICtrlSetTip(-1, 'how many level too down / up' & @CRLF & _ '0 = full tree (all files)' & @CRLF & _ '1 = search only one folder' & @CRLF & _ '2 = 2 level down' & @CRLF & _ '3 = 3 level down' & @CRLF & _ 'x = x level down' & @CRLF & _ '-1 = 1 level up (+ full tree)' & @CRLF & _ '-2 = 2 level up (+ full tree)' & @CRLF & _ '-x = x level up (+ full tree)') $listview = GUICtrlCreateListView("No|WYNIK WYSZUKIWANIA|Nazwa|Format|Size[MB]", 10, 80, 700, 480) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT) GUICtrlSendMsg($listview, 0x101E, 0, 35) GUICtrlSendMsg($listview, 0x101E, 1, 350) GUICtrlSendMsg($listview, 0x101E, 2, 170) GUICtrlSendMsg($listview, 0x101E, 3, 60) GUICtrlSendMsg($listview, 0x101E, 4, 60) _GUICtrlListView_SetSelectedColumn($listview, 1) $label_3 = GUICtrlCreateLabel('speed: = = = = ', 20, 560, 200, 20, $SS_CENTERIMAGE) GUICtrlSetColor(-1, 0x0000ff) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $bution Search_Files() EndSwitch Sleep(20) WEnd Func Search_Files() Local $mySave = IniRead(@ScriptDir & "\configbot.ini", "tester", "File Select", @ScriptDir) Local $var = FileSelectFolder("", '', "", $mySave, $gui) IniWrite(@ScriptDir & "\configbot.ini", "tester", "File Select", $var) Local $FileList Local $ile = 0 Local $Skrucona_Nazwa Local $format Local $rozmiar Local $mTimer Local $myExtended = 0 Local $i, $id Local $SEARCH = GUICtrlRead($Input_Filter) Local $myFlag = GUICtrlRead($Input_Flag) Local $myAdress = GUICtrlRead($Input_Adress) Local $myMethody = GUICtrlRead($Input_methody) Local $size_min = GUICtrlRead($Input_MinSiz) Local $size_max = GUICtrlRead($Input_MaxSiz) Local $myAccAtryb = GUICtrlRead($Input_AccAtryb) Local $myNOAccAtryb = GUICtrlRead($Input_NO_AccAtryb) Local $myLevTooDown = GUICtrlRead($Imput_LevDown) For $i = $Input_Filter To $label_2 GUICtrlSetState($i, $GUI_DISABLE) Next WinSetTitle($gui, "", $title & ' [ 0 / 0 ]') _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview)) GUICtrlSetData($label, "Sprawdzam " & $var) GUICtrlSetData($label_sPath, '$sPath = ' & $var) GUICtrlSetData($label_3, 'test speed = START') ConsoleWrite(myConsoleWriteTXT($var, $SEARCH, $myFlag, $myAdress, $myMethody, $size_min, $size_max, $myAccAtryb, $myNOAccAtryb, $myLevTooDown)) $mTimer = TimerInit() $FileList = myFileListToArray_AllFiles($var, $SEARCH, $myFlag, $myAdress, $myMethody, $size_min, $size_max, $myAccAtryb, $myNOAccAtryb, $myLevTooDown) $myExtended = @extended GUICtrlSetData($label_3, 'test speed = ' & TimerDiff($mTimer) / 1000 & ' sek.') If IsArray($FileList) Then local $array_AD[UBound($FileList)-1][5] For $id = 1 To $FileList[0] $ile = $ile + 1 $Skrucona_Nazwa = StringRegExpReplace($FileList[$id], "((?:.*?[\\/]+)*)(.*?\z)", "$2") $format = StringRegExpReplace($FileList[$id], "((?:.*?[\\/.]+)*)(.*?\z)", "$2") If $format = $Skrucona_Nazwa Then $format = '' $rozmiar = Round(FileGetSize($FileList[$id]) / 1048576, 2) ;GUICtrlCreateListViewItem($ile & '|' & $FileList[$id] & '|' & $Skrucona_Nazwa & '|' & $format & '|' & $rozmiar, $listview) $array_AD[$id-1][0]= $ile $array_AD[$id-1][1]= $FileList[$id] $array_AD[$id-1][2]= $Skrucona_Nazwa $array_AD[$id-1][3]= $format $array_AD[$id-1][4]= $rozmiar ;WinSetTitle($gui, "", StringFormat(' [ [ %s / %s ] / %s ] %s', $ile, $FileList[0], $myExtended, $FileList[$id])) Next _GUICtrlListView_AddArray($listview, $array_AD) EndIf WinSetTitle($gui, "", ' [' & $ile & ' / ' & $myExtended & ' ] succes / all files') For $i = $Input_Filter To $label_2 GUICtrlSetState($i, $GUI_ENABLE) Next GUICtrlSetData($label, $SEARCH);'lista plikow') EndFunc ;==>Search_Files Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $listview If Not IsHWnd($listview) Then $hWndListView = GUICtrlGetHandle($listview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_COLUMNCLICK ; A column was clicked $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) Local $B_DESCENDING[_GUICtrlListView_GetColumnCount($listview)] _GUICtrlListView_SimpleSort($hWndListView, $B_DESCENDING, DllStructGetData($tInfo, "SubItem")) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case GUICtrlGetHandle($Input_Filter) Switch $iCode Case $EN_UPDATE GUICtrlSetData($label_filter, '$sFilter = ' & GUICtrlRead($Input_Filter)) EndSwitch EndSwitch EndFunc ;==>WM_COMMAND Func myConsoleWriteTXT($pth, $flt, $flg, $adr, $meth, $min, $max, $Acpt, $NOacpt, $LevD) If $max - $min < 0 Then $max = 0 If $LevD <> 0 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s, %s, %s, "%s", "%s", %s)', _ $pth, $flt, $flg, $adr, $meth, $min, $max, $Acpt, $NOacpt, $LevD) & @CRLF If $NOacpt <> '' Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s, %s, %s, "%s", "%s")', _ $pth, $flt, $flg, $adr, $meth, $min, $max, $Acpt, $NOacpt) & @CRLF If $Acpt <> '' Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s, %s, %s, "%s")', _ $pth, $flt, $flg, $adr, $meth, $min, $max, $Acpt) & @CRLF If $max <> 0 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s, %s, %s)', _ $pth, $flt, $flg, $adr, $meth, $min, $max) & @CRLF If $min <> 0 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s, %s)', _ $pth, $flt, $flg, $adr, $meth, $min) & @CRLF If $meth <> 1 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s, %s)', _ $pth, $flt, $flg, $adr, $meth) & @CRLF If $adr <> 1 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s, %s)', _ $pth, $flt, $flg, $adr) & @CRLF If $flg <> 1 Then Return StringFormat('myFileListToArray_AllFiles("%s", "%s", %s)', _ $pth, $flt, $flg) & @CRLF If $flt = '*.*' Or $flt = '*' Or $flt = '' Then Return StringFormat('myFileListToArray_AllFiles("%s")', _ $pth) & @CRLF Return StringFormat('myFileListToArray_AllFiles("%s", "%s")', _ $pth, $flt) & @CRLF EndFunc ;==>myConsoleWriteTXTnajprostsze.au3 myFileListToArray_AllFiles.au3 tester funkcji.au3
-
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
bump -
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
ControlSend(enter) too -
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
thanks for information, but still have problem -
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
my bot has 2 years... all cod is ok, but not {ENTER} & {NUMPADENTER} fu%&$*# new GG -
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
yes, but compatible. v3.2.5.0 and later are restricted by GameGuard (require baypas) -
alternative to Send("{ENTER}")
akurakkauaaa replied to akurakkauaaa's topic in AutoIt General Help and Support
not ... in gmo still bad ;/ -
helo i'm looking alternative to Send("{ENTER}") for autoit 3, 2, 4, 9 currently gameguard block's randomly my "enter" my scropt is: Func Textt() send ("{Enter}") sleep(200) send ("text") sleep(200) send ("{Enter}") sleep(200) EndFunc so that 50% is only "send text" + 1x enter"
-
exist macro "@hour+min" ? because acctual my pro algorithm... $timeA = 1 $timeB = 30 if (@HOUR & @MIN) > ( 22 & 31) and (@HOUR & @MIN) < ($timeA & $timeB)then $time1 = $timeA - @HOUR $time2 = $timeB - @MIN TraySetToolTip( $time1 & $time2 ,5,5 ) endif ...is: