The ability to be able to call an alias from a specific loaded script would benefit mSL greatly; especially when it comes to modular systems, I suggest the following:
$scriptcall(@ScriptFile, @Switches:c|i[p], @AliasName, [@Parameter, ...] [@Prop])@ScriptFile - Required
The scriptfile of which to call the alias from
@Switches - Required
c: The alias is to be called as a command
i: The alias is to be called as an identifier
p: The last parameter is the prop to use when calling the alias as an identifier; only applicable if the
i switch is used
@AliasName - Required
The alias to call within the specified scriptfile
@Parameter - Optional
A list of comma delimited parameters to pass the to alias when called
For commands these will be delimited by space($chr(32)) prior to tokenization
For identifiers, each delimited parameter is a token
@Prop - Optional
The prop to use when calling the identifier as an alias
Only applicable if the
ip switches have been specified
Use case: Currently I'm working on a modular system and want to extract some script-specific information from the script. With the above it would be fairly simple
;; module.mrc
on *:START: modreg $script
;; modular_manager.mrc
alias modreg {
; calls $modinfo() from the script
var %name = $scriptcall($1, i, modinfo, name)
var %desc = $scriptcall($1, i, modinfo, desc)
var %author = $scriptcall($1, i, modinfo, author)
var %version = $scriptcall($1, i, modinfo, version)
var %license = $scriptcall($1, i, modinfo, license)
;; do stuff
; calls /modinit within the script
noop $scriptcall($1, c, modinit)
}
It also allows for the modular system to be more generic thus easier for 3rd parties to create script modules.