mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2009
Posts: 52
Z
ziv Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
I was wondering if any one has made or knows of a way to get the caller to an alias...

I want my scripts to use modified commands such as "_var" instead of the actual thing but - for what I'm planing - I need that new command to know what called it.
Lets say an alias has used "_var", I want the alias name and location.

The location is not a problem...the problem is the alias/event name.
Of course, I can add a line in the alias/event that would do the trick, but I don't want to do any more editing to the alias/command then adding the "_" before the "var".

I need some thing like "$caller" or some thing...

Any help on this would be great! wink

ziv.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I'm sort of hazy on what you try to do, but you can create an alias and use it as an identifier to return something like this:
Code:
alias -l caller { return example }
on 1:INPUT:#: { if ($+(*,$caller,*) iswm $1-) echo -a TRUE }
When you enter the word example anywhere in a sentence, it will return true, else it will return nothing.

Joined: Jul 2008
Posts: 236
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Jul 2008
Posts: 236
What your asking for, a call stack, has been requested time and time again.

Joined: Sep 2009
Posts: 52
Z
ziv Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Sep 2009
Posts: 52
And what was the response? xD cos I didn't exactly see any of those requests...
If they're not at least close to the first pages, their useless since developers wont see them.

Also, to be clearer...

Quote:

alias example _var %example 1234
alias _var set % [ $+ [ $caller ] $+ ] / $+ $1 $2-

That's just a little example.
$caller, would be "example" in this case, being the alias that triggered "_var".

ziv.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Quote:
Of course, I can add a line in the alias/event that would do the trick, but I don't want to do any more editing to the alias/command


That's what you will have to do.


Link Copied to Clipboard