Search the Community

Showing results for tags 'read'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Chat
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 30 results

  1. Hello. I'm too stupid to see my mistake: To investigate the internal "dictionary" of TIFF files I'd like to read in the files in binary mode and to check, if there are more than one pages "in" this TIFF. Notepad++, "View as Hex" is presenting the first bytes as "49 49 2a 20 08 20 20 20 12" for the TIF attached to this posting The "TIFF Header Format" is easy: Offset 00h, 2 Byte = Byte Order, "II"=intel, "MM"=motorola. (I = 0x49) --> II Offset 02h, 2 Byte = Version Nr. Offset 04h, 4 Byte = pointer to first IFD entry Description of TIFF header: https://www.awaresystems.be/imaging/tiff/faq.html#q3 Howto read and analyse the binary content correctly? This is my messy, not operational code: $sampleTiff="H:\daten\tif\11\11\111111.TIF" $h=FileOpen($sampleTiff,16) $content=FileRead($h) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console FileClose($h) $type=VarGetType($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $type = ' & $type & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $ToString=BinaryToString($content) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ToString = ' & $ToString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & @CRLF) $content=StringTrimLeft($content,2) ; cut off the leading "0x" ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $content = ' & $content & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console for $i = 1 to 8 step 8 $next=StringMid($content,$i,2) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $next = ' & $next & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $Chr=BinaryToString($next) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Chr = ' & $Chr & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ConsoleWrite(@CRLF & "---" & @CRLF) Next Regards, Rudi. 111111.TIF
  2. Hello all! I have had some issues reading text from different types of windows, occasionally, specifically with controlgettext. **Before I begin, I know there are better ways to do what I attempt in the example below. That's not the point of this post. The point is my issues with controlgettext. I am about to cite an example with an application you may be familiar with called SpeedFan (v4.52). My problem is not specific to speedfan, it is simply the most recent and easily reproducible example I can think of. So, the goal of the script below is to get a string of text containing the current fan RPMs from the highlighted control in the screenshot below (see "speedfan_control_details.png"). Now, here's a simple script for grabbing the window handle and reading the text from that control: $wintitle = "SpeedFan 4.52" $controlID = "197934" ;will be reformatted as "[ID:######]" $hwnd = wingethandle($wintitle) if @error<>0 then msgbox(0, "WinGetHandle", "FAILURE. @error="&@error) Exit EndIf $text = ControlGetText($hwnd, "", "[ID:"&$controlID&"]") if @error=1 then msgbox(0, "ControlGetText", "FAILURE. @error="&@error) ;failure returns "" and @error=1 Exit EndIf msgbox (0, "ControlGetText", "SUCCESS. @error="&@error &@CRLF& "$text="&$text) ;success returns string and @error=0 You'll see that the ControlGetText operation runs without error, however it does not capture any text from the control. If you explore the other controls in this one window, you'll find mixed results across the board. Neither the temps nor voltages can be read, while the log field and some other elements can be read. Even when you read the text from the whole window, those elements are not included in the visible nor hidden texts. I have run into this issue many times in the past- inconsistencies in the ability of autoit to interact with certain controls. What is it which makes this text different than any other readable texts? Is there an alternate method of reading the text in the window/control which could work? Any and all info to help me solve this mystery and satisfy my curiosity would be greatly appreciated. Thanks -Rob C PS: Running Autoit v3.3.14.2 on Win7 Ultimate x64
  3. Hello guys Today I'll give you three functions to manage the list View items These functions will help you to do some works in your list view items 1. list view Read To get the selected item text 2. listView_checke To checke an item 3. isListViewChecked To see if the item is checked All of these functions will be illustrated by the following example You can download the include file from the link below Now with the example #include <easy_listView_functions.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> Example() Func Example()  Local $idListview  GUICreate("ListView Get Item Checked State", 1000, 700)  $idListview = GUICtrlCreateListView("", 50, 30, 250, 120, 50)  _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) ; Add items $item1 = GUICtrlCreateListViewItem("item1", $idListview) $item2 = GUICtrlCreateListViewItem("item2", $idListview) _listview_Checke($idListview, "item1") $btn = GUICtrlCreateButton("&read", 100, 150, 50, 50) $btn2 = GUICtrlCreateButton("&if checked", 100, 200, 100, 50)  GUISetState(@SW_SHOW) while 1 switch GUIGetMSG() case $GUI_EVENT_CLOSE  GUIDelete() exit case $btn $read = _ListView_read($idListView) if $read then msgBox(0, "read listview", $read) else msgBox(0, "read listview", "no text ditected") endIf case $btn2 if _isListviewChecked($idListView, "item1") then msgBox(0, "get", "the item is checked") else msgBox(0, "get", "the item isn't checked") endIf endSwitch wend EndFunc   ;==>Example easy_listView_functions.au3
  4. Hi guys, I'd like to write a piece of tool that would allow me to update a certain field in our Active Directory from a comma separated csv file composed like this: This file, automatically generated, can hold more than 10k lines. Thus, I need column A to be in one variable, column B in a second one and column C in a third one. I'm really missing this part as updating the AD is fairly easy once the 3 variable are populated. I see things like this: Here's my attempts at the moment: #include <File.au3> #include <Array.au3> Global $csv_file = @DesktopDir & "\Book1.csv" Global $aRecords If Not _FileReadToArray($csv_file,$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] Msgbox(0,'Record:' & $x, $aRecords[$x]) ; Shows the line that was read from file $csv_line_values = StringSplit($aRecords[$x], ",",1) ; Splits the line into 2 or more variables and puts them in an array ; _ArrayDisplay($csv_line_values) ; Shows what's in the array you just created. ; $csv_line_values[0] holds the number of elements in array ; $csv_line_values[1] holds the value ; $csv_line_values[2] holds the value ; etc Msgbox(0, 0, $csv_line_values[1]) Next Any help on this please? Thanks in advance -31290-
  5. Hi, I have a property file format configuration file for our project. The sample file is as below. BuildLocation:C:\Build BuildExe:erwin Data Modeler r9.7 (64-bit)_2378.exe Release:r9.64.02 Silent:No InstallPath:default Compare :No MartUpgrade :Yes Bit:64 ERwinUpgrade:No License_File:150416-1952 Navigator (ca.com).lic To read this file, I am using below code. Func readConfig($sFilePath,$intStartCode) ;Usage: MsgBox(0,"Silent",readConfig(@ScriptDir&"\Config.txt","Silbent")) ;$sReplaceText = "Mani Prakash" ;$sFilePath = "C:\Users\KIRUD01\Desktop\Config.txt" ;$intStartCode = "BuildExe" $arrRetArray = "" $s = _FileReadToArray($sFilePath, $arrRetArray);Reading text file and saving it to array $s will show status of reading file.. For $i = 1 To UBound($arrRetArray)-1 $line = $arrRetArray[$i];retrieves taskengine text line by line If StringInStr($line, $intStartCode) Then ConsoleWrite ("Starting point "& $line & @CRLF) return StringStripWS(StringSplit($line,":")[2],$STR_STRIPLEADING + $STR_STRIPTRAILING ) EndIf if $i = UBound($arrRetArray)-1 then return "Not Found" Next EndFunc The above code is working to read the particular key value. But problem is , if I try to read the key "Bit" it is giving the value of key "BuildExe" as the line contains the word "bit".. Can you suggest how to do this. If possible I need to fix writeConfig also. Func writeConfig($sFilePath,$intStartCode,$sReplaceText) ;$sReplaceText = "Mani Prakash" ;$sFilePath = "C:\Users\KIRUD01\Desktop\Config.txt" ;$intStartCode = "BuildExe" $arrRetArray = "" $s = _FileReadToArray($sFilePath, $arrRetArray);Reading text file and saving it to array $s will show status of reading file.. $intStartingPointFound = 0 For $i = 1 To UBound($arrRetArray)-1 $line = $arrRetArray[$i];retrieves taskengine text line by line If StringInStr($line, $intStartCode) Then $intStartingPointFound = 1;if found the starting point of the module to copy then set this variable to 1 ConsoleWrite ("Starting point " & @CRLF) $arrRetArray[$i] = $intStartCode & ": " & $sReplaceText ExitLoop EndIf if $i = UBound($arrRetArray)-1 then ConsoleWrite("Not Found" & @CRLF) Next _FileWriteFromArray ($sFilePath, $arrRetArray,1) EndFunc
  6. Hi there, I have a small hopefully quick fixable issue with reading information from my ListView: So in fact I just want to have information about which items are selected, so I'm using msgbox(0 , "return", GUICtrlRead($myListView), 1) but unfortunately it only returns me either the first item id or if this is not selected the second item id, or if this is not selected the third, etc. or 0 if none is selected. Anybody has an idea how to get the full picture of my >>multiple Items selected<< ListView? Thanks in advance! Clemens
  7. Since my last topic were closed because bot scripting aren't allowed to be discussed anymore on here. Could anyone possibly give me a good example to learn memory read/write? , i can't figure out anything else which would be a good level of difficulty to practice than "tetris bot" but since it aint legal, i wont be asking for that let me know ur ideas and i would highly appreciate if examples could be posted (My last project was a imgsrch/pxlsrch) so thought i woud move on to memory read/write, if this somehow came out wrong lmk. AND NO I'M NOT ASKING FOR A FULL CODE I WANNA CODE/SCRIPT IT MY SELF, Just show me some simple examples of Memory read/write if u can/will TYVM. Dequality.
  8. I honestly didn't try anything yet. But i was thinking about my next step would be to try creating a tetris bot for educational purpose only. Last time i created a automation script / bot for ClubPenguin, which was simply made with PixelSearch If NOT(@error) Then , bla bla u know the drill aight, so i thought i would give my self a little harder challenge instead of keep making Pixelbots, i would love to try making a Memory bot or w/e u call , i read something about memory read/record was used for Tetris bots, since i haven't used Memory, i would love to know if anyone could give me a good guide or smth to follow :-) Either a complete tetris bot guide or a guide that explains memory totally in depth ish. :-) Dequality. #ANY-HELP-APPRECIATET
  9. #include <ColorConstants.au3>; Including required files #include <GUIConstantsEx.au3> #include <file.au3> #include <Array.au3> #include <string.au3> Example() Func Example() Local $hash Local $hashes = "hash.txt" _FileReadToArray($hashes, $hash) For $i = 1 to UBound($hash) -1 $hashcheck = $hash[$i] $PDenc = "hash=" & $hashcheck & "&decrypt=Decrypt" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "http://URLHERE.com/", False) ; Post url $oHTTP.SetRequestHeader("Host", "URLHERE.com") $oHTTP.SetRequestHeader("Connection", "keep-aliveContent-Length: 29") $oHTTP.SetRequestHeader("Cache-Control", "max-age=0") $oHTTP.SetRequestHeader("Origin", "http://URLHERE.com") $oHTTP.SetRequestHeader("Upgrade-Insecure-Requests", "1") $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8") $oHTTP.SetRequestHeader("Referer", "http://URLHERE.com/") $oHTTP.SetRequestHeader("Accept-Language", "en-US,en;q=0.8") $oHTTP.Send($PDenc) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ; Saves the body response regardless of the Response code $file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $oReceived) $read = FileRead("Received.html") ;read file $Datastring = ('</script></div><br/>') $newreadamount = _StringBetween($read, $Datastring, "</b><br/><br/>") ;read title from file $newreadamount[0] = StringReplace($newreadamount[0], '<b>', "") ; taking out the X makes it easier to compare values $file = FileOpen("decrypted.txt", 1) FileWrite($file, $newreadamount[0] & @CRLF) Next EndFunc ;==>Example I would like to read up to 500 lines in my file at a time instead of reading the one line each time. is this possible? Lets say I have 500 lines in my document and I would like to add them all to the $PDenc = "hash=" & $hashcheck & "&decrypt=Decrypt" $hashcheck variable. Right now it will only take 1 line each time until all of it is finished. But I would like it to take 500 lines each time to hasten the process. Thanks in advance.
  10. $Combo1 = GUICtrlCreateCombo("", 72, 96, 113, 25) GUICtrlSetData(-1, "Test1|Test2") $1 = GUICtrlRead($combo1) So if someone selected Test 1 on the GUI, what value is $1? How about if they selected Test 2?
  11. Hi everyone I try to use something like that but it's goin 0x error! $FilePath = FileOpen("settings.data") $FileRead = FileRead($FilePath) MsgBox(0,0,$FileRead) $FileClose = FileClose($FilePath)If i try to open .txt file it's fine and working perfectly but if i try to use with this format , i got error Thanks
  12. TCPClient UDF

    Version 1.0.0

    198 downloads

    Events-based UDF to help on handling one or more TCP connections
  13. Hello everyone, i am working atm at a small programm, i want to make it work like this: I click on "NEW" i can add a new Customer, i want to read the input and save it (the thing is i want to make it work for me and my friend in the internet so i think we need a internet database but firstly i want to make it work on my laptop only for me) i dont know in what to save it cuz "txt" is a bit weird , why? becouse later i want to make a button which search for the "customer" if i press on the other button not "NEW", if i press on "Search", then i have to write the customers name in, and the info i got from the customer has to show up and be changeable. i hope someone understand my poor english xD , well here is the script which is not finisht cuz i dont know how to finish the idea. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $GUI = GUICreate("Form1", 429, 148, 249, 151) $NEW = GUICtrlCreateButton("NEW", 48, 24, 75, 25) $Search = GUICtrlCreateButton("Search", 48, 54, 75, 25) $SAVE = GUICtrlCreateButton("SAVE", 328, 112, 75, 25) $EDIT = GUICtrlCreateButton("EDIT", 328, 112, 75, 25) GUISetState(@SW_SHOW, $GUI) GUICtrlSetState ($SAVE, $GUI_HIDE) GUICtrlSetState ($EDIT, $GUI_HIDE) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $NEW GUICtrlSetState ($SAVE, $GUI_SHOW) _NewCustomer() Case $Search GUICtrlSetState ($EDIT, $GUI_SHOW) _SearchCustomer() Case $SAVE ;not completed yet cuz i dont know in which format to save it to ;read it again in the GUI to make it edit able. EndSwitch WEnd Func _SearchCustomer() $Input2 = GUICtrlCreateInput("", 136, 57, 121, 21) EndFunc Func _NewCustomer() $Input1 = GUICtrlCreateInput("", 136, 27, 121, 21) EndFunc test functions.au3
  14. Hi there. I'm trying to make a resumable winHttp upload. But stuck at reading a file within byte ranges. Tried line functions (filereadline, _filecountlines) but nothing. The file im trying to upload is a video (binary) file. I have to read byte ranges to upload my video partially. is there any udf like fileread($file, startingbytes, endingbytes) any help will be appreciated
  15. Good evening all, My Question is how to make that my GUI Combobox gets a text of an file but If i press some functions it will Show someother Thing but from another file. ITEM1|ITEM2|ITEM3|...will be inplented in the Combobox but if it gets as example ITEM3 it will Show up the third one of 1023|7632|3123|..."3123" will be showed within a MsgBox or written to another file o_o I am asking because i don't want to make for every single ITEM of the Combobox an GuictrlRead($blabla) >.< would there be a faster way :/ Thanks in advance.
  16. Hello, My question is would it be possible to read an assembly Code of an executable? Like _AssemblyRead($Process,$PointerAdress,$Value) or _AssemblyRead($Executable,$PointerAdress,$Value) ==> _Assembly("MyTool.exe",0xB61016,"CALL 00B64974") If not would it be possible to read the HEX Data? _HEXRead("MyTool.exe", 00C1E000, 00 00 00 00|00 00 F0 7F|00 00 00 00|00 00 00 00, ð) $Process,$Adress,$HEXData,$HEXINASCII Answers to the Forum Rules: ---> I am asking this to create an Anti-Cheat/Anti-Crack for my program. So that if it get the wrong assembly Code it will Close the Program. ---> Only reading no writing. I hope someone can help me
  17. Hi, This code intented to do all the combinations of 2 digit numbers but has to be stoped anytime and must return at the point it stopped before. I thought of saving the vector`s index and passed it again when the code restarted. I was succesful in writing the vector`s index in a FileOpne.txt archive but did not manage to read it and pass the index to the $aArrayComb vector. Does anybody could help me with that ? #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.12.0 #ce ---------------------------------------------------------------------------- #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <Misc.au3> $aArrayComb = '0123456789' $aArrayComb = StringSplit($aArrayComb, "") Local Const $sFilePath = "C:\FileOpen.txt" ; Abrir O Arquivo Local $hFileOpen = FileOpen($sFilePath, $FO_READ + $FO_OVERWRITE) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "There is not a previous point break.") EndIf HotKeySet("{ESC}", "Terminate") $chave = "" For $1 = 1 To $aArrayComb[0] For $2 = 1 To $aArrayComb[0] For $3 = 1 To $aArrayComb[0] $chave &= "Combination : " & $aArrayComb[$1] & $aArrayComb[$2] & $aArrayComb[$3] & " Position : " & $1 & $2 & $3 & @CRLF Consolewrite($chave & @crlf) Next Next Next Func Terminate() $pos = $1 & $2 & $3 FileWrite("C:\FileOpen.txt", $pos) Exit EndFunc
  18. #include <WinAPI.au3> $text = FileReadLastChars("C:\Program Files\AutoIt3\Include\Array.au3", 1024) MsgBox(0, 'FileReadLastChars', $text) Func FileReadLastChars($sFile, $nChars) Local $nBytes $tBuffer = DLLStructCreate("char["&$nChars&"]") $hFile = _WinAPI_CreateFile($sFile, 2, 2) ; open for read _WinAPI_SetFilePointer($hFile, -1 * $nChars, 2) ; from end _WinAPI_ReadFile($hFile, DLLStructGetPtr($tBuffer), $nChars, $nBytes) _WinAPI_CloseHandle($hFile) Return DLLStructGetData($tBuffer, 1) EndFunc ; included as standard UDF since AutoIt 3.2.13.6 version Func _WinAPI_SetFilePointer($hFile, $iPos, $iMethod = 0) $aResult = DllCall( "kernel32.dll", "long", "SetFilePointer", "hwnd", $hFile, "long", $iPos, "long_ptr", 0, "long", $iMethod) If @error Then Return SetError(1, 0, -1) If $aResult[0] = -1 Then Return SetError(2, 0, -1) ; $INVALID_SET_FILE_POINTER = -1 Return $aResult[0] EndFunc ;==>_WinAPI_SetFilePointer Here is my topic about _WinAPI_SetFilePointer() '?do=embed' frameborder='0' data-embedContent>>
  19. Hi I'm looking to start a new (what I think will be simple) program. Basically I want to just have a text file that sits in a location, say, C:blockwindows.txt. For AutoIt I just want it to open and begin auto-closing any windows that contain the string that is put in each line within that c:blockwindows.txt. So the C:blockwindows.txt may contain these strings "some string here test" "another string here" "yet another string". So what AutoIt would do, is constantly be monitoring for any openings of windows on the computer that contains any of those strings, whether it's at the beginning or end or whereever in the Window title. These windows could open up at any time of the day. Here's what I've got so far from research, just having a challenge determining whether it's the right approach, and ultimately, figuring out how to piece it together. - I do not know what window MatchMode to use based on the strings read from the text file to determine if the string matches that of what's in the title. I could make an exact match given that I do know what prefix and suffix comes before/after the string variable if needed. $FilePath = "C:blockedwindows.txt" $FileRead = FileRead($FilePath ) $WindowName = StringSplit($FileRead , @CRLF, 1) For $i =1 To $WindowName[0] WinClose ($WindowName[$i]) Next Something like this could work I'm just worried about CPU usage. It goes about 25% of the CPU. But if I add a sleep(1000) after WinClose, it remains at 0% CPU.
  20. Here my srcipt for searching files and/or searching inside files. Made long time ago with the help of this forum. #include <File.au3> #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Global $sRet[1] = ["0"], $flag, $percent Local $j, $aArayFound[1], $a = 0, $b = 0, $sFolder = "", $debug = 0 ;~ _ArrayDisplay( $sRet , "$sRet") #Region ### START Koda GUI section ### Form= $Gui = GUICreate("Search Engine", 554, 559, -1, -1) If $debug Then $iFolder = GUICtrlCreateInput("C:\Users\Admin\au3", 160, 10, 121, 21, $ES_READONLY) $iFilter = GUICtrlCreateInput("*.au3", 160, 40, 121, 21) $iWord = GUICtrlCreateInput("gui", 160, 70, 121, 21) Else $iFolder = GUICtrlCreateInput("Folder to search in", 160, 10, 121, 21, $ES_READONLY) $iFilter = GUICtrlCreateInput("filter *.*", 160, 40, 121, 21) $iWord = GUICtrlCreateInput("word inside file", 160, 70, 121, 21) EndIf $bSearch = GUICtrlCreateButton("Search", 290, 40, 91, 50, $BS_DEFPUSHBUTTON) $bChoose = GUICtrlCreateButton("Choose Folder", 290, 10, 91, 21) $lLabel = GUICtrlCreateLabel("", 6, 130, 541, 70) $pProgress = GUICtrlCreateProgress(160, 100, 217, 25) $eEdit = GUICtrlCreateEdit("", 3, 201, 548, 354) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetLimit($eEdit, 2147000000) ;~ GUICtrlSetData( $iFolder, "C:\") ;~ GUICtrlSetData( $iFilter, "*.aif") ;~ GUICtrlSetData( $iWord, "") ;http://www.autoitscript.com/forum/topic/126552-solved-guictrlcreateinput-question/ While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $bChoose $sPath = FileSelectFolder("Choose Folder", "", 0, "", GUICreate("")) ;~ $sPath=FileOpenDialog ( "Choose", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "All (*.*)" , 7 , "", GUICreate("") ) GUICtrlSetData($iFolder, $sPath) Case $GUI_EVENT_PRIMARYDOWN $aCInfo = GUIGetCursorInfo($Gui) If $aCInfo[4] = $iFilter And $a = 0 Then GUICtrlSetData($iFilter, "") $a = 1 EndIf If $aCInfo[4] = $iWord And $b = 0 Then GUICtrlSetData($iWord, "") $b = 1 EndIf Case $bSearch $flag = 0 $f = 1 If Not (StringInStr(GUICtrlRead($iFolder), ":\")) Then $MsgBox = MsgBox(5 + 16, "Error", "The input folder is not correct:" & @CRLF & "Retry = Choose an another Folder" & @CRLF & "Cancel = Exit") If $MsgBox <> 4 Then Exit Else $f = 0 EndIf EndIf If StringInStr(GUICtrlRead($iFilter), "Filter") And $f = 1 Then $MsgBox = MsgBox(5 + 16, "Error", "The input filter is not correct:" & @CRLF & "Retry = Choose an another Filter" & @CRLF & "Cancel = Exit") If $MsgBox <> 4 Then Exit Else $f = 0 EndIf EndIf If StringInStr(GUICtrlRead($iWord), "word inside file") Then GUICtrlSetData($iWord, "") EndIf If StringRight(GUICtrlRead($iFolder), 1) = "\" Then $sFolder = StringTrimRight(GUICtrlRead($iFolder), 1) Else $sFolder = GUICtrlRead($iFolder) EndIf If $f Then GUICtrlSetData($eEdit, "Please wait...") _Search(GUICtrlRead($iWord), GUICtrlRead($iFilter), $sFolder) EndIf EndSwitch WEnd Func _Search($sSearchString, $sFindFile, $sPath) ;~ ConsoleWrite($sSearchString&"--"&$sFindFile&"--"&$sPath & @LF) Dim $aRetArray[1], $aArayFound[1] Global $sRet[1] = ["0"] $j = 0 $aRetArray = _FindPathName($sPath, $sFindFile, $sSearchString) If $aRetArray[0] = "0" Then ;~ ReDim $aRetArray[2] ;~ $aRetArray[0] = 1 ;~ $aRetArray[1] = "File not found" $sEdit = "File not found" EndIf _UpdateBar(2) If $sSearchString <> "" Then For $i = 1 To $aRetArray[0] $file = FileOpen($aRetArray[$i], 0) _UpdateBar(0, $i, $aRetArray[0]) If $file = -1 Then Else $text = FileRead($file) If StringInStr($text, $sSearchString) > 0 Then $j += 1 ReDim $aArayFound[$j + 1] $aArayFound[$j] = $aRetArray[$i] If $j=1 Then GUICtrlSetData($eEdit, "") GUICtrlSetData($eEdit, $aArayFound[$j] & @CRLF,1) EndIf EndIf FileClose($file) Next ;~ _ArrayDisplay($aArayFound, "List of file with the String: "&$sSearchString&" found") If (Not $j) Then $sEdit = "File not found" GUICtrlSetData($eEdit, $sEdit) ;~ Else ;~ $sEdit = "" ;~ For $i = 1 To UBound($aArayFound) - 1 ;~ $sEdit &= $aArayFound[$i] & @CRLF ;~ Next EndIf ;~ GUICtrlSetData($eEdit, $sEdit) _UpdateBar(2) Else ;~ _ArrayDisplay($aRetArray,"List of folders found") ;~ $sEdit = "" ;~ For $i = 1 To UBound($aRetArray)-1 ;~ $sEdit &= $aRetArray[$i] & @CRLF ;~ Next ;~ GUICtrlSetData($eEdit, $sEdit) EndIf EndFunc ;==>_Search ;~ http://www.autoitscript.com/forum/topic/95160-file-searcher ;~ In this forum All files where not Found... ;~ So here is the new way of doing it (Made By Cramaboule) ; Searches all subfolders of $sPath for $sFindFile (* and ? wildcards accepted) ; Returns an array containing full path and name of all matches. ; Number of matches is in zero index of array Func _FindPathName($sPath, $sFindFile, $sSearchInFile) Local $sSubFolderPath, $iIndex, $aFolders GUICtrlSetData($lLabel, $sPath) _UpdateBar(1) $aFolders = _FileListToArray($sPath, "*", 2) $error = @error $aFile = _FileListToArray($sPath, $sFindFile, 1) If Not (@error) Then ; no files For $k = 1 To $aFile[0] _ArrayAdd($sRet, $sPath & "\" & $aFile[$k]) If $sSearchInFile = "" Then $flag += 1 If $flag = 1 Then GUICtrlSetData($eEdit, $sPath & "\" & $aFile[$k] & @CRLF); efface uniquement la première fois ! ;~ ConsoleWrite($sPath& "\"&$aFile[$k]& @CRLF) EndIf GUICtrlSetData($eEdit, $sPath & "\" & $aFile[$k] & @CRLF, 1) ;~ ConsoleWrite($sPath& "\"&$aFile[$k]& @CRLF) EndIf Next $sRet[0] = UBound($sRet) - 1 EndIf If Not ($error) Then ; no folders For $i = 1 To $aFolders[0] $sSubFolderPath = $sPath & "\" & $aFolders[$i] _FindPathName($sSubFolderPath, $sFindFile, $sSearchInFile) Next EndIf Return $sRet EndFunc ;==>_FindPathName Func _UpdateBar($Update = 0, $actuel = 0, $total = 0) If $Update = 1 Then $percent += 1 If $percent >= 100 Then $percent = 0 EndIf ElseIf $Update = 0 Then $percent = Ceiling(($actuel / $total) * 100) GUICtrlSetData($pProgress, $percent) ElseIf $Update = 2 Then $percent = 100 EndIf ;~ ConsoleWrite($percent & " " & $actuel & " " & $total & @CRLF) GUICtrlSetData($pProgress, $percent) EndFunc ;==>_UpdateBar Enjoy. C.
  21. Hello everyone , since game's bot are not alowed on the forum (i just learned that) i prefer say right now i am not making a bot or somthing like this I want to make a tool to calculate how much gold i can win in an certain amount of time for exploit the data to do strategical change ... (just lazzy to write each amount on a paper after each attack in the game ) You can say me if i breack any rules then i wont ask anything anymore about this if so.... but i guess it dont .. simple tool so simple question.... is there any way to read with autoit the amount of gold/mana tiped in the top right corner of that picture ? HERE (62 414 gold & 57 381 mana ) I repeat i am playing myself xD
  22. Ok so thus far the script does what it's suppose to do.. to a point. There are two complications and they are as follows: There is suppose to be ONE GUI that opens up. When i run the script it opens, but when i close it another identical one opens behind it. When i click save on the first GUI it saves like it's supposed too. BUT when i close it and reopen it, it's suppose to open with the info that was saved. I'm no pro coder, maybe it's something very small i'm not getting. Some help would be highly appreciated. Yea.. i have it saving alot :3 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> Do $pass = InputBox("Enter Password", "Please enter the password", "", "*", 150, 120) If $pass <> "Password" Then EndIf If (@error == 1) Then Exit ; Until $pass == "123" MsgBox(0, "Success", "Correct password" & @CRLF & "") Global $sConfigPath = @ScriptDir & "\Settings.ini" ProgressOn("Title", "Loading program", "Loading...") For $i = 0 To 100 ProgressSet($i) Sleep(5) Next ProgressSet(50, "Half Way.") Sleep(250) ProgressSet(100, "Done!") Sleep(750) ProgressOff() #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Title", 610, 477, 206, 143) $Input1 = GUICtrlCreateInput("Date", 480, 16, 113, 21) $Input2 = GUICtrlCreateInput("Title", 16, 56, 577, 21) $Edit1 = GUICtrlCreateEdit("", 16, 80, 577, 329) $Button1 = GUICtrlCreateButton("Save", 520, 424, 75, 25, $BS_DEFPUSHBUTTON) $idProgressbar1 = GUICtrlCreateProgress(16, 424, 454, 17) $StatusBar1 = _GUICtrlStatusBar_Create($Form1) GUICtrlSetColor(-1, 32250) GUISetState(@SW_SHOW) Local $iWait = 20; wait 20ms for next progressstep Local $iSavPos = 0; progressbar-saveposition Local $idMsg, $idM ; Loop until the user exits. Do $idMsg = GUIGetMsg() If $idMsg = $Button1 Then GUICtrlSetData($Button1, "Stop") For $i = $iSavPos To 100 If GUICtrlRead($idProgressbar1) = 50 Then MsgBox($MB_SYSTEMMODAL, "Info", "half is done...", 1) $idM = GUIGetMsg() If $idM = -3 Then ExitLoop If $idM = $Button1 Then GUICtrlSetData($Button1, "Next") $iSavPos = $i;save the current bar-position to $iSavPos ExitLoop Else $iSavPos = 0 GUICtrlSetData($idProgressbar1, $i) Sleep($iWait) EndIf Next If $i > 100 Then ; $iSavPos=0 GUICtrlSetData($Button1, "Click") EndIf If GUICtrlSetData($Button1, "Click") Then IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) EndIf If IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) Then GUICtrlSetData($Button1, "Done") EndIf EndIf Until $idMsg = $GUI_EVENT_CLOSE GUICtrlSetData($Input1, IniRead($sConfigPath, "Date", "Input1", "Date")) GUICtrlSetData($Input2, IniRead($sConfigPath, "Title", "Input2", "Title")) GUICtrlSetData($Edit1, IniRead($sConfigPath, "Edit", "Edit1", "Start writing...")) While 1 $idMsg = GUIGetMsg() Switch $idMsg Case $GUI_EVENT_CLOSE ; Note: Exit needs to be changed to ExitLoop ; for any code after the loop to execute. ExitLoop EndSwitch If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop If $idMsg = $Button1 Then SendMyData() WEnd Func Button1Click() IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) EndFunc ;==>Button1Click IniWrite($sConfigPath, "Date", "Input1", GUICtrlRead($Input1)) IniWrite($sConfigPath, "Title", "Input2", GUICtrlRead($Input2)) IniWrite($sConfigPath, "Edit", "Edit1", GUICtrlRead($Edit1)) Func SendMyData() FileDelete('Settings.ini') $data = "[General]" & @CRLF & GUICtrlRead($Input2) & @CRLF & @CRLF & GUICtrlRead($Edit1) FileWrite('\Settings.ini', $data) MsgBox(0, 'Info', 'Data saved') EndFunc ;==>SendMyData #EndRegion ### END Koda GUI section ###
  23. For example my GUICtrlCreateEdit() contains: Line 1 Line 2 Line 3 When I IniWrite() the content of it, the value will be look like this: [SectionName] Key=Line 1 Line 2 Line 3 But when I IniRead() that key like this: GUICtrlCreateEdit(IniRead(@ScriptDir & "/data.ini", "SectionName", "Key", ""), 1, 1, 200, 100) The value of the GUI edit field is only "Line 1".. How can I INI write and read a text with line breaks in a GUICtrlCreateEdit() ?
  24. Hello i have made a text contains "1000 porn site" and most of sites are repeated, i wanted to read the file and search for repeated sites and delete them "but keep 1 " i just want to know how many sites have i collected cause i want to block them in my computer. is it possible? All helps are appreciated.
  25. Hello my fellow scripters. Im currently working on a script hat needs to check a specific file for changes. The idee is to let the script sleep until the specific file gets updates or changed and then resume the script. What is the mot effective way of doing this? Check the filezise is not practical since the size be the same evev if the file has been chaged. I dont want to read the entire file once every second. Any smart idees?