AlmarM Posted October 6, 2010 Share Posted October 6, 2010 If anyone in this topic needs any help at all, I would love to learn you guys the basics of AutoIt. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 If anyone in this topic needs any help at all, I would love to learn you guys the basics of AutoIt.Ok. I know how to read/set a key in the registry. But how do I do a registry scan, when I don't know how to get the full structure of the registry. Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 (edited) Ok. I know how to read/set a key in the registry. But how do I do a registry scan, when I don't know how to get the full structure of the registry. Registery scan? Scan whole register? EDIT: Does this help? Global $sReg = "HKEY_LOCAL_MACHINE\SOFTWARE" ; declare a variable with the key path to 'scan' Global $sOutput = "" ; declare an empty string to strore the found keys in For $i = 1 To 100 ; start for loop $sRead = RegEnumKey($sReg, $i) ; read the key instance If (@error <> -1) Then $sOutput &= $sRead & @CRLF ; check if the key was found and read correctly ; see help file for more information about @error return codes Next ConsoleWrite($sOutput) ; print found keys. Edited October 6, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 Thx. So all I need is to get the sub-keys of the root keys using RegEnumKey. Then loop through these sub-keys for sub-sub-keys, and so on? And RegEnumVal is to get a value inside a key? Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 Ye, basicly Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 Ok, one more question. Since there is no function FileWriteReplaceString. Basically what I want to do is replace a string in a text file (or at a complex level, a binary editing a file with hex code). The algorithm could be like this: Openfile Do a scan line per line (since I don't want to store 1Gb of data into one variable) Store what has been found If what we search for found in the current line, do a string replace Store the rest Append all what we stored and overwrite the existing file. So the question is, is that the simplest way to edit a string in a file? Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 I could make a function for you that searches inside a file for a givin string, and returns a 2D array with found strings and number of replacements. If you want... I could also comment it. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 Yes please. But is the method i mentioned above the correct way? Link to comment Share on other sites More sharing options...
Kalin Posted October 6, 2010 Share Posted October 6, 2010 Sounds like a plan. Though I'm familiar with Au3 already. But I'd still like something to do. Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 (edited) Yes please. But is the method i mentioned above the correct way?Ye, comes really close. EDIT: I'll make the function and even comment it.EDIT2: You want to replace the whole line or just a part inside the line? Edited October 6, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 I prefer part inside of line. But both if possible, they will be added to my knowledge Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 This is a start. Try to learn from this code.*If this is what you want*_File_ReplaceStringInLine(@DesktopDir & "\TestingFile.txt", "test", "melon") Func _File_ReplaceStringInLine($sFileName, $sSearchString, $sReplaceString) If (Not IsString($sFileName) Or Not IsString($sSearchString) Or Not IsString($sReplaceString)) Then Return SetError(1, 0, 0) Local $hOpen = FileOpen($sFileName, 0) Local $sRead = FileRead($hOpen) Local $sTmpData = "" If ($hOpen == -1) Then Return -1 $sTmpData = StringReplace($sRead, $sSearchString, $sReplaceString) FileClose($hOpen) FileDelete($sFileName) FileWrite($sFileName, $sTmpData) EndFuncTestingFile.txtI am testing the function to see if it works. Does my function replace all "test"'s with "melon"'s ? We'll see! Greetz, AlmarOutputI am meloning the function to see if it works. Does my function replace all "melon"'s with "melon"'s ? We'll see! Greetz, Almar Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 I see, but how is that different from my code? Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 Where's ur code? Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
trung0407 Posted October 6, 2010 Share Posted October 6, 2010 nvm, i think that's the only way. Thx for your time. Link to comment Share on other sites More sharing options...
AlmarM Posted October 6, 2010 Share Posted October 6, 2010 No problem, ask anything anytime. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Catalyst159 Posted October 7, 2010 Share Posted October 7, 2010 I have know idea what to make But something useful that newbies like me would be able to contribute to.Im going to have a little think about it.How about this idea. Just a suggestion. I would like to create an appplication that is similiar to the following:Deck DesignerBasically Deck Designer is a tool designed to help develop custom decks for the Epic Duels board game.Is creating an application like this a possibility with AutoIT?Any help, suggestions, or advice would be greatly appreciated.***You can check out the link provided above to check out the original application that I am trying to develop mine after ***Thanks.Again. Any help would be great. Link to comment Share on other sites More sharing options...
Xtian Posted October 7, 2010 Share Posted October 7, 2010 umm I want to join but i can't relate. what project are you guys trying to make? Sorry for being noob but... thanks to you im learned something new. Link to comment Share on other sites More sharing options...
Catalyst159 Posted October 7, 2010 Share Posted October 7, 2010 umm I want to join but i can't relate. what project are you guys trying to make? Are you sayng that you would be interested? Link to comment Share on other sites More sharing options...
bahtea Posted October 7, 2010 Share Posted October 7, 2010 AlmarM, love your attitude. But I'm not drawn towards your avatar...at night! Keep posting! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now