![]() |
|
//WHOIS Nickname
//CTCP PING Nickname
//CTCP VERSION Nickname
//CTCP FINGER Nickname
It may be annoying to type all these commands each time.
/<
    whois $1;
    ctcp PING $1;
    ctcp VERSION $1;
    ctcp FINGER $1;
    echo $_window Sent BIGINFO request for $1. Waiting for reply...;
>
The $1 variable will be evaluated to the first parameter that you pass to the alias.
    /part $0;
This is a simple part shortcut.
/P #kaos Bye to all!;
And $0 will evaluate to '#kaos Bye to all!'.
    /part $1 $2-;
$1 will evaluate to '#kaos' and $2- to all the words following the first : 'Bye to all!'.
/<
    if ($2)part $1 $2-;
    else part $1 Bye to all!
>
In this way ,if you don't specify a part message (starting from the second parameter) ,
*
You can call other aliases from an alias , and if you want you can use it recursively ,
but there is no infinite-recursion check as in mIrc , so you MUST exit from the recursion sooner or later.
An infinite recursion loop WILL hang kvirc!.
*
A command is terminated either by a ';' or a newline.
The correct syntax requires to start an alias with a '/' and include it into a block of commands.
However ,from this version , the block become optional,and you can write the alias
text just like it were typed in a channel window : only the leading '/' is needed.
So these three versions of the 'HOP' alias are valid:
/<
    set $last.chan $_chan;
part $last.chan; join $last.chan;
unset $last.chan
>
is equivalent to
/set $last.chan $_chan
part $last.chan
join $last.chan
unset $last.chan
is equivalent to
/<
    set $last.chan $_chan;
    part $last.chan;
    join $last.chan;
unset $last.chan;
>
*
An alias is always bound to the window that is executed in.
If it is executed from anoter alias or event , it gets the window of the calling command.
So every call to $_window , $_chan or $_target will return that window/channel/target name.
*
$0 is equivalent to $1-.
$0- will give you all the parameters repeated twice!.
*
It is NOT a good idea to pass $_null as an alias parameter.
Since it will give problems in handling the $X- variables.
For example if you call the 'P' alias in the following way:
/P $_chan Turning to $_null guys!.
$2- evaluation will be stopped by the $_null parameter,
so the part message will be truncated to 'Turning to'.
However $4 will still return 'quys!' , so it can be used is some way.
Finally , don't use it if you don't really need to.
*
The aliases are parsed sequentially at runtime and executed WHILE parsing it.
There is no previous syntax check or tree-building.
The execution stops at the first error encountered in the parsed command sequence.
It may happen that an alias contain a syntax error in an if
conditional subtree , and that is never executed . In that case you will never see that error!
Example: This will execute correctly.
if ($_false)< stupid_command_parser blahblahblahblah > ;
else echo $_window OK, it is false!.