File and Directory Identifiers

 

$abook(nick,N)

Returns information about nicknames listed in the address book.

 

Properties: nick, info, email, website, picture, noteN

 

Allowed formats: $abook(nick) $abook(N) $abook(nick,N) where nick can also be a wildcard.

 

$alias(N/filename)

Returns the filename for the Nth loaded alias file. If you specify a filename, it returns $null if the file is not loaded.

 

$alias(0)        return the number of alias files loaded

$alias(2)        returns the filename of the 2nd loaded alias file

$alias(moo.txt)        returns $null if the file is not loaded, or moo.txt if it is.

 

$crc(text|&binvar|filename,[N])

Returns the CRC checksum of the specified item, where N = 0 for plain text, 1 for &binvar, 2 for filename (default).

 

Note: $crc64() can also be used to return the 64bit checksum.

 

$disk(path|N)

Returns information about the specified hard disk, where N = 0 for total available drives, and N > 0 to access each drive.

 

Properties: type, free, label, size, unc, path

 

$disk(c:)  returns $true if drive c: exists, otherwise $false

 

The unc property returns the path for a network drive.

 

$exists(file/dir)

Returns $true if a file or dir exists and $false if it does not.

 

$exists(mirc.exe)  returns $true or $false.

 

$file(filename)

Returns information about the specified file.

 

Properties: size, ctime, mtime, atime, shortfn, longfn, attr, sig, version, path, name, ext

 

$file(mirc.exe).size          returns the file size

$file(mirc.exe).ctime          returns creation time

$file(mirc.exe).mtime          returns last modification time

$file(mirc.exe).atime          returns last access time

 

$filtered

Returns the number of lines that were filtered when using the /filter command.

 

$finddir(dir,wildcard,N,depth,@window | command)

Searches the specified directory and its subdirectories for the Nth directory name matching the wildcard specification and returns the full path and directory if it is found.

 

Properties: shortfn

 

$finddir($mircdir,logs*,1)  returns the first directory name beginning with "mirc"

 

If you specify a custom @window (with a listbox) instead of the N parameter, mIRC will fill the custom @window listbox with the results.

 

If you specify a command, the command is performed on every directory that is found. You can use $1- to refer to the directory name, eg. //echo 1 $finddir($mircdir,*.*,0,echo $1-)

 

If you use /halt in the command/alias, this halts the search.

 

If you specify a depth, mIRC will only search N directories deep for matching filenames.

 

The $finddirn identifier returns the Nth position of directory that was found.

 

Note: Both the depth and @window/command parameters are optional.

 

$findfile(dir,wildcard,N,depth,@window | command)

Searches the specified directory and its subdirectories for the Nth filename matching the wildcard file specification and returns the full path and filename if it is found.

 

Properties: shortfn

 

$findfile($mircdir,*.exe,1)  returns the first .exe file it finds

 

If you specify a custom @window name (with a listbox), the custom @window listbox will be filled with the results.

 

If you specify a command, it will be performed on every filename that is found. You can use $1- to refer to the filename, eg. //echo 1 $findfile($mircdir,*.*,0,echo $1-)

 

If you use /halt in the command/alias, this halts the search.

 

If you specify a depth, mIRC will only search N directories deep for matching filenames.

 

You can specify multiple wildcards by separating them with semi-colons, eg. *.exe;*.txt;*.hlp.

 

The $findfilen identifier returns the Nth position of file that was found.

 

Note: Both the depth and @window/command parameters are optional.

 

$getdir

Returns the DCC Get directory specified in the DCC Options dialog.

 

$getdir(filename)

Returns the DCC Get directory for the specified filename. You can also specify a file type such as *.txt.

 

$ini(file,topic/N,item/N)

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

 

$ini(mirc.ini,0)  returns total number of topics in mirc.ini

$ini(mirc.ini,1)  returns name of 1st topic in mirc.ini

$ini(mirc.ini,help) returns Nth position of topic help if it exists, or returns 0 if it does not exist

 

The item/N parameter is optional. If you specify N = 0, it returns the total number of topics/items.

 

Note: The behaviour of this identifier varies across versions, where either 0 or $null may be returned for a non-existent item.

 

$isdir(dirname)

Returns $true if the specified directory exists, otherwise $false.

 

$isfile(filename)

Returns $true if the specified file exists, otherwise $false.

 

$lines(filename)

Returns the total number of lines in the specified text file.

 

$logdir

Returns the Logs directory as specified in the Logging section of the Options dialog.

 

$longfn(filename)

Returns long version of a short filename.

 

$mididir

Returns the Midi directory specified in the Sound Requests section of the Options dialog.

 

$mircdir

Returns the directory where mIRC stores its settings, such as mirc.ini, and other files and folders.

 

$mircexe

Returns the full path and filename of the mIRC executable file.

 

$mircini

Returns the name of the main .ini file, usually mirc.ini.

 

$mklogfn(filename)

Returns the filename format that the logging feature uses. Appends date to filename if you have the dated logfiles option turned on in the logging dialog.

 

You can also use $mknickfn(nickname) to fix a nickname for use as a filename, and $mkfn(filename) to fix a filename, both of which may replace/remove invalid characters.

 

$msfile(dir,title,oktext)

Displays the multiple select file dialog and returns N, the number of selected files. $msfile(N) returns each file. If too many files are selected, $msfile() returns -1. Title and oktext are optional. See $sfstate for cancel/error handling.

 

$nofile(filename)

Returns the path in filename without the actual filename.

 

$nopath(filename)

Returns filename without a path, if it has one.

 

$read(filename, [ntswrp], [matchtext], [N])

Returns a single line of text from a file.

 

This identifier works in conjunction with the /write command.

 

//echo $read(funny.txt)

 

Reads a random line from the file funny.txt.

 

//echo $read(funny.txt, 24)

 

Reads line 24 from the file funny.txt.

 

//kick # $1 $read(kicks.txt)

 

Reads a random kick line from kicks.txt and uses it in the kick command.

 

//echo $read(info.txt, s, mirc)

 

Scans the file info.txt for a line beginning with the word mirc and returns the text following the match value.

 

//echo $read(help.txt, w,  *help*)

 

Scans the file help.txt for a line matching the wildcard text *help*. The r switch implies a regex match.

 

If you specify the s, w, or r switches, you can also specify the N value to specify the line you wish to start searching from in the file, eg.:

 

//echo $read(versions.txt, w, *mirc*, 100)

 

If the n switch is specified then the line read in will not be evaluated and will be treated as plain text.

 

If the p switch is specified, command | separators are treated as such instead of as plain text.

 

If the first line in the file is a number, it must represent the total number of lines in the file. If you specify N = 0, mIRC returns the value of the first line if it is a number.

 

If the t switch is specified then mIRC will treat the first line in the file as plain text, even if it is a number.

 

$readn

Returns the line number that was matched in a previous call to $read(). If no match was found, $readn is set to zero.

 

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

Returns a single line of text from an ini file

 

This identifier works in conjunction with the /writeini command.

 

//echo $readini(mirc.ini, mIRC, nick)

 

Reads your nickname from the mirc.ini file.

 

If the n switch is specified then the line read in will not be evaluated and will be treated as plain text.

 

If the p switch is specified, command | separators are treated as such instead of as plain text.

 

$samepath(path1,path2)

Returns $true/$false if paths refer to the same file/dir. It resolves relative paths and converts long/short filenames.

 

$sdir(dir,title)

Displays the select folder dialog and returns the selected folder. Title is optional. See $sfstate for cancel/error handling.

 

$sfile(dir,title,oktext)

Displays the select file dialog and returns the selected filename. Title and oktext are optional. The dir can include a wildcard as a file mask.  See $sfstate for cancel/error handling.

 

$sfstate

Returns cancel if a user cancels the dialog or error if there is an error.

 

$shortfn(filename)

Returns short version of a long filename.

 

$sysdir(item)

Returns system folders for the current user where item can be profile, desktop, documents, downloads, music, pictures, and videos.

 

$tempfn

$tempfn(path)

Returns a unique temporary file/folder name located in the mIRC folder, using the same method that mIRC uses internally. To use a different folder, specify its path as a parameter.

 

$zip(file.zip,cetlpo,file|dir,password,N)

Enables creation and extraction of zip files.

 

Properties: size, crc, mtime, cm, em, idx

 

Supports the following switches: c = create, e = extract, t = test, l = list, p = password, o = overwrite existing file/dir.

 

The N parameter is used with the list option, where 0 = return number of items, otherwise return Nth item, with properties: size.

 

If password is specified when creating a zip, encrypts the zip file using AES.