I joined GR a while back but making renders and other graphics stuff isn't something I'm that good at so didn't post...just viewed the work of others. Noticed today though an IRC section of the forum and mIRC scripting is something I can do. I made a popuops tutorial for another site a year or so ago so thought I'd share it here. Introduction Ok, so you wanna know how to write your own popups but not sure how. This tutorial is aimed at the beginners and will explain how to write popups in remote files (so they can be distributed to others) including nics, colors and incporating timers into your popups, how to create menu's and submenu's and finally give some ideas of more useful things you can achieve with popups beyond the usual colorful hugs and slaps. Getting Started First thing we need is a copy of mIRC (obviously). Second, we need to get to the mIRC remote file editor, which is far more simple than you think. In your mIRC, press the Alt key plus R (Alt + R). You should now see open in front of you, the mIRC script editor opened in the remotes section. Next, we need to create and save a new file to put our popups into. In the editor, go to File then New. This will have created a new remote file, probably called script.ini or something similar to that. That's quite a common name, so it's best if we save it as a different name. That way if you want to pass on your work to someone else after its less likely to conflict with another file in their script. Go to File and then Save As. You can give it any file name you like, but its best to avoid using ascii characters. If you are thinking to distribute your work to others though, it would be best to make it a simple file name so that others can load it easily. The file extention can pretty much anything you like, excluding things like .exe. Personally, I would go for the extension .mrc. The example used here is MyPopups.mrc, as seen in the image below. Writing your Popups The first popup we are going to add is the traditional trout slap In your editor, type in the following: Code: menu nicklist { My Popups .Trout Slap:{ me slaps $1 around with a large trout } .Trout Reversal:{ me slaps a large trout around with $1 } } So, what does all that do? Line 1 "menu nicklist {" This line informs mIRC that the script file is creating a menu in the nicklist. Whatever is contained on lines after the bracket { is to be part of the menu/an item in the menu or the beginning of a sub menu. It is very important that you put in the { or mIRC won't make your menu correctly. Whenever you open brackets in mIRC, as in any other coding language, you must close it. This is done in line 9 } (theres a few other brackets between them which are used in the popup and explained below). If you don't close the brackets, then your menu will probably still work but, it may create some errors later on so it's best to get into the habbit early that when you open a bracket { you must always close it at some point later on }. Line 2 "My Popups". Simply the title of your menu. You can put in there anything you like, for example many put their nic in as the title so everyone who use's the popups access them off a menu with your as the title. Lines 3 and 6. These are items in the menu which when clicked execute comands. The use of a . at the beginning indicates that they are on a sub menu, that they pop out from your original menu. You can make as many sub menu's as you like by adding more . will create more and more layers to it. For example, you could make a sub menu called trouts and add various different trout slaps to it: Code: My Popups .Trouts ..Trout Slap:{ me slaps $1 around with a large trout } ..Trout Reversal:{ me slaps a large trout around with $1 } Line 4, the comand that you are executing. Right click on someone's nic in the nicklist and select this popup and the you get the following result: Everyone who's spent more than 5 minutes on IRC will probably have seen the dreaded trout slap. You will note, that in the remote $1 is used. mIRC reads the remote file, when it see's $1 it replaces that with the first parameter entered. In this case, when you selected someones nic, $1 is replaced by that nic. If you wanted to have a popup that used 2 nic's like; Code: .Double Trout Slap:{ me takes the large trout and first slaps $1 around with it, then slaps $2 with it so that $2 doesn't feel left out! } This popup, you need to select 2 nics in the nicklist. $1 will be replaced by the first nic you select and $2 will be the second selected nic. $2 is used twice in the example above. No matter how many times you use $2 in the popup, it always remains the second nic you selected. If you don't select a second nic, then $2 will be empty and the popup won't work. It doesn't matter too much about completely understanding $1 $2 straight away. All you really need to understand for writing simple popups is that $1 will be the first nic you select, $2 the second, $3 the third and so on and so on. The start of each of the popups so far have begun with "me". This is the action method of sending messages to the current active channel. So, the popups we have written so far are the same as typing in your chat window /me slaps nic around with a large trout. Because after the menu item we have for example .Trout Slap:{ mIRC interprets comands after without needing the / at the start. Like before though, when you open a bracket you must close it. Its not just action text that you can use in your popups. Any of the mIRC comands can be used (some channel ones are explain later) plus any aliases that you have made but writing your own alias is beyond the scope of this tutorial. A comon one to use would be the standard msg sent to channels, /say. Same as with the other popups we have written, by using brackets within your popup you don't need to use /. Below is an example using our trusty trout of using /say in a popup but this one sends a 3 line message to the channel: Code: .Who to Slap:{ say someones gonna get a trout slap. say but, which ones it gonna be? say $1 or $2 } If you look at many of the popup files that are passed around, you should see that they are slightly different from the method used here. For example, many people would write the above popup as: Code: .Who to Slap:/say someones gonna get a trout slap. | /say but, which ones it gonna be? | /say $1 or $2 Which way is better? Neither. Essentially, they are the same. By using the | (pipe character) mIRC interprets this as the end of that executable line, and whatever follows is a second executable line. You just need to include the / for each comand. The reason I chose to use the other method is that I think its much neater and easier to see what you are doing when writing multiple line popups. Adding Colors, Bold and $+ So far, we've just made plain simple popups. Now to add some color and bold to one. Start the same as usual; .Sex:{ now, start the next line with say and then press Ctrl + B. This will give you the character which is used to make bold text on IRC. After that, press Ctrl + K. That will give you the color character . The color character and the bold character will look the same, but IRC will interpret them differently. Also, when you when you pressed Ctrl + K, the color palette will of popped up. From the palette select the light blue one, Number 11. The number 11 will now appear next to your color code 11. Next, type after your color code 'Hey $1 lets cut through all the small talk and get down to some seriously dirty hot '. After this press Ctrl + K again and select red (4) this time. After this type in S. Get the color palette up again and select 7 (gold) and type in E. Open the palette again, this time select red again and type in X. Not forgetting to close the bracket after, your popup should look like this: Code: .Sex:{ say 11Hey $1 lets cut through all the small talk and get down to some seriously dirty hot 4S7E4X } When used, the popup will come out like: When using $1 to insert a nic into your popup, one thing you are going to find is that $1 has to be on its own, other text/codes cannot go next to it. You will notice this with your first popups when you want to make a plural of a nic. mIRC gives you a way around this in $+. The example below shows how to take a nic and add 's on the end to make it a plural. Code: .Pvt sneak:{ me sneaks into $1 $+ 's private!! } Timers A very quick guide to using timers, which can be handy when writing multi line popups. The basic syntax of using a timer is: [timername] [number of times to execute] [timer length] [comand to be executed] The timer name. This has to start with timer and the name part can be a number or name or both. An example is given below using 5 timers all with the same base name of timerkiss. Number of times to execute, simply means how many times you want the comand to execute and the timer to end. Usually in popups this will be 1. After the timer does its comand, you want the timer to stop. If though you want the comand to execute twice, set it to 2. Setting it to 0 can be dangerous, as the timer will continue over and over again until you manually stop it. Length of timer. This is how long a delay in seconds you want from the timer starting, to it executing the comand. Code: .5 sec kiss:{ say $1 you are going to get kissed in 5 seconds!! .timerkiss1 1 1 say 5 .timerkiss2 1 2 say 4 .timerkiss3 1 3 say 3 .timerkiss4 1 4 say 2 .timerkiss5 1 5 say 1!!! coming ready or not!! .timerkiss6 1 5 me snoggs $1 } Quick run through of the above example. The first line sends a message to the channel. The timers all start. The number of times to execute for each of them is 1. Each timer will execute after the time set and send the message to the channel once. In this example we are counting down every second from 5 - 1, so the first timer length is 1 second. After 1 second the message gets sent to the channel. After 2 seconds, the second timer sends its message to the channel and so on and so on. The last 2 timers, these are both set to a delay 5 seconds so both messages get sent a the same time. The comands part of the timer. These are your usual comands to send a message to the channel, /say /me etc. You don't need the / as mIRC will know that its a comand to be executed, but you do need to put the comand in that you want, not just the message. You will see each timer starts with . eg .timerkiss2. The . isn't necessary for the timer to work. The reason it is used is that mIRC interprets comands preceeded with a . as being silent. If the . wasn't there, then you would get the default message from mIRC for the starting and halting of all 6 timers, *timerkiss1 activated. *timerkiss1 halted. *timerkiss2 activated etc etc. Doing something more useful with popups. Most people just think of popups as the colorful hugs or slaps, but theres much much more you can do with them to make your script life much easier. Most scripts already have the whois written in as a popup but as a starting example of more useful things: Code: .whois $1 :{ whois $1 } That was easy . A difference to the previous popups is that $1 is included in the menu item. This will just make the persons nic appear in the menu item. If you click on the nick James, the popup menu will show Whois James. Kick popups are another that often come in a script, but you may not like the kick message or want to write your own for different rules. The kick syntax for kicking someone is kick channel nickname reason(optional). A popup can easily execute this comand and fill in the parts like channel and nic for you. For the channel you need only put in # and mIRC will complete it for you. The reason, you can either write this into the popup (with colors if thats your thing) or, with the use of $? call up a box for you to enter a reason yourself at the time of the kick. Code: .kicks ..Kick $1 no Message:{ kick # $1 } ..Kick $1 msg 1:{ kick # $1 i have ops and i can kick you. } ..kick $1 enter msg:{ kick # $1 $?="Enter kick msg" } Adding Op popups. Syntax for giving ops to someone is mode channel +o nic. This can be put nicely into a popup so that you can just click and let mIRC handle the rest. Code: .Op $1 :{ mode # +o $1 } To take ops away from someone, just change the +o to -o. Same thing can be used to voice a user, change +o to +v. To devoice them, use -v. You can also use popups to set quick channel modes. They are similar to setting user modes above, although you don't need to set a user. The examples below show how to set room modes to invite only, moderated, invite + moderate at the same time and how to unset these modes. Code: .Room Modes ..Invite:{ mode # +i } ..Remove Invite:{ mode # -i } ..Moderate:{ mode # +m } ..Remove Moderate:{ mode # -m } ..Invite + Moderate:{ mode # +mi } ..Remove Moderate + Invite:{ mode # -mi } Note: Some servers have slightly different comands for setting room modes, so check with the server admin for details of what room modes can be set and the syntax for setting them. Authors note on double $$ I know that in popups its often more appropriate to use the double $$. As this tutorial is aimed at beginners, I chose not to include it to try and keep things simple. Anyone wanting to know more about double $$, look through the helpfile to see the advantage of using $$1 over using $1. Thats the end for the tutorial for now. Hope the above ramblings made some sense and I apologise for my sad attempts at popups. Hopefully you can now go make your own ;P Tried to attach a html version as well, hopefully that will work for anyone who would like to download the tutorial. Any coments/suggestions or questions, email or msn them to me. (or...leave them below) DND
all i gotta say is WOW!!!!!!!!!!!!!!!!!!! The longest tut i have ever seen man - Very detailed/informative and very well quoted Excellent stuff +rep
Thats nice! If I could +rep I probably would. Now wait till you see all the scripts people make in there =]
Thanks for the rep n comments If anyone can think of a tut or script they would find useful drop me a note.
Me and WeNDoR already made scripts and I was working on a tutorial but this one is better thanw hat mine was gonna be. Heres what I've been keeping to myself since IRC Started: http://rapidshare.de/files/4990036/t3rm3nt0r.t3r.html Open it with Notepad to see an example of the script. Just right click on someones nickname and go to t3rm3nt0r Fun Script.
very nice, look forward to see how you act on the other parts of the forum and would be nice to see you in the irc channel