Remotes allow you to create
scripts that react to IRC events, such as when a user joins a channel or
sends you a message. While we won't go into scripting here (well, maybe
a little tiny bit) we will show you some basic commands that may be placed
in your remotes and dissect them so you can see how they work. To get to
your remotes, either click on the
in your mirc toolbar or do
"alt-r" on your keyboard.
Lets take a look at the first
line... on 1:JOIN:#:/whois $nick ...better
yet, lets take it apart (i love taking things apart)!
The first part is "on 1:" this
basicly says that this particular remote will react to any user. All users
(us addicts) may be assigned a user-level. Lets say you wanted to write
a remote that says HELLO whenever your friends join a channel, but not
to anyone else. You can add your friends into your userlist at, oh, say
level 5. Then by changing the "on 1:" to "on 5:" it tells your mirc only
to perform that remote command if the person who joined the channel is
a level 5 on your userlist. So, "on 1:" means everybody, and any other
number you use will be dependant on what user levels you set for your friends.
The next part is simple...
JOIN: ...this is the EVENT that you want the remote to respond to.
JOIN means JOINing a channel, you can also have remotes react to just about
any event, such as TEXT, pings, msg's, opping (ack!! fishee has been opped!
Swim for your lives! Women and fish first!!)...hehe
The :#: designates the
channel you want the remote to work in. Yes, you can have special remotes
for each of your favorite addict friends AND each of your favorite channels!
Neat, huh? If you don't specify a channelname (like :#mirc4dummies:) and
just use the :#: then it means "all channels"...you can also use an asterisk
* in place of a #, because the asterisk is known as a "wildcard" and means
"all" when you are scripting (more on that later).
That's the first half of the
remote, defining what you want the remote to react to (the EVENT)... Now,
the next part, /whois $nick is what you want to happen when the
event occurs. It's not much different than typing a /whois command yourself,
but notice the $nick...the $ variable means that any nick who performs
this event (in this case, JOINing a channel) will have a /whois done on
them. Automatically.
Kewl :-)
So there is an "auto-whois"
on any user who joins any channel you are on! Now, look at the next remote...
on 1:TEXT:aol:#irchelp:/msg $chan aol?
| /describe $chan pukes ...this is a bit
more complicated, but not TOO bad. See, now we are telling the remote to
react to TEXT, in this case the letters "aol", and only on channel #irchelp.
As an op this will come in handy for auto-kicking on cusses. Go ahead,
give it a try...stick that whole command line in your remotes and have
someone type "aol" in the channel. Now you see what the rest of the command
does. Notice that in remotes, you use /describe to perform an action,
not /me as you would in a channel.
Also notice the vertical |
in the command... this seperates commands, so that you can have the remote
do a whole bunch of things on an event. Remember, always use a space before
and after the | and there is no limit as to how many you can use.
"But hey! It only works if
"aol" is the first word typed in the sentence!" Yup...remember those wildcards?
If you put one on each side of "aol" in the command, then the remote will
react anytime "aol" appears anywhere in the sentence. You can also specify
phrases, like on 1:TEXT:*is a dork*:#:/msg
$chan Yes, we all know that! ...and by
using the wildcards if someone types "X is a dork with no personality"
the remote will respond with "Yes, we all know that!". Go ahead, try it.
Just think of the fun possibilities!
Now, a little about scripts...you've
all seen the /load -rs c:\mirc\download\somefile.bla
bla bla commands, here is another way of doing
it. Go to your remotes, click FILE, LOAD, SCRIPT...
and you'll see this. Just choose
the directory the script you want to load is in, then hilite the script
(file) and click OK. This is handy for scripts or mirc addons that you
download off the WWW and may be in some other folder besides your mirc.
Cool, huh?