Da 0wner
2008-03-26 00:45:00
Today we are going to learn about ini files. There are 4 commands.
I am going to explain how to use them.
INI files are setup like this
Etc. But of course you always want antirandoms/antiban.
So to Write to an INI file ex Change UseAntiban to true you would do this
The 1st string is the section ie where it says [Settings].
The 2nd string is the subsection where it says UseRandoms=True and
UseAntiban=False.
The 3rd string is what to change it to.
The 4th string is the file path. AppPath is where scar is stored and the file name would be Settings.ini
To get whats written there you can do this
That would read whats written in the file. ie it would return 'False'.
Now about SaveSetting. That saves a setting to the main SCARSettings ini file.
All you need to do for that is
That saves a setting in section Settings and subsection Useantiban to 'false'.
To load setting you can do this
That would store the setting in the examplestring string.
That's all there is to it to my short tut ;).
If you have any additional questions please post and i will answer.
As always, don't forget to rep and rate this excellent!
WriteINI
ReadINI
SaveSetting
LoadSetting
I am going to explain how to use them.
INI files are setup like this
[Settings]
UseRandoms=True
UseAntiban=False
Etc. But of course you always want antirandoms/antiban.
So to Write to an INI file ex Change UseAntiban to true you would do this
WriteINI('Settings', 'UseAntiban', 'True', AppPath + 'Settings.ini');
The 1st string is the section ie where it says [Settings].
The 2nd string is the subsection where it says UseRandoms=True and
UseAntiban=False.
The 3rd string is what to change it to.
The 4th string is the file path. AppPath is where scar is stored and the file name would be Settings.ini
To get whats written there you can do this
ExampleString := ReadINI('Settings', 'UseAntiban', AppPath + 'Settings.ini'));
That would read whats written in the file. ie it would return 'False'.
Now about SaveSetting. That saves a setting to the main SCARSettings ini file.
All you need to do for that is
SaveSetting('Settings', 'UseAntiBan', 'False');
That saves a setting in section Settings and subsection Useantiban to 'false'.
To load setting you can do this
ExampleString := LoadSetting('Settings', 'UseAntiBan');
That would store the setting in the examplestring string.
That's all there is to it to my short tut ;).
If you have any additional questions please post and i will answer.
As always, don't forget to rep and rate this excellent!