Project

General

Profile

INI Files

/writeini

Added in 1.9.0

/writeini [-n] <inifile> <section> <item> <value>

Switches

-n - Forces AdiIRC to write to an INI file, even if it's bigger then 64k (obsolete)

Parameters

<inifile> - The file to write to.
<section> - The section to write.
<item> - The item to write.
<value> - The value to write.

Example

;Write a few items to a file.
/writeini abb.ini abbreviations lol Laughing Out Loud
/writeini abb.ini abbreviations rofl Rolling On the Floor, Laughing

;Print a line from abb.ini.
//echo -a $readini(abb.ini, n, abbreviations, lol)

/saveini

Added in 2.4

/saveini

Updates all AdiIRC-related INI files with the current settings.

Saves everything which is normally only saved when closing AdiIRC, vars.ini, main window size/position, Monitor Panels positions, Titlebar text etc.

/remini

Added in 1.9.0

/remini <inifile> <section> [item]

Deletes whole sections or single items in an INI file.

Parameters

<inifile> - Ini file where the section is located.
<section> - Section in the ini file to remove.
[item] - Item in the section to remove.

Examples

;Remove the entire section TEST in file.ini.
/remini file.ini TEST

;Remove only the testitem element from the TEST section in file.ini.
/remini file.ini TEST testitem

/flushini

Added in 1.9.6

/flushini <filename>

Does nothing since ini files are written directly in AdiIRC.

$ini

Added in 1.9.0

$ini(file,topic|N,[item|N])

Returns the name/Nth position of the specified topic/item in an INI/text file.

See also $readini.
Same as $initopic.

Parameters

file - File to read from.
topic|N - Topic or the Nth topic, if N = 0 number of topics, otherwise the Nth topic.
[item|N] - Item or the Nth item, if N = 0 number of item, otherwise the Nth item. (optional)

Examples

; Print number of topics in '$adiircini'.
//echo -ag $ini($adiircini,0)

; Print the name of the first topic in '$adiircini.
//echo -ag $ini($adiircini,1)

; Check if the topic 'Messages' exists.
//echo -ag $ini($adiirc,Messages)

$readini

Added in 1.9.0

$readini(filename, [np], section, item)

Returns a single line of text from an INI file.

See also $ini.

Parameters

filename - INI file to read from.
[np] - (optional)

n - Don't evaluate any identifiers.
p - command | separators are treated as such instead of as plain text.

section - The INI section to read from.
item - The INI item to read.

Example

; Read $adiircini and retrieve the section 'Messages' and the item 'Timestamp'.
//echo -ag $readini($adiircini, Messages, Timestamp)

$initopic

Added in 1.9.9

$initopic(file,topic|N,[item|N])

Returns the name/Nth position of the specified topic/item in an INI/text file.

See also $readini.
Same as $ini.

Parameters

file - File to read from.
topic|N - Topic or the Nth topic, if N = 0 number of topics, otherwise the Nth topic.
[item|N] - Item or the Nth item, if N = 0 number of item, otherwise the Nth item. (optional)

Examples

; Print number of topics in '$adiircini'.
//echo -ag $initopic($adiircini,0)

; Print the name of the first topic in '$adiircini.
//echo -ag $initopic($adiircini,1)

; Check if the topic 'Messages' exists.
//echo -ag $initopic($adiirc,Messages)

Updated by Per Amundsen 8 months ago · 1 revisions

Also available in: PDF HTML TXT