Difference between revisions of "Preference:Alias"

From Mibbit Wiki
Jump to: navigation, search
m (Match)
(Moved examples to own page.)
Line 54: Line 54:
  
 
==Default Aliases==
 
==Default Aliases==
{{DefaultAlias}}Ops and higher also get an additional ban option (hard coded into the client, /kick is not there atm)
+
{{DefaultAlias}}
  
==Examples==
+
For examples of custom aliases, see [[Alias/Examples]].
  
Match commands in examples are only suggestions. Users may put whatever they want. Some examples (e.g., /hug, /inform, /colors) can be tested in http://staging.mibbit.com/url/RV7Y9I (demo widget).
+
[[Category:Preferences]][[Category:Support]]
 
 
===Hugs===
 
 
 
{{notice|This example contains helpful information that is not part of the other examples.}}
 
 
 
'''Match:'''
 
/hug
 
 
 
'''Command'''
 
/me hugs $1 tightly.
 
 
 
Now if you write "/hug jenny", you'll see:
 
 
 
<nowiki>* yournick hugs jenny tightly.</nowiki>
 
 
 
You can use an alias you declared before it.  An example of this is the /multihug command:
 
 
 
'''Match:'''
 
/multihug
 
 
 
'''Command'''
 
/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!
 
 
 
===Inform===
 
 
 
'''Match:'''
 
/inform
 
 
 
'''Command'''
 
chr(2)chr(3)0,4 INFORM: chr(2)chr(3)1,0 $1-
 
( chr(2)=\u0002 bold toggle, chr(3)=\u0003 mIRC color prefix).
 
 
 
'''Usage:'''
 
/inform It's very cold out there
 
 
 
'''Output:'''
 
'''<span style="color: #FFF; background-color: #F00"> INFORM: </span>'''<span style="background-color: #FFF"> It's very cold out there</span>
 
 
 
===Bans===
 
 
 
====Quiet Bans====
 
 
 
A quiet ban is a type of [[ban]] that makes it so that the user can do anything except for speak.
 
 
 
'''Match:'''
 
/qb
 
 
 
'''Command'''
 
[[Unreal]] Version:  /mode # +b ~q:*!*@ $+ $1
 
 
 
'''Usage:'''
 
[[Unreal]] Version:  /qb {{hm}}
 
 
 
'''Output:'''
 
'''yourNick has banned q:{{hm}}
 
 
 
====Show bans====
 
 
 
'''Match:'''
 
/sb
 
 
 
'''Command'''
 
/mode # b
 
 
 
'''Usage:'''
 
/sb
 
 
 
'''Output:'''
 
The output is dynamic, but it shows any bans that are active.
 
 
 
=== Multi-Mode Aliases ===
 
 
 
In Chatzilla, you can do /voice Nick1 Nick2 Nick3 Nick4 (ect) and they all become voiced.  The alias showing is the closest to that.
 
 
 
'''Match:'''
 
/muvoice /mudevoice /muop /mdeop (ect.)
 
 
 
'''Command'''
 
<nowiki>/mode # [+/-][mode] $1 | /mode # [+/-][mode] $$2 | /mode # [+/-][mode] $$3 | /mode # [+/-][mode] $$4</nowiki>
 
 
 
Replace <nowiki>[+/-]</nowiki> with either a + or a - and <nowiki>[mode]</nowiki> with a mode of your choice, like v (voice), h (halfop), o (operator), a (super-op or admin), or e (exempt)
 
 
 
Some common examples are:
 
 
 
/mode # +v $1 | /mode # +v $$2 | /mode # +v $$3 | /mode # +v $$4
 
/mode # +o $1 | /mode # +o $$2 | /mode # +o $$3 | /mode # +o $$4
 
 
 
'''Usage:'''
 
/muvoice Havvy Molkmin Hercule
 
 
 
'''Output:'''
 
+++ yourNick has voiced Havvy
 
+++ yourNick has voiced Molkmin
 
+++ yourNick has voiced Hercule
 
 
 
=== Part All ===
 
 
 
This alias uses the esoteric /join 0 command to part from all channels.
 
 
 
'''Match'''
 
  /partall /apart /ap
 
 
 
'''Command'''
 
  /join #0,0
 
 
 
'''Usage'''
 
  /partall
 
 
 
'''Output:'''
 
  *** yourNick left #channel (Left all channels)
 
 
 
This output will appear in all channels in the server you use the command on.  No, the part message cannot be changed.
 
 
 
=== Quit All ===
 
 
 
This alias uses the [[Allservers|/allservers]] command to quit all servers.
 
 
 
'''Match:'''
 
  /quitall /aquit /aq
 
 
 
'''Command:'''
 
  /allservers /quit $1+
 
 
 
'''Usage:'''
 
  /quitall Peace Out
 
 
 
'''Output:'''
 
  *** YourNick quit (Peace Out)
 
 
 
That will occur on all servers you are on.
 
 
 
[[Category:Preferences]][[Category:How To]][[Category:Support]]
 

Revision as of 21:43, 18 April 2010

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. As they are preferences, they can be set for widgets also.

How It Works

Each alias has a Match, or trigger, and a Command, or output.

Match

The match is what triggers the alias. A match can either be a command used on the command line or the name of a channel on a server that is triggered when joined.

Commands start with a forwardslash ( / ) followed by the name of the command. The name should not already be taken in Mibbit.

A match that triggers when joining a specific channel is also called an onJoin match. Currently, an onJoin alias only works on the main client. The match follows the following style:

 >network>#channel

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.

Command

If a match triggers, the command section is implemented in the channel that triggers it. The command must be a set of commands. Certain variables and constructs for multiple commands are provided.

COMMAND Variables
  |   (<space>|<space>) 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 (i.e. $3- would take the third word and all following it)
$N-M replace with all words from N to M (i.e. $1-5 would take the first 5 words)
$+ suppress the spaces between variables and following text or other variables
$me Your current nickname
/say Say something on the current channel
$? Causes a prompt asking for information, password, etc.


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

Default Aliases

Alias Name Command What It Does
/j /join $1- Smaller command to join channels
/cs /msg ChanServ $1- Message ChanServ with only two letters.
/ns /msg NickServ $1- Message NickServ with only two letters.
/bs /msg BotServ $1- Message BotServ with only two letters.
/ms /msg MemoServ $1- Message MemoServ with only two letters.
/os /msg OperServ $1- Message OperServ with only two letters.
/voice /mode # +v $1 Voice a user/nick
/devoice /mode # -v $1 Remove voice from a user/nick (/unvoice is the same)
/ban /mode # +b $1 Ban a user/hostmask (/ban<space> = show list with unban buttons)
/unban /mode # -b $1 Remove a ban from a user/hostmask (/deban is the same)
/op /mode # +o $1 Give operator status to a user/nick.
/deop /mode # -o $1 Remove operator status from a user/nick (/unop is the same)
/halfop /mode # +h $1 Give half-operator status to a user/nick.
/dehalfop /mode # -h $1 Remove half-operator status from a user/nick (/unhalfop is the same)
/admin /mode # +a $1 Give super-operator status to a user/nick (called Admin on Mibbit, use "/raw admin" for the ircd command)
/deadmin /mode # -a $1 Remove super-operator status from a user/nick (/unadmin is the same)
/owner /mode # +q $1 Give owner status to the user/nick
/deowner /mode # -q $1 Remove owner status from the user/nick (/unowner is the same)


For examples of custom aliases, see Alias/Examples.