Writeini

From Scriptwiki
Revision as of 09:11, 2 July 2007 by Cail (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Writes to files in the standard INI file format.

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

If the -n switch is specified, mIRC will attempt to write to the .ini file even if it is larger than 64k.

If you write to an ini file that doesnt exist, it will create this file.

Be aware of choosing your section names, as you cannot use every character (e.g. [ or ]). That means that you cannot use channelnames as sectionnames.

Note that you should not use this command to modify any of the ini files currently being used by mIRC.

Example

/writeini user.ini address Dana dana@staff.quakenet.org

This would write Dana=dana@staff.quakenet.org in the section called "address" in user.ini

The next, more complex example writes all people currently being in #help.script in user.ini in the section address with their current address:

var %i = 1
; begin a while loop through all users in #help.script
while (%i <= $nick(#help.script,0)) {
 ; actually write it to the file
 writeini user.ini address $nick(#help.script,%i) $address($nick(#help.script,%i),5)
 ; increase the looping-variable
 inc %i
}

Be sure, that all these addresses are in your IAL. If not, you need to execute /who #help.script first.

See Also

  • /remini to remove an entire section or a single item.
  • $readini and $ini to read from an ini file.