![]()
I've tried to make the colour codes allow you to follow the help by having Aliases in green ( if there are any ). Lines that need to be typed in an Edit box, but which are not aliases are in Blue. The lines of Script are in yellow, references in the help following are in white, and highlights in red. Every time a script that can be used is shown, it is preceded by the word SCRIPT.
1. Where do I Paste
the code?
2. How do I enable ( turn on ) the Remotes.
3. Auto message on #channel JOIN (The most commonly asked
script help from beginners ).
4. I want to send someone a file when they type !Blah.
5. And then it must be easy to Respond when someone says a specific
word.
6. Fileserver : my God ! Why doesn't the help file give you the
Remote line !!!
7. Country codes Script reacting to TEXT said in a channel.
including multiple commands
8. So how can i make my own PING reply ?
9a. Get around Fake Ping replies people send you! Also
explains Groups and Silent aliases.
9b. Auto Ping reply to !ping
10. Stop receiving unwanted exe, com and the script.ini file
11. Did Someone say RAW !!!
12. I always wanted to PING my own server.
13. Change the words you input to Highlight a nickname
1. Well, where do you paste the code? Funny
how so often no one tells you that. To open up the Remote's editor, you press the keys ALT
R together or else click on the Remotes editor button on the button bar in mIRC©. ![]()
2. And how do you turn Remotes on? Funny how often this instruction is left out. Remotes don't "trigger" unless your turn your remotes on. You do this by typing the command /remote on in any open window of mIRC©.
and pressing the Enter key.

and you are all set. You can check to see if your remotes are on or off at any time by
just typing /remote ![]()
3. Q. The most frequent Script help asked for in the #mirc and #mirchelp help channels?
A. How do I make an Auto Message when someone joins my channel ?
Well, to have an auto message when someone joins your channel,
1) Make sure your remotes are turned on. Simply type /remote to check
2) Go to your Remotes Editor ( Press ALT R to open it), click on View on the Options bar at the top of the Remotes Editor, select the top entry in the list that opens.
3) This line ( in Yellow below the word SCRIPT ) in your Remotes File, is called a line of Script. In the open space in your Remotes Editor, type this as the top line:
SCRIPT
on 1!:JOIN:#YOURchannelNAME:/notice $nick Hi $nick - Thanks
for joining $chan - I know these auto messages are one of the most bugging things on IRC -
but here is my message anyway !
So let's look at this first: on 1!:JOIN:
This is the Remote part that looks for someone joining a channel you are on in mIRC©. The default level of 1 will catch everyone joining the channel. The explanation for Levels starts to get into a bit more advanced scritping and for now you shouldn't be worried if you don't know it. To learn more type /help levels in any open window in mIRC©. This will pop open the mIRC© help file to the right place.
Now for the !:JOIN. The exclamation mark ! is so that your joining the channel doesn't trigger the remote. You can leave it off if you'd like to see the Join message when you join also. The JOIN makes the Remote trigger when someone Joins a channel. To leave it off modify the line to read: SCRIPT on 1:JOIN:#YOURchannelNAME:/notice $nick Hi $nick - Thanks for joining $chan - I know these auto messages are one of the most bugging things on IRC - but here is my message anyway ! --- Notice the ! is now missing in on 1:JOIN:.
#YOURchannelNAME
Here you put in your channel name that when the person Joins, he will get the message. You must be on that channel as well for this to work. For example is you wanted to do this in the channel #MyChannel, you would modify the script to look like this:
SCRIPT
on 1!:JOIN:#MyChannel:/notice $nick Hi $nick - Thanks for joining $chan - I know these auto
messages are one of the most bugging things on IRC - but here is my message anyway !
If you wanted the Remote to trigger whenever anybody joined ANY channel you are on, which I advise you not to be because it will very quickly lead you to being Kicked and Banned from most channels, you would use the universal channel command of # like this:
SCRIPT
on 1!:JOIN:#:/notice $nick Hi $nick - Thanks for joining $chan - I know these auto
messages are one of the most bugging things on IRC - but here is my message anyway !
Next is the /notice $nick, which sends a private Notice seen only by the person Joining the channel and the $nick is used to refer to the person that triggered this Remote by joining the channel. So in effect if Free ( that's me ) joined your channel, /notice $nick would be interpreted as /notice Free.
Next comes the actual message sent which starts Hi $nick - , which again if Free ( that's me again ) was to join the channel, it would be interpreted as Hi Free -
When the line reaches $chan, this now refers to the channel to which the Nickname Joined. So if Free joined #MyChannel, the line would read: Hi Free - Thanks for joining #MyChannel - I know these auto messages are one of the most bugging things on IRC - but here is my message anyway !
To change the Remote to send a message to the channel in Public instead of privately to the person joining, again this will bug most other people in the channel and get you either Kicked and Banned or both, you would modify the remote to read:
SCRIPT
on 1!:JOIN:#YOURchannelNAME:/msg
$chan Hi $nick - Thanks for joining $chan - I know these auto
messages are one of the most bugging things on IRC - but here is my message anyway !
Now that is not too difficult is it :)
Other common things to do on someone joining your channel are this one which voices the nick:
SCRIPT
on @1!:JOIN:#YOURchannelNAME:mode $chan +v $nick
Notice the @ before at the begining of the command. This ensures that the remote only triggers if you are OP'd in the channel. Next notice that suddenly mode is missing the preceeding /. Alias commands in remotes file do not need to be preceeded by the / slash. Also notice the ! soon after that. That ensures the remote does not trigger when YOU join the channel.
Normally you would combine it with one of the remotes above so as to have:
SCRIPT
on @1!:JOIN:#YOURchannelNAME:/notice $nick - Hiya $nick $+ ,
Thanks for joining $chan - You now will be given a "voice" here. | /mode $chan
+v $nick
You now have two things done from the person joining.
Notice the use of the command separator |. That is like using
a new line without using brackets. The same line above could be done using brackets { } and new lines like this:
SCRIPT
on @1!:JOIN:#YOURchannelNAME:{
/notice $nick - Hiya $nick $+ , Thanks for joining $chan - You now will be given a
"voice" here.
/mode $chan +v $nick
}
This now again can be looked at differently. Say you want to send the join message wether you are OP'd in the channel or not, and only voice the joiner if you are OP's. Let's see:
on 1!:JOIN:#YOURchannelNAME:{
/notice $nick - Hiya $nick $+ , Thanks for joining $chan - You now will be given a
"voice" here.
if ($me isop $chan) { mode $chan +v $nick }
}
So what is new here. For one the @ is gone. So this will trigger whether you are OP'd or not. Next we have done a check to see if you are OP'd at present using if ($me isop $chan). Basically this is saying if you yourself ($me) is an op (isop) in the channel the person joined ($chan) , then and only then will the commands in the following brackets { mode $chan +v $nick }be executed which in this case is giving +voice to the joiner.
You can of course now have even more commands in there ..... in fact .... if you want multiple commands to trigger for the JOIN command at user level 1 , then they MUST all be grouped together under one trigger. For example:
SCRIPT
on 1!:JOIN:#YOURchannelNAME:{
/notice $nick - Hiya $nick $+ , Thanks for joining $chan - You now will be given a
"voice" here.
/echo 4 -a $nick Joined $chan
if ($me isop $chan) { /mode $chan +v $nick }
}
If it was me (Free) joining the channel #mIRC, the line /echo 4 -a $nick Joined $chan
will echo (meaning only you will see the line and no one
else) in RED (the colour number 4
is for red) into the -a active channel you are in, which does
not necessarily have to be the channel #mIRC as in this case but any other window you are
chatting in, short line of:
Free Joined #mIRC![]()
4. I want to send someone a File when they type the word !blah
Quite easy to do. This line ( in Yellow below the word SCRIPT ) when put in your Remotes File, suitably modified to put in the correct filename and path, will do it for you.
SCRIPT
on 1:TEXT:!blah:#:dcc send $nick c:\path\filename.ext
Wow, that was simple :)
I will start the explanation at 1:TEXT. This is the Remote part that looks for text typed by someone else which you see come up in mIRC©. The default level of 1 will catch everyone saying the text ( except you - you can't trigger your own TEXT remote ), and the word TEXT refers to the fact that text was typed. :)
:!blah:
This part looks for what text it must be for this particular remote to start operating. It will only continue if the word said in the channel is !blah ( including the preceding exclamation mark ). If the person typed !blah blah blah, then the Remote will not trigger. He has to type only the single word !blah.
If you wanted the Remote to trigger when other words are typed after !blah, then you would modify the Remote to look like this:
SCRIPT
on 1:TEXT:!blah*:#:dcc send
$nick c:\path\filename.ext
and the * after !blah means that
there can be any amount of text after the word !blah said in
the channel.
Of course you could modify the word !blah to be anything,
such as @apple, and then you would have the remote looking
like this then:
SCRIPT
on 1:TEXT:@apple:#:dcc send
$nick c:\path\filename.ext
or
SCRIPT
on 1:TEXT:@apple*:#:dcc send $nick c:\path\filename.ext
Then we go on to the # part :
:#:
This is where the place the text must be said for the remote to continue. In this
case # stands for any #channel, and only a #channel, not in a
DCC chat or a /msg window etc.
The location where the Remote event occurs for the Script to trigger is specified using:
? for any private message
# for any channel message
#mirc for any messages on channel #mirc
* for any private or channel messages
So we can have the following:
SCRIPT that reacts ONLY in any private message :
on 1:TEXT:!blah:?:dcc send $nick c:\path\filename.ext
SCRIPT that reacts ONLY in any channel message :
on 1:TEXT:!blah:#:dcc send $nick c:\path\filename.ext
SCRIPT that reacts ONLY in a the specific channel
#mirc :
on 1:TEXT:!blah:#mirc:dcc send $nick c:\path\filename.ext
SCRIPT that reacts in any Channel AND any private
message :
on 1:TEXT:!blah:*:dcc send $nick c:\path\filename.ext
SCRIPT that reacts in any DCC Chat window ( I added this in just in case you
wondered) :
on 1:CHAT:!blah*:/dcc send =$nick c:\path\filename.ext
Next follows the commands to be performed.
on 1:TEXT:!blah:#:dcc send $nick c:\path\filename.ext
This ( dcc send ) is the command to execute. It is the first part of the command to send a file to someone. DCC Send ( stands for Direct Client to Client ) which makes a connection directly from you to the other person you choose, by passing the IRC chat server.
$nick
This is the nickname of the person who type !blah, so for example if Free ( that is me :) had typed !blah in your channel, the command would do this: /dcc send Free c:\path\filename.ext
c:\path\filename.ext
This is the file that you will send, so for example if you want to send the file called countrycodes.txt which is in the directory c:\mirc you would write your script line as:
SCRIPT
on 1:TEXT:!blah:#:dcc send $nick c:\mirc\countrycodes.txt
And there you go. Your own little remote to send a file.
Q. But I want it to send them the filename they ask for silly.
A. Oh, why didn't you say so!
So the person types !file picture.jpg and you want to send them the file picture.jpg automatically !
SCRIPT
on 1:TEXT:!file*:#:if ($right($2,3) == jpg) { dcc send $nick
$2 }
The $right($2,3) == jpg is just a precaution to make sure
you only send picture files and no other sensitive files you don't want to share. It means
that the last three letters are jpg ( of the file name he
typed after !picture). Then, $2
is what the person typed as the second word in his message, that is, the word after !picture. More about the $2 parameter is explained in the Country
codes explanations. Now that wasn't so painful was it ? ![]()
5.Someone said a word i want to respond to automatically!
Wow, this one is pretty simple if you've understood the one above.
SCRIPT
on 1:TEXT:hello*:#:/msg $chan Hello to you too $nick :)
The main obvious difference here is /msg $chan which now
sends a message to the channel in which the text hello was
said. Notice that the hello in the begining of the remote is actually :hello*: with a * (star) after it.
This means the event will be triggered if the person says in the channel Hello , or hello there everybody, but
it will not trigger if the person said Hi and hello everybody.
The reason for this is because the * (star) indicates that
the person could say any number of words after the hello and
the event will still trigger. To make the remote trigger with the word hello anywhere in the sentence, we would use two stars like this:
SCRIPT
on 1:TEXT:*hello*:#:/msg $chan Hello to you too $nick :)
And to make the event trigger when the person said just hello,
but no other word in that sentence, we would have no stars at all like this:
SCRIPT
on 1:TEXT:hello:#:/msg $chan Hello to you too $nick :)
If we wanted to send a private message in the form of a /notice to the person, we would
use this:
SCRIPT
on 1:TEXT:hello*:#:/notice $nick $chan Hello to you too $nick :)
And if we wanted to respond by sending a /msg in a message box to the person, we would
use:SCRIPT
on 1:TEXT:hello*:#:/msg $nick Hello to you too $nick :)
Notice in all these examples, to change your message to whatever you want, you modify this part Hello to you too $nick :) to your own words. And you change :hello*: to the word you want the event to respond to. Have fun using this one.
Below are some of my favourites:
SCRIPT
on 1:TEXT:hey:#:/msg $chan $nick - You can find the words to
hey jude at .... http://www.lyrics.ch/
SCRIPT
on 1:TEXT:help:#:/msg $chan $nick - hey - isn't that a famous
Beatles song ?
SCRIPT
on 1:text:*a/s/l*:#:/describe $chan asks $nick - Hey! didn't
your mommy teach you any manners ?
Notice the describe in the last Script line. Now what does that do! You'll be thrilled to know it does an action, so it would be the same as typing /me
So have you realised from here that you can respond in any way to text triggering off your remote?
on 1:TEXT:*keyword*:#: { commands for whatever you want to do }
There you go. Hope that makes it all clear ! ![]()
6. A Fileserver's remote line can be such a pain to find.
Yes, and here it is in it's basic format. The trigger command for fserve is put in your Remotes file ( ALT R to open it ), and make sure your remotes are on by typing this in any open window in mIRC© -- /remote on
SCRIPT
on 1:TEXT:!keyword*:*:/fserve $nick 3 c:\dir
c:\dir\welcome.txt
Q. My God! is it that simple ?
A. Yes it is :)
A user must type the !keyword to start fserve. The fileserver is done by means of a DCC Chat window between that person and you.
Let's go through the new parts of this script as on 1:TEXT: should be understood from the scripts before this. The next relevant part is the !keyword which is what the person must start his sentence as to trigger your fileserver. A common keyword is your own nickname. So, if it was me, I'd make my keyword !Free and my Script line would look like:
SCRIPT
on 1:TEXT:!Free*:*:/fserve $nick 3 c:\dir c:\dir\welcome.txt
Ok, not bad, now on to the number 3 over there. This is the maximum number of simultaneous dcc gets that a user can have during a fileserver session. The 3 means he can only be downloading three files at a time. This stops someone from hogging up all your space on the fileserver. You can increase or decrease this to whatever suits you.
c:\dir
This is by far the most important thing to get right. The mIRC© fileserver allows other users to access files on your hard disk and is therefore dangerous since if used improperly it will allow them to access private/confidential information. The c:\dir directory is the place where you will keep your files which you want people to get. They will also be able to access any subdirectories in that directory such as c:\dir\subdir. For example my files for my fileserver are kept in the directory c:\mirc\files, so I might make my Remote like this:
SCRIPT
on 1:TEXT:!Free*:*:/fserve $nick 3 c:\mirc\files c:\dir\welcome.txt
And on to the last part, the Welcome Message that you want to display when someone first joins your fileserver. This Welcome Message is optional. You don't have to have it. The message is kept in a Text File, and that file should be in the same directory as where your fileserver starts. In my personal case the file name is enter_fileserver.txt, so my remote line would look like:
SCRIPT
on 1:TEXT:!Free*:*:/fserve $nick 3 c:\mirc\files c:\mirc\enter_fileserver.txt
For the rest of the things that can be done with a fileserver, type /help fserve in any open window in mIRC© which will take you to the appropriate place in the help file.
If only this line was given in the mIRC© Help file :)
![]()
This line ( in Yellow below the word SCRIPT ) when put in your Remotes File, is called a line of Script. It allows someone in a channel to find out the country by typing in the 2 or 3 letter country code. To make this work you need to have the file called countrycodes.txt (SHIFT click on it to download it and save it to your c:\mirc directory ), stored in your c:\mirc\ folder, or modify the code to show the right path and/or filename. For example if in a channel someone typed:
.country ae
Your mIRC© would reply automatically to the channel:
Country code for AE is United Arab Emirates
SCRIPT
on 1:TEXT:.country*:#: if ($2 != $null) { set %country -s $+
$2 | set %countryname $read %country c:\mirc\countrycodes.txt | { if (%countryname != $null) { /msg $chan Country code for $upper($2)
is %countryname }
} }
The colour coding of the brackets { {{ } } } are only for clarity and have no meaning to the script.
So here is how it works .......
on 1:TEXT:
This is the Remote part that looks for text typed by someone else which you see come up in mIRC©. The default level of 1 will catch everyone saying the text ( except you - you can't trigger your own TEXT remote ), and the word TEXT refers to text :)
.country*:
This part looks for what text it must be for this particular remote to start operating. It will only continue if the first word said in the channel is .country ( including the preceding period ), and the * after .country means that there can be any amount of text after the word .country said in the channel.
#:
This is where the text must be said for the remote to continue. In this case # stands for any #channel, and only a #channel, not in a DCC chat or a /msg window etc.
if ($2 != $null) {
This is how an if statement works. This part of the script
now makes sure that something was typed after .country for us
to actually find the Country Name for. If the person had typed in the channel .country ae then $1 is .country ( which we don't need) and $2
is ae (which we do need ). What the statement above is saying
is, if the second word typed ( $2
) is not ( != ) empty ( $null ),
only then continue on and execute what follows in the bracket {.
If the person had simply only typed .country in the channel
with nothing after that, the script would just stop.
set %country
This next part sets a variable called %country and stores something into it. This variable can be looked at in your Remotes Editor ( Press ALT R ), and click on the Variables Folder.
-s $+ $2
This next part is what is stored into the variable called %country. If the person had type in the channel .country ae then $1 is .country ( which we don't need) and $2 is ae (which we do need ), and what would go into the variable %country is -s $+ ae which is -sae. So in effect what we have done is stored this: -sae into the variable %country.
|
This next part is called a separator, which means a new command is now starting, or you can say, a new line of the command.
set %countryname
Here we are setting another variable called %countryname and we are going to store something in it.
$read
This is a powerful command that lets us look inside a file and retrieve something from it. The following parts are which file it looks into and where it looks within that file and what it retrieves from it.
c:\mirc\countrycodes.txt
I have gone out of sequence here for clarity. This, countrycodes.txt is the file it looks in. The file you will download and keep in your c:\mirc directory.
SCRIPT
on 1:TEXT:.country*:#: if ($2 != $null) { set %country -s $+
$2 | set %countryname $read %country c:\mirc\countrycodes.txt | { if (%countryname != $null) { /msg $chan Country code for $upper($2) is %countryname
} } }
To get you back on track I have pasted the whole line again and marked in RED where we will go to now.
%country
This is where in the file countrycodes.txt it looks for
the data it needs. Now as you remember, the %country variable
contains the value -sae. The $read
command takes the very first dash - as a switch and
recognizes that the letter after it, s, is giving it the
message to scan the file countrycodes.txt
for a line beginning with ae ( remember -sae
? ).
To give you a better idea, the lines in the file countrycodes.txt look
like this:
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG and so on
If this -s switch confuses you, look in the Help file of mIRC© for $read commands under File Identifiers.
set %countryname $read %country c:\mirc\countrycodes.txt
To recap, we have looked in .....
set %countryname $read %country c:\mirc\countrycodes.txt
the file ..... c:\mirc\countrycodes.txt and .....
set %countryname $read %country c:\mirc\countrycodes.txt
since the variable %country contains -sae we can just to look at it write the line as .....
set %countryname $read -sae c:\mirc\countrycodes.txt
search through the c:\mirc\countrycodes.txt for .....
set %countryname $read -sae c:\mirc\countrycodes.txt
a line beginning with the letters ae and then whatever it finds in that line will be .....
set %countryname $read %country c:\mirc\countrycodes.txt
stored to the variable %countryname :) and in this case, since the ae was found at the beginning of a line in the countrycodes.txt file, and it was followed by United Arab Emirates, so we now have stored in the variable the %countryname text United Arab Emirates.
|
Again the separator, which means a new command is now starting, or you can say, a new line of the command. Let me paste the whole remote line again so you don't have to scroll back, and highlight in RED where we are going to next.
SCRIPT
on 1:TEXT:.country*:#: if ($2 != $null) { set %country -s $+
$2 | set %countryname $read %country c:\mirc\countrycodes.txt | { if (%countryname != $null) { /msg $chan Country code for $upper($2)
is %countryname }
} }
The { is an open bracket to help the code keep it's order properly.
if (%countryname != $null)
What this says is that if the variable %countryname isn't ( != ) empty ( $null ); what it is doing here is making sure that you have not chosen an invalid country code to find the country name. If you had chosen a country code that was not in the countrycodes.txt file, then the preceding $read command would have found no matching entry and would have left the variable %countryname as empty. If this was the case the script would just stop here.
{
What follows after the open bracket is what should be done when the if statement preceding it was true.
/msg $chan
This is to say the text that will follow into the channel ( $chan ) where the remote was triggered from. It is the same as using the alias /say , the only problem being that the /say alias DOES NOT work in a remote line. Remember this point as it is a common fault of beginner scripters.
Country code for
This is just plain old text which will be said into the channel exactly as it appears, which in this case is Country code for.
$upper($2)
The boxes ( ) are the control code for making what follows between the two boxes as BOLD, ( done by pressing the CTRL and B key together. $upper( ) is function that returns the text within the brackets in UPPER case. In this case the text inside the brackets is contained in the parameter $2 which hopefully you will remember contains the second piece of text that triggered the remote, in this case since .country ae was said, $2 contains the text ae., so in effect we are doing $upper(ae) which will give the result AE, and since this command was enclosed within a pair of BOLD codes, it would in fact be AE.
is %countryname
is , plain old text again which will be said to the channel exactly like that, then ( ) is the start of the bold code, then the value stored in the variable %countryname will come be said. If you remember, the value in here was $read from the countrycodes.txt file earlier on and contains the text United Arab Emirates, and since it is within the bold ( ) codes, it will be said to the channel as United Arab Emirates.
/msg $chan Country code for $upper($2) is %countryname
So the final result of this would be said to the channel where .country ae was typed as Country code for AE is United Arab Emirates
} } }
and finally the 3 close brackets, colour coded here to show you which open bracket each
corresponds to. ![]()
8. So how can I make my own PING reply ?
CTCP's are another type of remote that can be fun to use. The most common one people like to play with is the PING reply. Someone PINGs you and you want to add a message on the reply back to them. Here's how it's done:
SCRIPT for adding a message to the PING Reply.
ctcp 1!:ping:?:/notice $nick OOOooohhh ..that ping tickled !
:)
This remote starting with ctcp catches this type of event.
The 1 is again the level to catch all users. The exclamation mark ! is so that you PINGing yourself
doesn't trigger the remote. You can leave it off if you'd like to see the new reply you
are making when you PING yourself. To leave it off modify the line to read: SCRIPT
ctcp 1:ping:?:/notice $nick OOOooohhh ..that ping tickled !
:)
The :ping: refers catching the ctcp PING rather than other ctcp events. Next starts the command to do when the event is triggered ( i.e. when someone has PINGed you ).
/notice $nick
The $nick is the nickname of the person who triggered this remote, or in other words, the nickname of the person who PINGed you. The /notice is a command that sends a private notice ( that only they see ) to the nickname of the person written after this command, in this case $nick. So for example if Free PINGed you, this command would be /notice Free.
OOOooohhh ..that ping tickled ! :)
This is the /notice that will be sent, and this is the part you can modify to anything you want.
What are other ctcp replies I can make ?
The syntax above applies for all the other replies too. Here are some I use.
SCRIPT
ctcp 1:time:/notice $nick At the tone, the time will be
...... 4 $time | halt
This one is not to difficult to see what is going on. Replies with a /notice to the person that sent you a ctcp
time request with somthing like this: At the tone, the time
will be ...... 19:27:06
The 4 is the CTRL K colour code to change the
colour of the time to RED. Notice the halt
at the end of the statement. This stops the default time reply. If you didn't do this, the
person would get 2 time reples like this:
At the tone, the time will be ...... 19:29:55
[Free TIME reply]: Thu Apr 29 19:29:55 1999
SCRIPT
ctcp 1:USERINFO: { raw -q notice $nick : $+ $chr(1) $+
USERINFO $me is $me $+ , what more do you want? $+ $chr(1) | halt }
SCRIPT
ctcp 1:CLIENTINFO: { raw -q notice $nick : $+ $chr(1) $+
CLIENTINFO $me does not like your inquisitiveness $+ , besides, I aint no client of yours.
$+ $chr(1) | halt }
SCRIPT
ctcp 1:FINGER: { raw -q notice $nick : $+ $chr(1) $+ FINGER
$me does not like your finger $+ , please stick it up your own. $+ $chr(1) | halt }
SCRIPT
ctcp 1:VERSION: { raw -q notice $nick : $+ $chr(1) $+ VERSION
mIRC32 downgraded to v1.01 K.Mardam-Bey $+ $chr(1) }
Notice there is no halt at the end of this line. You
cannot halt the version reply, unless you ignore ALL CTCPs ( and that includes DCC Sends
and receives since they also use the CTCP protocol.
SCRIPT
ctcp 1:GENDER: { raw -q notice $nick : $+ $chr(1) $+ GENDER
$me is $me $+ , but i'm not sure. Do you want me to check ? $+ $chr(1) | halt }
OH MY GOD! What is all that raw -q and $chr(1) stuff. Hmmmm ... I promise to explain it in detail someday,
but for now let me say that raw sends a command directly to
the IRC Server, -q makes it quiet
so when sending it doesn't show up and clutter your screen, and the $chr(1)
is the command charachter for allowing the IRC Server to know this is a CTCP Reply.
![]()
9a. Can I get around those fake PING replies people send me ?
Sure you can. As long as they give you some sort CTCP reply to your ping, you can catch them out. This is what I use for a RealPing. Just type /rp NickName
ALIAS
/rp /ctcp $$1 ping | /set %realping $ticks | /.enable
#realping | /.timerRealPing 1 360 .disable #realping | /.timerRealPingUnset 1 360 unset
%realping
SCRIPT
#realping off
on 1:CTCPREPLY:* {
.disable #realping
.timerRealPing off | .timerRealPingUnset off
%realping = $calc(( $ticks - %realping ) / 2000)
%ping = $ctime - $2
if ($round(%realping,0) == $round(%ping,0)) { /msg $active 4 [ $+ $nick PING reply]:
4 %ping seconds }
else { /msg $active 4 [ $+ $nick REAL PING reply]: 4 %realping seconds }
unset %realping | unset %ping
}
#realping end
Man oh man! Do I have to explain all that ? Basically it puts a time value ($ticks) at the time you send out the ping /set %realping $ticks into a variable (%realping) and the time the ping reply is received less the time of the the ping was sent out %realpingg = $calc(( $ticks - %realping ) / 2000) then divides that into half ( 2000 because $ticks is in milli seconds), into another variable, and then compares the time to the PING reply actually sent by the person, and if these are different it shows the REAL PING reply, else the normal correct reply.
Maybe when my head stops spinning I will put this more clearly :)
But I think it's only fair to tell you two new things brought up here. First is from within the alias, where you can see the command /.enable #realping. This is the way to turn a group of commands on. You'll notice the Script shown starts with the line #realping off and ends with #realping end.
The #realping off means that all the commands after this and before the #realping end will not be executed. This allows you to make sure that the commands within those two Group delimiters will not execute. When you need them to execute, you turn them on with the command /enable #realping which will result in the start message in that group being changed to #realping on and you will at the same time see an echo in your active window saying *** Group(s) enabled. To switch the group of commands back off, you type /disable #realping and this time you will see an echo in your active window saying *** Group(s) disabled, and within your Remotes file that group header will again be modified to read #realping off. This setting of Groups On and Off is a necessary part of scripting that allows you to make sure one group of Remote commands don't interfere with another.
Now on to the second point. Notice in the alias it wasn't /enable #realping. but actually /.enable #realping with an extra period in it. This is another useful tool that hides the normal Echo of the results to your screen. It helps you to keep things happening in the background not appear in your open windows. Seeing *** Group(s) enabled and *** Group(s) disabled is pretty much irritating and useless information once your Script is running properly. This way of making a command execute quietly is much more useful with things shown below. Try these below both with and without the extra period and check out the difference ( remember to replace the Nickname with either your own or a friends).
/.notice NickName Quit bugging me
/.msg Nickname Do you mind if i message you, or is it too late to ask already :)
/.timer 1 1 echo It is now $fulldate
Ok .... heh heh ... three (ok, well maybe 2) birds explained away with one simple Script !
9b. I wanna send the ping time when someone types !ping
Lots of people asked for this next one, so here it is. Someone types !ping and you reply them with their PING time. This takes 2 lines in your Remotes file. One to Ping the person, and the other to send him his ping time.
SCRIPT
on 1:TEXT:!ping:*:/ctcp $nick ping
on 1:CTCPREPLY:PING*: { %pt = $ctime - $2 | /notice $nick $nick Your Ping Reply Is $duration(%pt) }
Do you need this one explained ? Drat. Fortunately the on 1:TEXT is covered in 5. above. This remote gets triggered in a channel or a message window ( :*: ) and only when the exact word !ping is typed. On getting triggered, it pings the nickname using the format for pinging someone /ctcp $nick ping. Try pinging yourself in mIRC by typing this in any window //ctcp $me ping :). There's a new one for you, the $me is the same as your nickname. Notice the doubles slashes //. Why two you ask! Good question. To have variables ( stuff like %variable) or identifiers ( like $me ) actually be converted into their real values when used in aliases or commands entered in the Edit Box, you have to use 2 slashes ( // ).
So you pinged the lagger who typed !ping. What next! Well, you have to catch his reply to you, as you did in 9a above. You again do this using the on 1:CTCPREPLY: remote and look only at :PING*: replies, no other types of ctcp replies, thus the PING in there.
So, now what is $ctime hmmmmmm. Jeeeeeez, wish I had explained it in 9a. LOL. Let me go check the help file :) $ctime returns total number of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time.
%pt = $ctime - $2
Ok. What is $2. When you PING someone, you send them
your current time in the form of your $ctime at the time of
sending your ping request. When they reply you, they send this exact same number back.
When it arrives, you take your present $ctime and subtract
from it the $ctime ( given back as the 2nd parameter of the
CTCPREPLY which in this case is $2 ) you sent them, and the
difference is your lag. Your Remote line above now stores this difference in the variable %pt. Did you understand that? Yes ? Good. No? Read it again then.
Next ........
/notice $nick $nick Your Ping Reply Is $duration(%pt) }
This is easier. You next send a /notice to the person who gave you the CTCPREPLY, namely $nick, and tell him what his PING reply is (the lag time). And in this case it's stored in the variable %pt.
So what is that $duration you ask! $duration(N) Returns the specified number of seconds in a week/day/hour/minute/second format. So for example, try typing this (again remember the double slashes // ) in mIRC: //echo 2 $duration(123) and you will see that 123 seconds translates nicely to 2mins 3secs. Much nicer than 123 seconds. But a helluva long lag time! Have fun :)
10. I am tired of all those people sending me exe files and com files and script.ini
Sure, aren't we all ! So this is how we can automatically stop it.
SCRIPT
ctcp 1:DCC SEND:{ /echo 6 -a $nick is $1 $2 $+ ing Filename:
$3 which is $6 bytes long from IP No. $longip($4) suggesting i receive it on port number
$5 | if (($right($3,3) == exe) || ($right($3,3) == com) || ($right($3,3) == script.ini)) {
/notice $nick I Don't Need this stuff thanks | echo 4 -a File transfer from $nick stopped
- Auto refusal of unwanted file type | halt } }
Wow, do i really have to explain this one ?
The DCC Send of a file is initiated with a CTCP message, and therefore the remote must look for this.
When I tried to find out how to use the RAW commands, everyone who knew made it out that it was some kind of a top secret weapon that couldn't be shared. So, what is RAW and how can you use it !
Raw messages are sent to your mIRC© program by the server - and mIRC© responds to it in certain ways. To immediately see what is happening, paste this line in your remotes file:
SCRIPT for a GLOBAL RAW capture.
raw *:*: echo 4 $numeric : $2-
Now, with this command in place and your remotes turned on ( /remote on ), type //whois $me and watch all the stuff echoed in Red in your Status Window. All that is what is being caught from your Remote line and sent to your Status Window.
raw
This catches the Server Raw replies from the IRC Server you are connected to.
*:*:
The first *: corresponds to catching any numerical reply that comes, the second *: refers to catching them anywhere they are received.
echo 4
The echo means the result will be echoed to your screen and that only you see it. It does not go out on the IRC server for other people to see. The 4 is the colour it will appear in. In this case the colour number 4 is RED.
$numeric
This picks up the RAW Number of the reply, which you will see before each RED echo in your status window. Usually a 3 digit number.
$2-
This picks up the reply from the IRC server starting from the second parameter onwards. We omit the first parameter ( i.e. we don't use $1- ) because the first parameter $1 only contains only your Nickname.
So how do we use this ! Well, be creative, try the line below, and see what you make of it. To use it you will need to comment out the line above, because once the RAW reply has been Captured by one Remote Script, it stops looking in the Remotes files for another independent Remote line.
PS. Try this one too:
SCRIPT
raw *:*: echo 4 $numeric $+ : 1= $1 2= $2 3= $3 4= $4 5= $5
6= $6 7= $7 8-= $8- | halt
NEXT ......
SCRIPT for part of the /whois
RAW reply.
raw 311:*:msg $active My nickname is $1 -- I did a /whois on
$2 -- their user name is $3 -- their host is $4 -- and their Real name field contains $5
$6 $7 $8-
Put that line in your remotes file after commenting out the Global RAW capture line and then in any open channel in mIRC© type //whois $me and watch your message to that channel.
You can also add another raw line to capture the server name like this:
SCRIPT for catching more of the /whois
RAW reply and this time only echo-ing it to the active window.
raw 312:*:echo -a $2 is using the server: $3
And then if you need the channels they are on:
SCRIPT for the /whois RAW
reply, echo-ing it to the active window.
raw 319:*:echo -a $2 is on channels: $3
Raw events are special IRC Server messages that are identified only by a number. They
follow a protocol called RFC1459 ( The best URL page for all the RAW reply numbers is - Jeepster's Numeric Reference and
if you have the patience - you may just be crazy enough to check out RFC 1459. ![]()
12. I always wanted to PING my IRC server.
Here's something interesting which I found very useful. I've always wanted to know my lag time to the Undernet IRC server I was connected to. Finally found a nice simple way to do it. You need a simple alias line and some even simpler raw script. This is what I have.
/sp /raw time $server | /set %pingserver $ticks | /.enable #serverping
SCRIPT
#serverping off
raw 391:*: {
/set %pingserver.return $ticks
/echo 4 -a ping to server took $calc( (%pingserver.return - %pingserver) / 2000 ) seconds
/.disable #serverping
}
#serverping end
So what is happening here? We have an alias first called /sp that sends a time request to the server you are connected to ($server) using the /RAW method of communicating with the server. Next the alias /sp records the time ($ticks) that this request was sent into the variable %pingserver. Lastly the alias /sp enables - that is makes available - a group of commands called #serverping. Therefore after the alias /sp has run, you have sent a time request to the server you are connected to, you have stored a time value of containing the time that request was sent, and you have enabled a group of commands.
When the server replies the time request you sent it, it does so with the:
391 RPL_TIME "<server> :<string showing server's
local time>"
When replying to the TIME message, a server must send the reply using the RPL_TIME
format above. The string showing the time need only contain the correct day and time
there. There is no further requirement for the time string.
I'll definitely explain the rest, but my coffee is getting cold. BBS :) ![]()
Don't you wish I had more to say on this section ? Well, while you're waiting for me to finish, why not check out SixTwelve's ( from Undernet #mirchelp ) RAW Help page.
Came across this idea when Mouldr in #mIRC asked for help on doing it. It was so simple to do and seemed quite cute so here it is.
SCRIPT
on 1:input:#:if ($1 ison $chan) { msg $chan 4 $+ $1 $+
: $2- | halt }
If you don't mind too much I'll explain this part on one of those quiet rainy days :)
So, where does this lead us ? Well, how about using this to avoid saying a bad word on a channel by mistake. That would be nice since we won't get kicked just for swearing a little by accident. Here goes:
SCRIPT
on 1:input:#:{
if ($1 ison $chan) { msg $chan 4 $+ $1 $+ : $2- | halt }
}
Making custom windows is not really Beginners Scripting, but it is so much fun, it's only fair to put in something. Also the Help available on some parts, especially Popups in Custom Windows, is apalling. Hope you don't feel the same way about it once you finish my attempt :)
First I am going to cop out a bit by telling you to type /help Custom Windows in mIRC and browse through that. Also there is a good help file written a while back: DataHntr's Custom Windows FAQ
Because there are so many options (which makes it look scary) in opening a custom window, I will not explain each and every option here. But I will paste the syntax just to scare you a bit!
/window [-abcdefhl[N]noprsx] [-tN,..,N] [+bfmnstx] <@name>
[x y [w h]] [/command] [popup.txt] [font [size]]
Let's make the most basic window first. Just type this line anywhere in an open mIRC window:
/window @win1 120 100 400 185 @Win1 MS Serif 11
Commenting out a line of script.
You can comment out a line by adding a ; ( semicolon ) before the line. So a script line as shown below will not execute.
;raw *:*: echo 4 $numeric : $2-
Return back to where you were in RAW .
To learn more about how LEVELS work, type /help levels in any open window in mIRC©. This will pop open the mIRC© help file to the right place.
Back to the Auto Join Message Back to CTCP Ping
When you ping someone - they reply you with the exact time they received your PING. When you get this time value back from them, it is subtracted from the time you received the reply back. This now tells you how long it takes for something they type to appear on your screen - this is known as the lag time between the person you PINGed and you. So if you receive my PING at exactly 12:00 noon and I receive back your PING Reply at 15 seconds past 12:00 noon ( hopefully on the same day :), then the lag time between us is 15 seconds.
OK, that seems simple enough ! Then what is that PING? PONG! that keeps appearing in my status window ? well, PING is the IRC server you are connected to inquiring wether the client (your IRC software, in this case mIRC© ) is still connected to the server. PONG is the response from your client mIRC© indicating you are still there. If the server does not get a PONG, you are disconnected by a ping timeout. The process is automatic. Back to CTCP Ping
CTCP stands for Client-To-Client-Protocol which is a special type of communication between IRC Clients. The other main ctcp events are VERSION CLIENTINFO FINGER TIME USERINFO SOUND DCC ACCEPT RESUME ACTION. The last four not highlighted in white are usually best not tampered with as they will give you DCC chat and send problems. Back to CTCP Ping
/RAW method of communicating with the server.
This is almost straight from the mIRC© help file:
/raw [-q] <command>
Sends any parameters you supply directly to the server. You must know the correct RAW
format of the command you are sending. Useful for sending commands which mIRC hasn't
implemented yet. The -q switch makes the raw work quietly without printing what it's
sending. This command does the same thing as /quote in other IRC clients.
/raw PRIVMSG nickname :Hellooo there!
Just a note here is that the colon : before the message starts is necessary. Back to Server Ping
$ticks Returns the number of ticks since your O/S (Operating system) was first started. Ticks are 1000th of a second, so 1000 ticks = 1 second :) I use this just as a reference point in time, since the actual time makes no difference, we only need the difference in times. Back to Real Ping
This page has been viewed times. Click on the button for some fun statistics.
To the Index Top of this page I missed the aliases? Gimme more scripts! Back to Free's Home Page