mIRC Scripting 

Infinity.ca.us.webchat.org Webmaster Inc.Service Hub

 Command Parameters                                                                                                      Lessons 5   
 

Aliases that always do the same thing are useful, but we can do much better. Try this alias-

/hop {
  /partall
  /join $1
}

This is similar to the /go alias from the previous section, but this time, we used $1 instead of a channel name. $1 will automatically be replaced with the first word passed to the command. This is called a parameter. For example, with this alias, you can type /hop #infinity and the alias will use #infinity where the $1 is found.

Basically, when you type a command such as '/query david', '/query' is the command (or alias) and 'david' is the first parameter, which can be accessed using $1 in the alias.

It is important that you understand what a 'parameter' is. When you use a command such as '/msg nick msg', 'nick' and 'msg' are parameters. 'nick' is the first parameter, and 'msg' is the second parameter. Parameters (for commands) are separated with spaces- each word is another parameter. So, '/quit' is a command being used with no parameters, '/nick blah' is a command with one parameter, '/topic #anime a b c' has four parameters, etc.

 

   
      3|Table of Contents|4

 

All information shown on this site is regularly maintained and kept as up to date as possible. All other trademarks are property of their respective owners. Copyright © 2001, Infinity.ca.us.webchat.org Webmaster, Inc.Service Hub

Hosted by www.Geocities.ws

1