Difference between revisions of "Preference:Alias"

From Mibbit Wiki
Jump to: navigation, search
(example: Quiet ban)
Line 11: Line 11:
 
Bear in mind that the first match will trigger, so if you have duplicate matches, only the first will be used. The match is also case insensitive.
 
Bear in mind that the first match will trigger, so if you have duplicate matches, only the first will be used. The match is also case insensitive.
  
Here's what you can have in COMMAND:
+
{| border="1"
 +
|+ What you can have in COMMAND
 +
|-
 +
| <nowiki>|</nowiki> || Separate multiple commands
 +
|-
 +
| # || The current channel
 +
|-
 +
| $N || (Where N is a number) - replace this with the Nth word from the input
 +
|-
 +
| $$N || Same as above, but if there is no such word, only ignore this command, not the whole alias
 +
|-
 +
| $N- || replace with all words from N onward
 +
|-
 +
| $N-M || replace with all words from N to M
 +
|-
 +
| $+ || suppress the space between words
 +
|-
 +
| $me || Your current nickname
 +
|-
 +
| /say || Say something on the current channel
 +
|}
 +
 
  
* | - Separate multiple commands
 
* /say - Say something on the current channel
 
* # - The current channel
 
* $me - Your current nickname
 
* $N - (Where N is a number) - replace this with the Nth word from the input
 
* $$N - Same as above, but only ignore this command if there isn't such a word, instead of the whole alias.
 
* $N-M - replace this with the words from N to M
 
* $N- - replace this with all words from N onwards
 
* $+ - suppress the space between words... eg "He $+ llo" = "Hello"
 
 
You can have a .,!? after $me, and you can have a # before any of the $N commands.
 
You can have a .,!? after $me, and you can have a # before any of the $N commands.
  

Revision as of 21:41, 3 September 2008

Aliases.png

Aliases are user set commands that reference other commands so that they do not have to repeat themselves each time they want to use a specific line. There is only one pre-set alias, being /j /join $1. As they are preferences, they can be set for widgets also.

How It Works

MATCH - This is the first word on the line, that we're matching against. It can start with / but doesn't have to.

COMMAND - This is what you want to do if the alias matches.

Bear in mind that the first match will trigger, so if you have duplicate matches, only the first will be used. The match is also case insensitive.

What you can have in COMMAND
| Separate multiple commands
# The current channel
$N (Where N is a number) - replace this with the Nth word from the input
$$N Same as above, but if there is no such word, only ignore this command, not the whole alias
$N- replace with all words from N onward
$N-M replace with all words from N to M
$+ suppress the space between words
$me Your current nickname
/say Say something on the current channel


You can have a .,!? after $me, and you can have a # before any of the $N commands.

Examples

  • [Alias examples]

Hugs

/hug /me hugs $1 tightly.

Now if you write "/hug jenny", you'll see:

* yournick hugs jenny tightly.

You can use an alias you declared before it. An example is the /multihug command:

/multihug /say I need a hug :( | /hug $$1 | /hug $$2 | /hug $$3 | /say phew! That felt good. I'm glad I'm in # and not in #nohugs!

Now write "/multihug jenny cloe" you'll see:

mynick: I need a hug :( * mynick hugs jenny tightly. * mynick hugs cloe tightly. mynick: phew! That felt good. I'm glad I'm in #mychannel and not in #nohugs!

Quiet ban

/qb /mode # +b ~q:*!*@ $+ $1

usage: /qb <hostname> (prevents a user from talking)

example: /qb B3E473F8.3D842CF7.21EFBB6E.IP