mIRC Home    About    Download    Register    News    Help

Print Thread
Uses file.mrc Feature #114722 17/03/05 09:13 AM
Joined: Jul 2003
Posts: 25
Y
Yochai Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Jul 2003
Posts: 25
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.

Re: Uses file.mrc Feature #114723 17/03/05 12:50 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
why not just make your alias names something no one else well ever call.

alias french.toast.with.apple.jam.custard.topping { }

Re: Uses file.mrc Feature #114724 17/03/05 01:02 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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


New username: hixxy
Re: Uses file.mrc Feature #114725 17/03/05 01:55 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Uses file.mrc Feature #114726 19/03/05 10:59 PM
Joined: Jul 2003
Posts: 25
Y
Yochai Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Jul 2003
Posts: 25
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.

Last edited by Yochai; 19/03/05 11:00 PM.
Re: Uses file.mrc Feature #114727 19/03/05 11:24 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Re: Uses file.mrc Feature #114728 20/03/05 05:54 PM
Joined: Aug 2004
Posts: 147
N
nalAAlan Offline
Vogon poet
Offline
Vogon poet
N
Joined: Aug 2004
Posts: 147
You need to stop drinking and going on these boards.

Re: Uses file.mrc Feature #114729 22/03/05 07:37 PM
Joined: Jul 2003
Posts: 25
Y
Yochai Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Jul 2003
Posts: 25
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.