mIRC Scripting Guide

Brett

Back...Sorta
Member
Scripting Basics

What is a script?

A script is a snippet of coding, which when certain criteria is met, or a certain event triggered performs actions which are set in the script. Scripts can also be used for making things such as very basic online mp3 players, to just simply reading a file for you to see if it contains certain info your searching for. As for how hard it is to make a script, well that depends on what section of scripting your in, and many other things.

What can a script do?

Scripts can do so many things, to be able to list them all would just be insane. However there are many basic things people use scripts for and here is a basic list:
  • When you connect to IRC
  • When someone joins a channel
  • To add color to your text (Not available in #pokebeach.com or in any channel with a channel mode +S, and/or +C)
  • Games
  • Commands to be triggered such as if someone says hi you can instantly respond Hi without physically typing it.
  • MP3 Players or Now Playing

Now that we have established a basic list which you could probably come up with so many more ways of doing scripts and using them. However as a warning, in #pokebeach.com script or delimiter abuse is NOT tolerated, if you are caught abusing those two things you will be kicked without warning.

As a note to scripters, you will basically always want to add a flood control to your scripts so they are not abused in that way, and if you don’t use a flood limit, just hope your script isn’t abused during a time of a missing OP as after so much abuse you can “flood” out of a channel or off the server completely. By “flood” it simply refers to someone typing to fast within a set time frame. For #pokebeach.com it is set for +f 2:3 which means no more then 2 lines per 3 seconds.

The Basics:
  • I highly suggest you read this thread before this one, as it will help you understand basic terms I will be using, it also introduces you to a couple things you should know.
  • Alt+R Will Automatically open the Remote tab which we will be primarily using
    throughout this tutorial, however I will also be introducing you to the Alias and Variables tabs.
  • Most scripts contain on or off as the first word in the line for remote tab, however some exceptions exist.
  • If your a more advanced scripter I would suggest reading the 2nd part of this guide, for Advanced Users, I am accepting any and all contributions to this section.

For making a basic script this is the most basic build you will get, this goes in the Remote tab!:
Code:
On *:TEXT:Text:#: { Effects of someone typing Text here. }

Now the on, is changeable to off, which simply controls if the script is on or off respectively. In the on setting if someone types Text your script will go off, and if it is set to off, it won’t go off.

The asterisk(*) stands for a power-level. This is changeable to match your server/channel powers. So in an essence if the person who typed Text is not of, or above a certain power-level then the script won’t go. This is useful if you have a script which you want to only be accesed by Ops or some other power level.
The :TEXT: is what kind of form you want the message to come. Some alternatives to this would be Notice or Action. The Text event means if someone use a text sentence without something to change it such as the /me command it will activate. However if someone typed /me Text, then you would simply substitute :TEXT: with :ACTION: which Action is in essence just saying /me but /me will not work. If someone used the /notice command to send the word Text to you then like before substitute :TEXT: with :NOTICE: respectively. There are many more substitutes to learn about, and you can find those by typing this command in your mIRC window, /help on.

The flat Text is simply the activation command. This can range from being Hello, to !party. This is 100% your choice and unless your using more advanced scripting, will never be changed from what I have listed. As a side note, *Text* will work the same as Text, except for the fact it will search through the entire line someone types for the word and not just as a single line. So if they used Text moo cow moo, then without using *Text* it will fail to work.

Next up is the Number Sign(#). This can be specified for channel use only using the flat #. For a specific channel, #channel. Another way of using it is with a Question Mark(?), which represents a Query Window which is also known as a Private Message on chat. This is simply a conversation between you and a single person. The final way of expression would be an Asterisk(*). The * stands for in any channel, and Query Windows. You can also specify a series of channels for example:
Code:
On *:Text:Text:#pokebeach.com, #pbconnect, ?: {

That simply means this script will activate in #pokebeach.com, #pbconnect, and in all Query Windows.

Lastly we have the { and } Brackets. These simply mean the start, {, and end, }, of a script.

Example of a full basic script:
Code:
On *:TEXT:Hello:#: { msg # Hello $nick $+ . }

Just to go over the new things in that script you didn’t see in the basic script body, msg simply means your response will be sent in msg form. The # means it is being displayed in the channel in which is was activated. $nick stands for the person who activated your script. So if Bob activated your script the name Bob would substitute into the $nick slot. The $+ is subtracting the space between $nick and the period(.). You need this because $nick. Is not a variable you can use, so the $+ will simply turn that into this, assuming Bob is the activator: “Hello Bob.”

Closing Notes:

To wrap up what has been said above here is a sum up for those of you who like to skim read, however later on this is highly discouraged.
  • Alt + R opens the Remote Tab.
  • The 1st word in a basic script is usually on or off.
  • 1st * = Power Level
  • :TEXT: stands for the definition of the item in which the script is looking for. Example: <Koala> Hi or[/b] /me slaps Koala around a bit with a large trout. (Action)
    [*] Text = Whatever the activation command is.
    [*] # = Useable in any channel. Substitutable with: #channel, ?, or *.
    [*] { and } = The Starting and Closing brackets, in that order.


Thanks for reading part 1 of ?. You have finished reading this section of the guide. Please use the quick links below to continue onward in your scripting venture.

Back to Top || Part 2 || Part 3?
 
Back
Top