Commands


In addition to the features that are accessible through the user interface, IRC itself implements many features and functions that are only available through typed commands. A command is a typed message that starts with the / character. Snak comes with many built in commands – way too many to describe here, and on top of that are all the aliases (user defined commands that extend or replace the built in ones).

Command Reference


The Command Reference provides a convenient location where you can browse all the available commands and learn what they do. It can be opened from the help menu. In addition to commands and aliases it can also be useful to know what variables that the various scripts and aliases define, and what built in functions are available.

When you write scripts you can take advantage of built in functions. Built in functions are not commands because you can't call functions directly from the command line. They can only be called from within a script (which you can then call from the command line). The full list of functions is displayed if you select Functions in the second popup in the Command Reference window.
CommandReference

In this example you can see some of the many commands that are available to you. You will notice two different kinds of descriptions in the list. The first, exemplified by SIGNOFF – Synonym for /QUIT is that of a built in command. The built in commands have a short syntax description or help text in the description column. The second is exemplified by SING which is an alias. An alias is a user defined command made up of a snippet of script code. For an alias, the command reference will display the script code that the alias stands for.

You can learn all about scripting in the scripting chapter, but as an example here is a brief explanation of the snippet of script code for the SING alias in the above picture. The Command Reference displays the alias on a single line of code but it's easier to understand the structure by writing it on multiple lines.

alias sing {
if ([$*])
{ me sings $*}
{ me sings "O sole mio, sta'n fronte a te..."}
}

The "if" statement consists of a test statement and one or two blocks of code. A block is everything that is between a { and a }. If the test statement is true then the first block is executed, and if not then the second block is run.

In this case the test statement checks if you have provided a parameter to the alias. That means if you have typed "/sing a lullaby", then "a lullaby" is the parameter being passed in. The parameter will used for part of the output and you'll see "/me sings a lullaby". If you did not provide a parameter the output will be the generic "/me sings O sole mio..". The cryptic $* stands for all the words in the parameter.

Each profile in Snak has its own collection of commands and variables and connections can’t reference each others contents. Therefore there is a popup menu in the Command Reference to switch between the various profiles.

To see the scripts that come as part of the Snak package, go to the Scripts folder and choose "Show Script Folder". You can add your own scripts to this folder. Each profile looks in the Scripts folder and automatically loads the contents of the script files called action and basical when it's created, so the connections will have a common subset of commands.

If you were to for example load the PurePak script package into one connection but not another, then you would see a large number of additional aliases for the first connection. The command to load a script into a connection is /load. The command /load purepak.irc will thus load the PurePak package.

Basic commands


/NICK: The Setup Assistant asked you to choose a nickname under which you would be known on IRC, and this nickname has been filled into the connection profiles, from where it can be changed at any time.

To temporarily change your nick when you are online you can use the /nick command.
The syntax is /nick newnickname
Most networks limit you to 9 characters from the English character set but some network like DALNet supports up to 30 characters. If your new nickname is too long, the server will simply truncate it.

/JOIN, /PART or /LEAVE: /join channelname and /part were covered in the chapter on joining channels. The chapter also describes other ways of joining channels. There is also /leave which is synonymous with /part.

/LIST: /list "parameters" can be used directly instead of opening the List Channels dialog. That dialog will ultimately send a /list command to the server but you can also send the command yourself.

The various networks supports different parameters for the /list command so in order to use the command to the fullest you may need to ask around.

/BYE: Of course, like any other Macintosh program you can just use the Quit menu item and the program will quit. If you have an active connection then the program will ask for the quit message in a dialog.

In the interest of completeness Snak also supports the old style /bye IRC command. /bye will quit the program and can be used with an optional quit message like this: /bye got to get some work done.

The quit message is sent to all the channels that you are a member of and the other participants will see a message like : *** YourNick has quit IRC (got to get some work done)

/ME: /me is used when you want to send a message that is not directly conversational. Such messages are called action messages and look like this: * YourNick sighs…
The syntax for action messages is /me message

/MSG: This command is used for private messages as described in the chapter on that subject.

/OOPS: If you accidentally send a private message to the wrong recipient you can use this command to resend the message to the intended recipient. See the section on private messages for more information.

Intermediate commands


/WHOIS: If you are curious about someone else’s identity IRC obligingly provides several tools for snooping. One that everybody uses all the time is /whois.
Syntax is / whois nick
/whois will give you information about the channels that a user is in, the operator status and information about the server that he or she is connected to. The command has a variant where you enter the nickname twice. That will tell you the amount of time the user has been idle.

/WHOWAS You can obtain the /whois information for someone who just left IRC for a short while using the /whowas command. It's not very reliable because the information is cached by the servers only a short time.

/AWAY: Even the most dedicated of us have to leave our keyboards sometimes, and it's usually more convenient to just leave Snak running while you slip off to, let’s say make coffee, rather than quitting the program and then running it again five minutes later. However, if one of your IRC friends sent you a private message during that time, you obviously will not reply and you might worry about appearing rude.

There are two uses of the away command. The command to mark yourself as away from the keyboard is "/away making coffee"

Anybody messaging you will automatically get a message saying *** YourNick is away: making coffee. In order to mark your return to the keyboard simply type /away
So, use /away with a message to mark yourself as away, and use it without a message to return.

If you expect to be away from the keyboard for extended periods of time it might make sense to close the channels you are in. If you do not then the private messages you receive during that time might get lost in the normal channel traffic. If you close the channels, then private messages will get routed to the console window that normally do not receive other messages except occasional server messages.

/MODE: If you have the server message panel open when joining a server, among other things you will see a message saying something like this: *** umodes available oiws, channel modes available biklmnopstv
This cryptic message refers to the various possible modes, or attributes, that channels and users can have, and since not all servers (or all clients) recognize all the modes, this is the servers personal menu that is being displayed for you.

User modes


A user mode is a mode that applies to you, the user. The user-mode "+o" means that you are an IRC operator. This mode is different than the channel operator mode, which confusingly also uses the o designator. IRC operators have wide ranging privileges and rank above channel operators. The o mode is not under your control, but the modes i, w and s are.

Mode "+i" means that you are "invisible" and in general will not appear on peoples /who lists. Certain servers set the invisible user mode by default.
Mode "+s" means that you receive server notices. These are technical messages, that flow between servers, forming a constant, normally unseen undercurrent.
Mode "+w" is obsolete. It used to control the delivery of wallops which were messages sent to every irc operator simultaneously.

In order to set a particular mode use the command /mode YourNick +modeflag
To remove a particular mode use /mode YourNick –modeflag

Channel modes


The channel modes are more interesting than the user modes but they are exclusively under the control of the channel operators. They offer subtle ways of restricting channel activity. In Snak you have easy access to the most common channel modes from the channel management dialog.
Two modes that are almost universally used now is +n and +t.

Mode "+n" prevents messages from people outside the channel from being sent into the channel. This only prevents messages to the channel at large, not individual private messages to channel members.

Mode "+t" limits the ability to change the channel topic to channel operators only. If this is not set then anyone can change the topic of the channel. In Snak, changing the topic could also be done from the channel management dialog.
The rest of the channel modes make a channel increasingly restrictive.

Mode "+m" does not restrict access to the channel, but the channel is "moderated" meaning that only channel operators and users having the +v (voice) flag set (see next chapter). This mode is often set on a channel that serve as a news outlet or is running some theatrical performance or similar where only a few of the members should be speaking.

Mode "+l" takes a second parameter like "+l 20" and is used to set a limit on the channel population. In the example the channel limit would be set to 20. If that number is reached then the server will not let additional users join.

Mode "+i" means that the channel can be joined by invitation only. To extend an invitation to someone you can use the /invite command.

Mode "+k" takes a second parameter like "+k SECRETPASSWORD". This mode locks the channel so that the key "SECRETPASSWORD" is required to enter it. Anybody attempting to join the channel will have to use this command: /join channel SECRETPASSWORD

Mode "+p" makes the channel private. The channel is omitted from the channel list that the server returns but you may be able to see who is in the channel if you know the channel name.

Mode "+s" is the most exclusive of all – a secret channel. It's omitted from the channel list and you can not find out who is in it even if you know the channel name.
This mode is used, for example, for business meetings where everything happens by prearrangement and the users or the channel do not want to be part of the generality of IRC.
Unless a key has been set on a private or secret channel you can join it as long as you know the name.

To set a channel mode use the command /mode channel +l 20
To remove a channel mode use the command /mode channel -l

Hybrid modes


There are three modes that are kind of hybrid, meaning they are user modes that apply only in a particular channel.
Like the regular channel modes, these hybrid modes can only be used by channel operators.

Mode "+v" controls the voicing and unvoicing of a user. If the channel is moderated (see the previous chapter) then the user can speak. It does not affect anything if the channel is not moderated. Some channels use the voice flag as a temporary rank on the way to becoming a channel operator.

Mode "+o" bestow channel operator rights upon the lucky individual. The new operator can now participate in the channel management.

Mode "+b" is something that you do not want given to you. It's a banishment from the channel :-( The server maintains a list of banned addresses for each channel and will entirely prevent you from joining a channel if you have been banned.

The ban flag takes a second parameter which is the address of the offender, using * for wildcard: /mode channel +b *!*@*.lamers.org
will ban anyone that has an address in the lamers.org domain from joining the channel. The part before the exclamation point is the username, and the remaining part is the userhost.

If you are interested in seeing the ban list for a channel you can open the channel management dialog. This dialog also allows you to edit, add and delete bans for a channel (provided you are a channel operator).

The mode command allows several mode flags to be concatenated like this: /mode channel +lo 22 charlie This does two things in one command. First it sets the channel limit to 22 and then it gives channel operator status to charlie.

/SERVER: This command was described in the chapter on connecting to a server.

Advanced commands


In addition to the limited number of commands described in the two preceding chapters, there is a virtually unlimited number of other commands. If that's not enough then you can always define your own from combinations of the existing ones, called aliases.

The Command Reference will always display a full list of the commands you have available on a particular connection. In the case of built in commands it will display a short explanatory sentence and in the case of aliases the definition will be shown.

Many of the commands are relevant when you progress to the scripting stage. If you peruse the Command Reference you will find a great number of useful commands that you can employ to truly become an advanced IRC user.

A few should be mentioned here:
/BRACT and /BROADCAST: If you are a member of multiple channels and wish to send something to all channels in one command you can use /bract to broadcast actions and the /broadcast command to broadcast messages.
The syntax is just /bract sighs.. which will do a /me sighs.. in all channels, and /broadcast I have had enough which will say "I have had enough" in all channels.

/AMSG and /AQUERY: These aliases allows you to use shortcuts when messaging or querying someone. First you define the shortcut like:
/assign BC BigCheese Then you can use BC as a shortcut for BigCheese: /AMSG BC Hi There!

/ONOTICE This commands sends a message to all the channel operators in a channel.