Jump to content

Questions regarding .ini configuration


Recommended Posts

Hi guys, recently I started to mess around with C++, and I ended up with a 270line failure of a tool which I made.

The sole purpose of this code, was to open a game, in this case Warcraft 3.

Then to press the button "B" to enter the logon menu, which you could enter in a config.ini file, then to write the values written there, example:

[config]

username=usernamehere

password=passwordhere

Then the program would automaticly enter the Username given in the ini, press TAB, write the password and hit enter.

I did manage to make it work more or less, just that the prog pressed the wrong buttons.

Now, to my point, is it possible to make a ini reading executable that does such as stated above?

And in addition, somewhere along the lines in the ini, point to the destination of the exe and run it?

If anyone could point me in the right direction, that'd be helpful thanks.

I'm not asking for an entire source code, just pretty much for the ini write/read and enter it part :)

Thanks, sincerely

Alex.

Link to comment
Share on other sites

I don't generally get involved in threads that reference games but for the INI part of it, have a look in the help file for IniRead() and IniWrite.

$sIni = @ScriptDir & "\config.ini"
$pass = IniRead($sIni, "Config", "username", "")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I already have, but I can't seem to find any code where it WRITES from the ini, and to a active window.

Get it to read the desired section of ini to a variable, and then use the "Send" function to send the key presses

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Thanks for the quick reply JohnOne.

May you give me an example of a variable? thanks.

EDIT: Searched the help section, got 137 hits for "Variable." though none of them strikes me as "THIS IS THE ONE"

Edited by ACrapid
Link to comment
Share on other sites

Defines a variable Is your section of ini Is the key you want to read that will be sent as a variable

$R = IniRead($sIni, "Config", "the particular key", "")

Then you would use Send($R) I think cant quite remember

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...