tlokz Posted June 29, 2008 Share Posted June 29, 2008 I have it create an ini and would like to know if you can have it skip lines... atm it's really cluttered and would like to make a line space between sections... the ini is generated on first run Link to comment Share on other sites More sharing options...
danielkza Posted June 29, 2008 Share Posted June 29, 2008 (edited) I have it create an ini and would like to know if you can have it skip lines... atm it's really cluttered and would like to make a line space between sections... the ini is generated on first runOpen the file,do a StringReplace(@CRLF & "[",@CRLF & @CRLF & "[") in the read string then save it. Edited June 29, 2008 by danielkza Link to comment Share on other sites More sharing options...
tlokz Posted June 29, 2008 Author Share Posted June 29, 2008 Open the file,do a StringReplace(@CRLF & "[",@CRLF & @CRLF & "[") in the read string then save it. hmm... a little more explanation... lol sorry Link to comment Share on other sites More sharing options...
danielkza Posted June 29, 2008 Share Posted June 29, 2008 hmm... a little more explanation... lol sorry$FileContent = FileRead("My INI File.ini") $FileContent = StringReplace($FileContent,@CRLF & "[",@CRLF & @CRLF & "[") FileWrite("My INI File.ini",$FileContent) Link to comment Share on other sites More sharing options...
tlokz Posted June 29, 2008 Author Share Posted June 29, 2008 (edited) $FileContent = FileRead("My INI File.ini") $FileContent = StringReplace($FileContent,@CRLF & "[",@CRLF & @CRLF & "[") FileWrite("My INI File.ini",$FileContent) is there an easier way then this? If Not FileExists($inilock) Then _FileCreate($inilock) IniWrite($inilock, "Settings", "Sleep", 6) IniWrite($inilock, "Settings", "ArchiveLogs", 1) IniWrite($inilock, "Settings", "RDProtection", 1) IniWrite($inilock, "Settings", "CleanTray", 1) IniWrite($inilock, "Settings", "BncacheClean", 1) IniWrite($inilock, "BotSettings", "RunGUIStats", 1) IniWrite($inilock, "BotSettings", "MaxGameLength", 10) IniWrite($inilock, "BotSettings", "TempBanDelay", 30) IniWrite($inilock, "BotSettings", "RedVex", "") IniWrite($inilock, "BotSettings", "RedVexDir", "") IniWrite($inilock, "MessengerSettings", "MessengerWindow", "") IniWrite($inilock, "MessengerSettings", "MessengerInterval", 60) IniWrite($inilock, "MessengerSettings", "PauseMessage", "Bot Paused!") IniWrite($inilock, "MessengerSettings", "ResumeMessage", "Bot Resumed!") $FileContent = FileRead($inilock) $FileContent = StringReplace($FileContent, @CRLF & "[", @CRLF & @CRLF & "[") FileDelete($inilock) _FileCreate($inilock) FileWrite($inilock, $FileContent) GenIni() EndIf Edited June 29, 2008 by tlokz Link to comment Share on other sites More sharing options...
danielkza Posted June 29, 2008 Share Posted June 29, 2008 is there an easier way then this? If Not FileExists($inilock) Then _FileCreate($inilock) IniWrite($inilock, "Settings", "Sleep", 6) IniWrite($inilock, "Settings", "ArchiveLogs", 1) IniWrite($inilock, "Settings", "RDProtection", 1) IniWrite($inilock, "Settings", "CleanTray", 1) IniWrite($inilock, "Settings", "BncacheClean", 1) IniWrite($inilock, "BotSettings", "RunGUIStats", 1) IniWrite($inilock, "BotSettings", "MaxGameLength", 10) IniWrite($inilock, "BotSettings", "TempBanDelay", 30) IniWrite($inilock, "BotSettings", "RedVex", "") IniWrite($inilock, "BotSettings", "RedVexDir", "") IniWrite($inilock, "MessengerSettings", "MessengerWindow", "") IniWrite($inilock, "MessengerSettings", "MessengerInterval", 60) IniWrite($inilock, "MessengerSettings", "PauseMessage", "Bot Paused!") IniWrite($inilock, "MessengerSettings", "ResumeMessage", "Bot Resumed!") $FileContent = FileRead($inilock) $FileContent = StringReplace($FileContent, @CRLF & "[", @CRLF & @CRLF & "[") FileDelete($inilock) _FileCreate($inilock) FileWrite($inilock, $FileContent) GenIni() EndIfYou don't have to delete and recreate the file to write to it,u can cut that part of.And no,there's no easier way,you have to write string by string to the ini file. 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