mIRC Home    About    Download    Register    News    Help

Print Thread
#117678 18/04/05 06:43 AM
Joined: Oct 2004
Posts: 24
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Oct 2004
Posts: 24
I would like to suggest a new identifier to make mIRC more modular.

an identifier that will return the "caller alias" like $calias

in this example I'll show you...

alias mycommand {
testalias bleh
}

alias testalias {
writeini test.ini test test $calias
$calias would have return "mycommand"
}

does anything like this already exists ?? confused

Would be great if not wink


the way it's supposed to be !

UnderNet #scripting - #mircscripting
#117679 18/04/05 08:37 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I dont even think theres one to tell you the alias your in at that moment let alone the calling one.

#117680 18/04/05 09:18 AM
Joined: Dec 2002
Posts: 208
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 208
I think that both would be great: just as there is $event, there should be $alias for returning the name of the current alias ($alias() already exists, but that shouldn't get in the way, just as $server and $server() coexist.)

I can also see a use for finding out where the current alias was called, which was the original suggestion. Something different would have to be done for aliases called from events/editboxes, though. I would think it should return "on <event>" for calls from events and "edit box" for those from editboxes, the idea being that an alias name can't be two words.


If I knew now what I will know then... maybe things will have been different...
#117681 18/04/05 11:01 PM
Joined: Oct 2004
Posts: 24
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Oct 2004
Posts: 24
another thing that could be useful is adding 2 properties for further error processing.

.sname -> script name from where it has been called
.line -> line from where the command has been executed


the way it's supposed to be !

UnderNet #scripting - #mircscripting
#117682 19/04/05 08:16 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
If you're talking about the script that the current alias was called from:
1. /help $script
2. /help $scriptline

If you're talking about the file/linenumber of the parent of the current alias, then yes, this should be implemented as properties to $calias()

Last edited by qwerty; 19/04/05 08:19 AM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#117683 11/08/06 09:14 AM
Joined: Oct 2004
Posts: 24
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Oct 2004
Posts: 24
$calias(N)

returns information about the parents calling aliases

where N is the number associated the Nth caller of the alias
$calias(0) would return the number of parents


alias t1 {
t2 1
}

alias t2 {
t3 2
}

alias t3 {
echo -a $calias(1) return alias t1
echo -a $calias(1).sline the number of the line where it was called
echo -a $calias(1).sname the script name also
}

that would help people out to see where they di an error, as one alias can be used in many other alias and we don<T always know from where it was triggered

maybe adding also a $calias(0).event property so we can see by what event it was called from the start. as well as $calias(0).eventline and $calias(0).eventsname

Last edited by darkrift; 11/08/06 09:31 AM.

the way it's supposed to be !

UnderNet #scripting - #mircscripting
#117684 11/08/06 09:53 PM
Joined: Jul 2006
Posts: 11
R
Pikka bird
Offline
Pikka bird
R
Joined: Jul 2006
Posts: 11
This is a neat idea, I fully support it.
Sometimes some generic aliases are used from a lot of different places, so this could be used to dump a stack trace for debugging (well, you get the idea).


Link Copied to Clipboard