ACrapid Posted October 5, 2009 Share Posted October 5, 2009 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 More sharing options...
dantay9 Posted October 5, 2009 Share Posted October 5, 2009 Take a look at IniRead, IniWrite, and IniReadSection. Those should give you what you need to edit any .ini file. Link to comment Share on other sites More sharing options...
GEOSoft Posted October 5, 2009 Share Posted October 5, 2009 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 More sharing options...
ACrapid Posted October 5, 2009 Author Share Posted October 5, 2009 I already have, but I can't seem to find any code where it WRITES from the ini, and to a active window. Link to comment Share on other sites More sharing options...
JohnOne Posted October 5, 2009 Share Posted October 5, 2009 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 More sharing options...
ACrapid Posted October 5, 2009 Author Share Posted October 5, 2009 (edited) 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 October 5, 2009 by ACrapid Link to comment Share on other sites More sharing options...
dantay9 Posted October 5, 2009 Share Posted October 5, 2009 ;$Variable = IniRead(put in the parameters here) $Variable = "THIS IS A VARIABLE" ConsoleWrite($Variable & @CRLF) Link to comment Share on other sites More sharing options...
ACrapid Posted October 5, 2009 Author Share Posted October 5, 2009 (edited) Haha, thanks guys. I'm sorry for my noobyness, but at this "THIS IS A VARIABLE" What should I put in THISISAVARIABLE ? The sections of the .ini or what? Edited October 5, 2009 by ACrapid Link to comment Share on other sites More sharing options...
dantay9 Posted October 5, 2009 Share Posted October 5, 2009 whatever you want. The equals sign assigns whatever is to the left to the variable on the right. You need to search the help file now because every example in the help file uses variables. Link to comment Share on other sites More sharing options...
JohnOne Posted October 5, 2009 Share Posted October 5, 2009 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 More sharing options...
ACrapid Posted October 5, 2009 Author Share Posted October 5, 2009 So, "The particular key" in this case, would be "Username=" But, there's two sections, username and password Link to comment Share on other sites More sharing options...
dantay9 Posted October 5, 2009 Share Posted October 5, 2009 (edited) The Section would be "Config". This is the only section from this example: [config] username=usernamehere password=passwordhere The Key would be either "username" or "password". Edited October 5, 2009 by dantay9 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