This is my first piece of code to add PHP-like commands to mIRC. I don't know if anyone have done this before, but I'm writing these from scratch.
Command: /require
Version: 1.0
Author: XTZGZoReX
Purpose: To require a file and continue, or halt if file was not found.
Usage: /require filename.mrc
Notes: It parses everything in the included file as commands, so please don't have anything else in the file. Also, it doesn't have any error handlers as of now, and doesn't support INI files.
Enjoy!
alias require {
if ( $exists($1) != $true ) {
echo -a * /require: error loading $1 $+ , halting script...
halt
}
elseif ( $exists($1) == $true ) {
if ( $right($1,4) != .ini ) {
var %lines = 1
while ( %lines <= $lines($1) ) {
$read($1,%lines) $+ $crlf
inc %lines
}
}
else {
halt
}
}
}