mIRC Homepage

Uses file.mrc Feature

Posted By: Yochai

Uses file.mrc Feature - 17/03/05 09:13 AM

I would like to suggest a feature called "Uses" to tell a script to search other script files for aliases.
I think it would be very useful to have such a command so you can break up large script files into orginized files without making the aliases Global (removing the -l).
Every programing that I can think of uses something similar to that, so I think it would be useful in here to.
I've encountered addon scripts that come in large files because the author didn't want to make the local aliases global, so it won't interfere with other loaded scripts.
And I've also seen ones that did split to smaller files, that did their aliases did interfere with other scripts because they became global so they can be used in different parts of the script files.
Posted By: DaveC

Re: Uses file.mrc Feature - 17/03/05 12:50 PM

why not just make your alias names something no one else well ever call.

alias french.toast.with.apple.jam.custard.topping { }
Posted By: tidy_trax

Re: Uses file.mrc Feature - 17/03/05 01:02 PM

Another thing you could do is something like this:

File 1:

Code:
alias file1.glob.exec { $1- }
alias -l localalias1 {  }
alias -l localalias2 {  }


File 2:

Code:
file1.glob.exec localalias1
Posted By: qwerty

Re: Uses file.mrc Feature - 17/03/05 01:55 PM

And perhaps combine it with local aliases, so that you don't have to use that ugly name all over your code:

File 1
Code:
alias french.toast.with.apple.jam.custard.topping { do stuff here }
alias -l prettyname french.toast.with.apple.jam.custard.topping $1-


File 2
Code:
alias -l prettyname french.toast.with.apple.jam.custard.topping $1-


File 3
Code:
alias -l prettyname french.toast.with.apple.jam.custard.topping $1-
etc
This way you only use the ugly but unique name once, in the definition. Then you just use the same local alias (one definition for each script file) that points to the unique global alias.
Posted By: Yochai

Re: Uses file.mrc Feature - 19/03/05 10:59 PM

Sure there are ways of cheating around it.
There's a way of cheating around any mIRC limitation.
But still I think it could be a good and useful feature.
Maybe we won't even have to load the appending alias files, that would be even better.
Posted By: DaveC

Re: Uses file.mrc Feature - 19/03/05 11:24 PM

I dont like the idea of able to use unloaded alias files, the first thing that went through my head was the ability to abuse the process to take control.

But on having some sort of "also use file.mrc" for alias -l files i dont see as a problem, but more than likely not going to be implemented. The reply to a request for it would likely be "why not just put all the script in one MRC?"
Which I cant think of a situation in which you couldnt do, can you? <<< asked as a honest question I just cant think of one, the closest maybe would be addon scripts that want to refrence core subroutines but then, if there addon scripts those subroutines should be global or have a API to access them developed.
Posted By: nalAAlan

Re: Uses file.mrc Feature - 20/03/05 05:54 PM

You need to stop drinking and going on these boards.
Posted By: Yochai

Re: Uses file.mrc Feature - 22/03/05 07:37 PM

Well, I see nothing wrong in being able to use unloaded files.
If you are making a script that uses X files, you will find a way to use them either you load them or not.
So if you are already going to use those files anyway, what difference does it make if they are loaded or not ?
Maybe it will be even better if they are not loaded and the remotes list won't look like a mess...
But even if we agree that we don't want to use files that aren't loaded, it will still be a better way to call local aliases from different files without making them global and needing to invent all kinds of messy names.
© 2019 mIRC Discussion Forums