m |
m |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | '''$script''' can be used to return the filename of the Nth loaded script file. If you specify a filename, it returns $null if the file is not loaded; otherwise it returns the file's name. | + | {{mirc title|$script identifier}}'''$script''' can be used to return the filename of the Nth loaded script file or the script file the identifier is being called from. If you specify a filename, it returns $null if the file is not loaded; otherwise it returns the file's name. |
== Synopsis == | == Synopsis == | ||
Line 13: | Line 13: | ||
== Example == | == Example == | ||
− | + | Echo script files this identifier is being called from: | |
+ | <pre>alias test { | ||
+ | echo -a $script | ||
+ | } | ||
+ | /test</pre> | ||
+ | |||
+ | Echo the total number of script files currently loaded to the active window: | ||
<pre>//echo -a $script(0)</pre> | <pre>//echo -a $script(0)</pre> | ||
− | + | Echo the 2nd script file name to the active window: | |
<pre>//echo -a $script(2)</pre> | <pre>//echo -a $script(2)</pre> | ||
− | + | Echo if ''myfile.mrc'' is currently a loaded script to the active window: | |
<pre>//echo -a $script(myfile.mrc)</pre> | <pre>//echo -a $script(myfile.mrc)</pre> | ||
== See also == | == See also == | ||
− | * | + | * {{mIRC|$alias}} |
+ | {{mIRC identifier list}} | ||
− | [[Category:mIRC identifiers]] | + | [[Category:mIRC identifiers|script]] |
Latest revision as of 13:10, 22 September 2017
$script can be used to return the filename of the Nth loaded script file or the script file the identifier is being called from. If you specify a filename, it returns $null if the file is not loaded; otherwise it returns the file's name.
Contents
Synopsis[edit]
$script(N/filename)
Switches[edit]
None
Parameters[edit]
NThe Nth script file you want to check. If N is 0, this will return the total number of script files currently loaded.
filenameSpecify an actual filename if you want to explicitly check if a script file is loaded. This will return $null if no file is loaded, otherwise it returns the file name.
Example[edit]
Echo script files this identifier is being called from:
alias test { echo -a $script } /test
Echo the total number of script files currently loaded to the active window:
//echo -a $script(0)
Echo the 2nd script file name to the active window:
//echo -a $script(2)
Echo if myfile.mrc is currently a loaded script to the active window:
//echo -a $script(myfile.mrc)