Jump to content

Recommended Posts

Posted

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

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

Open the file,do a StringReplace(@CRLF & "[",@CRLF & @CRLF & "[") in the read string then save it. Edited by danielkza
Posted

Open the file,do a StringReplace(@CRLF & "[",@CRLF & @CRLF & "[") in the read string then save it.

hmm... a little more explanation... lol sorry
Posted (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 by tlokz
Posted

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.

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