| Remotes The remote allows you to create scripts that react to IRC events, such as when a user joins a channel or sends you a message. This tool is the most complex part of IRC and to use it you must already know how to use IRC Commands, how to create Aliases, and how to use Variables and Identifiers. Remote/listen menu includes ctcps, events and raw, these must be turned on for your scripts to work. The remote consists of three distinct sections: Scripts, Users, Variables.
The Events and CTCP Events sections of this tutorial will give you additional examples.
This is where the scripts that you create are listed. You can load multiple scripts which work independently of each other. For example; your clone stopper, flood scripts, swear scripts or any script you have can all be loaded at the same time. How do you load a script in remote? Easy...click on File, Load, Script, choose directory it is in, choose file name and click OK. Click on View under the Remote tab and wow, there it is :) You can view any of your scripts at any time by clicking on Remote/View, find the script you want to look at and click it, a check mark will appear beside it and it will show in mIRC editor. Clicking on File/Order allows you to put them in order, eg, flood, swear, clone, offensive nicknames, and the list goes on.
Each user in your users section/list can be assigned one or more levels. These access levels dictate which events a user will be able to access. A good example is the autovoice script which we set to activate on access level 5. Having set the script to activate at level 5 and having the +V in our user list as access 5, this triggers as soon as a +V enters the channel, and bingo, autovoiced, providing nothing has changed in their ip addy. This is how it would look in remote script section:
This is where the currently active variables are listed. If you take a look at remote/variables you will see a list of them, they all start with a %. These variables are set by some scripts you might have and they are called variables because the value usually changes each time a script is run ($time identifier changes as well but will only give the current time and you can't change what $time refers to, it will always be the time). You can use variables in scripts the same way you use identifiers and they will be replaced with the current value of that variable. Variables - Examples Variables are similar to identifiers and can be used in scripts in the same way. The difference is that variables are not specific values and can be changed each time a script runs or an event happens. They always begin with a % symbol like %lastname. You can set a variable yourself in a script by using /set %variablename value or %variablename = value (value can be a number or an identifier like $nick or $time, and can even be another variable that is already set)
Identifiers - Examples Identifiers return specific values. Whenever mIRC finds an identifier in a command or script, it replaces it with the current value. The value $time returns the current time in hour:minute:second format. Example: /mytime /say Here in Cyprus right now it is $time When I type /mytime, this will appear: Here in Cyprus right now it is 21:34:12 See how that works? The $time returned 21:34:12, and whenever it is used, it will return your time.
These are things such as an action, ban, chat, ctcp, notice, ping...there are many events and they can be reviewed in the help files which you can access by typing /help remote. Scripts consist of events which can only be triggered by users who have the required access levels. I will explain the following events so you get a better picture of how this works in a script. Let's start first with the on TEXT event, which triggers when you receive private and/or channel messages. There are a number of different ways you can mask the text you want the event to work with, here are some examples.
*hello* :this mask will react any time the word hello is seen anywhere in any line. Some examples of lines we may use in our scripts. on 1:TEXT:*shit*:#:/kick $chan $nick No swearing. on 1:Text:hello*:?:/msg $nick hello there. on 1:Text:*help*:*:/msg $nick Hi what is the problem? The on ACTION and on NOTICE events use exactly the same format as on TEXT, and trigger on an action and on a notice event respectively. on 1:ACTION:boo:#:/msg $chan Aha, I see we have a ghost among us. on 1:NOTICE:*:?:/msg $nick I'm AFK, back in a moment! You can do more events adding variables and parameters, but that will be discussed later as we get more into scripts.
CTCP stands for Client-To-Client-Protocol which is a special type of communication between IRC Clients. By creating CTCP events, you can make your mIRC react to commands or requests from other users. Go to Remote, Listen, check CTCP to enable them. CTCP events use the format: ctcp <level>:<matchtext>:<*|#|?>:<commands> Here is an example of one ctcp reply I have made: If you type /ctcp mad-boy gender you would see this: Maybe this looks a bit complicated so lets try an easier one using the format above:
Note 1 is the level, lowest level so all users can access it Now try /ctcp mad-boy country, and you see this: [mad-boy COUNTRY]-mad-boy- I am from Cyprus. Remote, Listen, Raw: Raw events are special IRC Server messages that are identified only by a number. The format of the raw event definition is: raw <numeric>:<matchtext>:<commands>. As a quick example, the following script filters out the channels list numeric when you use the /list command. raw 322:*mirc*:/echo 5 $1- This script matches numeric 322 which is the channels /list numeric and if the line returned by this numeric has the word mirc in it, it is printed out in the status window. You can prevent most raw server messages from printing out their default text by using the /halt command. The Internal Address List: mIRC maintains an internal address list of all users who are currently on the same channels as you. A user's address is added to the list either when they join the channel, send a message to a channel, or make a mode change. A user's address is removed from the list when they are no longer on any of the channels which you are currently on. Well guess thats as far as I can go for now without getting too much into scripts. I hope I haven't totally confused you with all this information, any questions about any of this, just check out the mirc help files, much more information there to read!
|