Are you trying to load your script files if they are already loaded? well thats what it looks like at least.
im going to assume the following.
(1) your attempting to reload already loaded script files
(2) the ( at the start of the IF was accidently left off in your example
(3) $mircdir has no spaces in the path which would cause it to fail
your problem might be in $mircdir/script.mrc as $mircdir ends with a \ and adding a / of your own you get \\ (/ translates to \) in there but then maybe not as the files load up under this but load twice if u have previously loaded them manually, you might not get this if you loaded yours up orginally using $mircdir/filename.mrc, check out doing ECHO $script(1) up to 17 i guess, do you have a \\ in the path?
regardless i tried your code block as follows
; filename scriptcheck.mrc
on 1:LOAD: {
if (!$script(script.mrc) != $true) { load -rs $mircdir/script.mrc }
.unload -rs scriptcheck.mrc
}
; filename script.mrc
on 1:LOAD: echo -s ONLOAD script.mrc
when doing a /load -rs scriptcheck.mrc it works fine, it loads script.mrc, and its ON LOAD triggers (after this onload completes).
I would change the code as follows as i would have thought it clearer, but your choice
; filename scriptcheck.mrc
on 1:LOAD: {
if ($script(script.mrc) != $null) { load -rs $mircdir $+ script.mrc }
.unload -rs scriptcheck.mrc
}
I used $+ to connect $mircdir & script.mrc even tho i could have used $mircdirScript.mrc as it allows them to be joined, I just dont do it, i think its bad practice to differ your code using the ODD identifier that takes extentions, i would rather have everything following one format.
PS: one odd thing i found while doing this is $script(script.mrc) returns a path\filename combo even if the script.mrc file doesnt exist let alone just not loaded, it must be some odd thing mirc does, using anyother filename i tried returns $null unless its loaded, ie $script(scripts.mrc)