mIRC ScriptBox
Basics: Introduction into Popups

Written by Merlin

Table of Content

  1. How to open the Editor for Popups?
  2. Where do we find/store our Popups?
  3. Organizing our Popups
  4. A Note before we start
  5. Selecting what kind of popup
  6. Special characters
  7. Giving it a title
  8. Making our first layers
  9. Test of our first popup
  10. Using Brackets {}
  11. The Pipe Symbol |
  12. Preparing for the next Popup
  13. Popups in various Sectiont
  14. Conclusion

Introduction

This tutorial has first been made public available during my successful CBT Project started in 1998, where Eggdrop Bots on various IRC networks have been set up to give courses on IRC.

These courses have never before been released on any web site or have been submitted to anyone.


1. How to open the Editor for Popups?  Back to Top

To open the builtin editor and go to the Popups section there are two ways you can use:
  • Hold down the ALT-key and while holding it down press the letter 'P' and then release both keys or
  • Click 'Tools', then 'Scripts Editor'.

You can see now a line that looks like this:

Below that there are 5 tabs (because you used ALT-P, the 'Popups'-Tab is put in the foreground):

Below that you can see the Editor window - exactly where we will edit our popups throughout this tutorial.


2. Where do we find/store our Popups?  Back to Top

Let us begin by learning where exactly we add popups. mIRC comes with a default set of popups in a file called popups.ini. This file, by default, has 5 sections that correspond to the 5 popup sections that can be edited.

If you now click on View you can see

Clicking on any of these screens under View, brings up the screen selected when checked, and makes that screen available for current editing. It is NOT enough to say, "I added it to popups." because popups has 5 sections within it. The 5 sections are: Status, Channel, Query, Nick List and Menu Bar.

Which section a popup is added to determines where it will be visible when you a Right-Click with your mouse. A popup added to Status will show up when you do a Right-Click in your Status window. Likewise, a popup added to Nickname list will appear when you highlight a nickname and do a Right-Click.

Selection Description
Status Commands listed here when Right-Clicked from Status page
Channel Commands listed here when Right-Clicked from Channel page
Query Commands listed here when Right-Clicked from Query page
Nick List Commands listed here when Right-clicked on Nickname
Menu Bar Commands listed here when Clicked from Commands from the Menu Bar

Before trying to make/write a popup, think for a moment when and where you want access to this popup. This is Step 1 of organizing your popups so they are easy to use and effective! Lets assume you would like to make a set of popups to be used when you Right-Click a nickname. All these popups will say channel text, and will be 'cute saying'.


3. Organizing our Popups  Back to Top

Before trying to make/write a popup, think for a moment when and where you want access to this popup. This is Step 1 of organizing your popups so they are easy to use and effective! Lets assume you would like to make a set of popups to be used when you Right-Click a nickname. All these popups will say channel text, and will be 'cute saying'.


4. A Note before we start  Back to Top

This would be a well defined goal when making a set of popups, even if it was a very small set to begin with. Since mIRC has no default set of cute saying, we will want to add a new area in popups that will be unique from the rest so they will be easy to locate.


5. Selecting what kind of popup  Back to Top

Press Alt-P to open the popup editor. There, you will see a menu selection called View.
In View is where you select one of the five sections we ware talking about.
Select 4 Nick List.

Scroll down to the bottom of any popups there. You will append new popups to the end of the file on the first blank line.


6. Special Characters  Back to Top

Since you wanted a new area to add popups into, we will introduce you to the first of several organizational tools used in popups. It is the - character.

When a line in popups consists solely of the character - , it tells mIRC this is a new area of popups, make an indention in the popup window, and will be followed by an area title.

Confusing, we know. But once you add these popups and see the result, it might be more clear.


7. Giving it a title  Back to Top

So, your in popups editor (Alt-P) and in the Nicknames list section and at the bottom of the window at the first blank line, make a line that consists solely of: -

Directly under this, we add this areas title. Add a second line of:

Cute Sayings


8. Making our first layers  Back to Top

Making our first layers

Ok, now copy/paste each line into you popup editor window. We marked these lines bold, so you can better see what to copy. Don't copy the numbers and the colon - we added them for the description to follow in the next paragraph.


 1:Cutesayings
 2: .Hug: /me gives $$1 a big hug!!!
 3: .Rose: /me hands $$1 a rose ---->--`-,--<@
 4: .Kiss: /me gives $$1 an earth shattering, long, wet, and deep KISS!!!
 5: .Bighug: {  
 6:   /me sees $$1 in # 
 7:   /me runs over to $$1 
 8:   /me gives $$1 a HUGE HUG!! 
 9: } 
10: .Vertical Hello: { say H | say e | say l | say l | say o }
Description: The Function of the Period
First, why the . (Period) thing (Lines 2-5 and Line 10)? Well, popups can be layered an infinite amount. This means a popup group can have sub-groups, which can hold sub-groups etc.
The . (period) tells mIRC to which 'layer' a popup belongs. All five of your new popups begin with a single period. All five will appear in the same grouping.

Directly after the . grouping is the word that will appear when you use the popups. This is the thing you click on to 'run' the alias. (In our example: Hug, Rose, Kiss and Bighug are the names.)

Description: /me

Everything after this are the commands mIRC will execute when the popup is run. In all three of these examples, the commands are /me statements (Lines 2-4 and Lines 6-8). It will appear as if you had actually typed it. /me does these things to the rest of the channel.

Description: $$1

Now the good part :) Whats with that $$1 thing? In the Nickname list popups, $$1 refers to the nickname which you have highlighted when you do a Right-Click with your mouse on it. That nickname will be inserted anywhere you use the $$1 identifier. Neat huh? (say yes). The $$1 thing is an identifier. Identifiers are always preceded with one or two dollar ($) signs.


9. Test of our first Popup  Back to Top

Now a test run. Highlight a nickname to the right in your nicklist. (Use Left-Click and Right-Click to do it).
You should see a subtile line in the popup window just above the word Cute Sayings.
Thats what that '-' did. It's the ONLY thing an '-' does - to draw a line which is used to seperate groups of Layers (popups).

Place your mouse cursor on the words Cute Sayings and a group of popups should fold out (3 to be exact). Click on any one of the three. mIRC should say something in the channel.

Great, you have made a small set of popups. Congratulations!!!


10. Using Brackets {}  Back to Top

You will have noticed the fourth and fifth popup look a bit different. (Reminder: Each line is a separate popup). The fourth popup (Lines 5-9) is three lines, each line preceded with a new command what to do. The whole popup is contained within brackets. A single bracket at the start of the command line (Line 5) and a matching enclosing bracket at the end (Line 9) encase the whole sequence of commands.

ALL commands MUST have matching brackets. You will notice your editor has a little button at the top upper right, which will check these for you when something doesn't work. The {} <--becomes your best friend!

Brackets must ALWAYS have at least ONE space on each side {<SPACE>command<SPACE>}!!!


11. The Pipe Symbol |  Back to Top

The next and last popup (Line 10) you just made contains a '|' (called a pipe). Most keyboards have it in the upper left corner of your keyboard to the left of your backspace tab (or left arrow) or SHIFT-\ on most keyboards. (German keyboard: AltGr-<)

This '|' (Pipe) is a hard return command that starts a next line. (In general the pipe is used to end one command and use it's output in the command followed by that pipe character).

In our Popup, it simply returns to the next command line as if you pressed <Enter>.

It's just harder to read when analysing possible mistakes in a script. As in ANY command line, you MUST start the line with the COMMAND (such as "say", "me", "timer", "run" or whatever you will be doing in the following lines).

This pipe saves lines and does the same thing as in popups form. A pipe MUST also have a space on EACH side to be functional. MOST scripting channels will request you present your text in long form as in popup when trying to detect errors.


12. Preparing for the next Popup  Back to Top

The rules and skills involving brackets and pipes as with your identifiers (preceded by $ as in $$1 in your popups) will be consistant throughout mIRC scripting, with a few exceptions.

For learning purposes - the next popups will be constructed as follows: You will use the same structure in creating your own popups.

Below the ones you have created, add the following lines for popups (using the Copy/Paste technique you've learned). Same section, Nick List.
Note: Don't add the number and the colon at the beginning!


1:Learning Layering
2:.Level 1
3:..First test:me does a test
4:.Level 2
5:..Another level
6:...Testing:me is 3 layers deep in popups now
7:...Testing again:me says see above
8:.Level 3
9:..Last test:me has learned to layer popups
Now for the testiong of this popup:

Well, the only thing we can say is: Click util it makes sense. The . .. ... has a purpose. It causes mIRC to make popups a part of the group above it. You will notice there is a group in a group.

These are the tools that mIRC uses to organize popups. We will briefly touch on some major points of other sections, such as the Channel and Query sections.


13. Popups in various sections  Back to Top

Section 1: Status
Usually you would only those popups there, for situations when you are not currently connected to an IRC server.
Section 2: Channel
In the Channel sections, you can refer to the channel you called the popups in with the # symbol. So if you right clicked in #MyChannel (means you are in that channel), the '#' symbol in a popup would be replaced with #MyChannel.
Section 3: Query
As with Nickname list, the $$1 means the nickname of the person in a Query/Chat window. If the Query is with Myfriend, then $$1 will be replaced with Myfriend.
Section 5: Menu Bar
The Menubar section isn't really a place you want to play in yet. Look at the main menu bar of mIRC and you will see 'Commands'. These are the things that are in the Menu Bar section of popups.

It would hold commands that really don't have anything to do with channels or nicks. Perhaps a command like /join #MyChannel.

You can have a peek at the default mIRC menubar popups in the editor using the 'View' and select 'Menubar' to get a good idea of how these are done.


14. Conclusion  Back to Top

Remember, only YOU know exactly what you want your scripts to do for you. Script away! Fail, and then try again. Fail, then ask in mIRC-related Help channels for help, which you find on every net (Channels are #mIRC, #mIRCHelp, #mIRC4Dummies and #mIRC-Scripts to name a few).

Study those popups already present in mIRC. If you don't understand one there, by all means ask about it. We hope you enjoyed our little course!

And now - Script away and have fun by seeing yourself creating neat things! :)