Jump to content

How to skip lines


Recommended Posts

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

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

Open the file,do a StringReplace(@CRLF & "[",@CRLF & @CRLF & "[") in the read string then save it. Edited by danielkza
Link to comment
Share on other sites

$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 by tlokz
Link to comment
Share on other sites

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
You 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

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