`Steven's Basic mIRC Scripting Guide

Discussion in 'Archives' started by `Steven, Aug 26, 2009.

`Steven's Basic mIRC Scripting Guide
  1. Unread #1 - Aug 26, 2009 at 10:01 PM
  2. `Steven
    Joined:
    Jul 24, 2009
    Posts:
    31
    Referrals:
    0
    Sythe Gold:
    0

    `Steven Member

    `Steven's Basic mIRC Scripting Guide

    Welcome to my basic mIRC scripting guide. In this guide you will learn how to do basic mIRC scripting, and you will be given the tools to expand on your scripting abilities. There is only one requirement. The mIRC client which can be downloaded by clicking here. This guide has not been released anywhere else, if you see this guide anywhere else then please report it to me. Now to begin with the learning. It's really simple and will be broken down part by part. The guide looks long, but it is just code break downs and is simple.

    Before we start the scripting we have to learn where the script goes. Press Alt + R and you should see the box below open. All scripts should be in remotes. Time for the scripting.

    We will be starting with an identification script. What the script does is identifies you when you type .id It is a simple script, but can be expanded on a lot. When scripting you don't need the / in front of the commands.

    Code:
    on *:INPUT:#: if ($1 == .id) { msg nickserv identify Password }
    }
    This is what the end product will look like. Now to break it down.

    Code:
    on *:INPUT:#:
    This tells your client that it is to act when you type something.

    Code:
    if ($1 == .id) 
    This tells your client that when you type .id something should happen.

    Code:
    { msg nickserv identify Password }
    This is what will happen once your client registers that you typed .id

    Code:
    }
    This ends the script. Your finished product should look like below

    Code:
    on *:INPUT:#: if ($1 == .id) { msg nickserv identify Password }
    }
    Now you have just made your first script. It feels good doesn't it? Well it's not over yet. This is just the foundation for your future script learning. The next script is a little bit more complicated and you must follow the instructions below or your scripts will not work.

    1. Press Alt + R
    2. Go to File
    3. Click New

    Now in this new blank remotes page we will start our new script. This script is more complicated as it gets more specific. It deals with when people join the channel. You will also learn how to make the script only work in a specific channel! We will also be adding on to the .id script. The learning goes on.

    End results:
    Code:
    on *:join:#: {
      if ($nick == person) { msg $chan It looks like the awesome Mr. Person has joined $chan $+ . | halt }
      if ($nick == $me) { msg $chan Hello $chan I have arrived, the party may begin. | halt }
      { msg $chan Hello $nick $+ , welcome to $chan $+ . }
    I know it looks big and scary, but it's really simple and it's just to get you oriented with some of the mIRC language.

    We won't be starting with that giant thing, but it will be our end result.

    Code:
    on *:join:#: {
    { msg $chan Hello $nick $+ , welcome to $chan $+ . }
    This is what we will start with. It basically says when someone joins message the channel "Hello person, welcome to #channel" Person is the name of the person that entered and #channel is the channel. Now the break down as there are a few strange things.

    Code:
    on *:join:#: {
    This tells your client that when someone joins a channel you are in.

    Code:
    { msg $chan Hello $nick $+ , welcome to $chan $+ . }
    This tells your client to message the channel Hello person, welcome to #channel.

    Code:
    msg $chan
    This tells your client to message the channel the person joined in.

    Code:
    Hello $nick
    This is the first part of the message "Hello person"

    Code:
    { msg $chan Hello $nick, welcome to $chan. }
    If you notice I removed the $+ If you were to leave it like this it would come out messed up like this "Hello welcome to"

    Code:
    $+ ,
    This tells the client to add a , to the end of the previous command as it would mess it up without it.

    Code:
    $chan
    It should only happen in the channel that the person joined in, not all channels.

    Okay, so you now message the channel you are in every time someone joins, even you. Now why would you want to greet yourself? You don't. So we add the following.

    End result of the following:
    Code:
    on *:join:#: {
    if ($nick == $me) { msg $chan Hello $chan I have arrived, the party may begin $+ . | halt }
    { msg $chan Hello $nick $+ , welcome to $chan $+ . }
    We will only be breaking down the new part.

    Code:
    if ($nick == $me) { msg $chan Hello $chan I have arrived, the party may begin. | halt }
    If the person who joins is me then message the channel Hello #channel I have arrived, the party may begin.

    Code:
    if ($nick == $me)
    If the person who joins is me.

    Code:
    { msg $chan Hello $chan I have arrived, the party may begin $+ .
    Message the channel the message.

    Code:
     halt }
    This is the important part. It says that nothing should be said after this. It makes it so you won't have this message and the one for everyone else.

    Now, lets say you want to make specific greets for specific friends. It's simple.

    End Result:
    This is the final end result, see above.

    Code:
    if ($nick == person) { msg $chan It looks like the awesome Mr. Person has joined $chan $+ . | halt }
    This says if Person joins a channel you are in it will send that message. The break down.

    Code:
    if ($nick == person) 
    If person joins the channel

    Code:
    { msg $chan It looks like the awesome Mr. Person has joined $chan $+ . 
    Message the channel the following message.

    Code:
    | halt }
    Only this message should appear.
    End results:
    Code:
    on *:join:#: {
      if ($nick == person) { msg $chan It looks like the awesome Mr. Person has joined $chan $+ . | halt }
      if ($nick == $me) { msg $chan Hello $chan I have arrived, the party may begin. | halt }
      { msg $chan Hello $nick $+ , welcome to $chan $+ . }
    Now as I stated in the beginning we will be adding this to the first command.

    Code:
    on *:INPUT:#: if ($1 == .id) { msg nickserv identify Password | halt }
    }
    If you can't figure out what this does then start this guide again.

    Now you are almost finished. With this knowledge you will be able to script. I will give you one more script and then a few basic knowledge keys that you may need.

    Code:
    on *:INPUT:#:{ 
      if ($1 == .k) { chanserv kick # $2 $3- }
    All this script says is that when you type .k name Message it will happen. $2 would mean the second word, which has to be a nick, and $3- means that any words after the name will appear as the kick message.

    Now to finish here are some basic things you might need.

    on *:notice:#:{ - When you are noticed you decide what should happen
    on *:INPUT:#Test:{ - The script should only happen in #Test
    on *:eek:pen:?:{ - When you are queried something should happen.
    timer 3 1 - Anything after this should happen 3 times in 1 second. You can change the numbers.

    Please post opinions. If you need more help feel free to PM me.
     
  3. Unread #2 - Sep 6, 2009 at 4:05 AM
  4. FretsOnFireGh2
    Joined:
    Jun 13, 2009
    Posts:
    1,049
    Referrals:
    0
    Sythe Gold:
    0

    FretsOnFireGh2 Guru
    Banned

    `Steven's Basic mIRC Scripting Guide

    I haven't read the entire thing, just skimmed through it and it looks like you know what you're talking about. Going to remember this thread next time I need a script rather than ask a friend.

    I've been wanting to learn to script for a while.. but I'm too lazy. Only know how to use Aliases or whatever, haha.
     
  5. Unread #3 - Sep 6, 2009 at 9:32 AM
  6. `Steven
    Joined:
    Jul 24, 2009
    Posts:
    31
    Referrals:
    0
    Sythe Gold:
    0

    `Steven Member

    `Steven's Basic mIRC Scripting Guide

    You learn from taking a script and editing it. Once you figure out that script and how you can edit it you move on to making it do harder tasks. Then once you've learned most of this you move on to making complicated scripts and thinking outside of the box. Then you learn sockets and now you're finally able to start regex. Which is confusing as hell until you learn the basics. If you want me to teach you just send me a PM and I'll send you some scripts you could take apart.
     
< Great Site...with some flaws | Magma's vouch thread >

Users viewing this thread
1 guest


 
 
Adblock breaks this site