Jump to content

Recommended Posts

Posted

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.

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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.
Posted (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 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.

Posted

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?

Posted

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?

Posted

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.

Posted (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 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.

Posted

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)
EndFunc

TestingFile.txt

I am testing the function to see if it works.
Does my function replace all "test"'s with "melon"'s ?
We'll see!

Greetz,
Almar

Output

I 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.

Posted

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 Designer

Basically 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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...