Jump to content

$show


Guest X-Fusion

Recommended Posts

Guest X-Fusion

Contributed by Sabby

This small tutorial assumes that you know general scripting knowledge. This is to teach you how to use a technique, not script.

 

Have you ever wondered how when you type /channel mIRC echo's in your currently active window: * Retrieving #MsR info...

And when you type /.channel It doesn't echo the information? This is done by using $show

Using $show

Not many people know about $show and half of them use it. Though using $show, in my opinion makes your scripts/addons more professional.

When using $show it returns either $true if the user uses /command and $false if the user uses /.command

If you did not know the dot(.) is used to silent the command.

Now let me give you an example: ( the following examples should be placed in Remotes (Alt+R) )

 

 

alias channel2 {

if ($show) { echo -a * Retrieving $chan info... }

channel

}

 

This alias is kind of like the mIRC alias for /channel. As you can see if you used /channel2 it would echo in your active channel * Retrieving #Channel info...

But if you used /.channel2 it wouldn't shouw the * Retrieving #Channel info...

 

You can also use !$show, for example:

 

 

alias channel3 {

if ($show) || (!$show) { echo -a * Retrieving $chan info... }

channel

}

 

Now this alias is kind of like the alias before, but this alias will always show * Retrieving #Channel info....

!$show is if they use /.channel3, the ! represents if it is $null, and if you didn't know the || represents or.

Edited by X-Fusion
Link to comment
Share on other sites

  • 2 years later...
alias channel3 {

if ($show) || (!$show) { echo -a * Retrieving $chan info... }

channel

}

 

I guess it was for demonstration purposes, but for this you wouldn't write either $show or !$show.

 

You would simply say:

 

alias channel3 { echo -a * Retrieving $chan info... | channel }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...