PDA

View Full Version : Basic Scripting


Zeus
12-07-2007, 12:10 AM
==Basic Scripting==
mIRC is an IRC client that supports scripting, obtain this client at the mIRC website (http://www.mirc.com/get.html)

===Getting Started===
All scripting is done within the Scripts Editor, a built in component to mIRC that allows you add and delete code easily.

Open up your Script Editor, by clicking on the "/a" button.
http://wiki.swiftirc.net/images/a/a1/Editor.png

Alternatively, you can also use Alt + R. This likewise opens up the editor, but directs you to where all remote scripts are placed.

Click on the "Remote" tab. Essentially, this is where all the scripts triggered by other users (Excluding yourself) go. Be warned! Scripts placed within the Remotes tab can be abused by other users, generally in the form of spam.
http://wiki.swiftirc.net/images/8/84/BigEdit.png

There are 5 tabs that can used to coincide with mIRC Scripting: The Alias tab, the PopUps tab, the Remotes tab, the Users tab, and the Variables tab. Each has it's own way of storing information, but we'll get to that within a different guide.


==Your First Remote==

Syntax can often be a tricky thing when first starting out. Although mIRC does allow space for the user to debug whenever problems occur, it's still tricky to figure out where to obtain help information from. The basic—and most obvious—way would be to utilize the help files. Since these mIRC help files are built in, all you need to do is type "/help", from where you normally input a normal command (Not within the Scripts Editor). A help file will pop-up, click on the "Index" tab for a, more-or-less, commands list for everything used in mIRC Scripting.

An easy way to start off scripting is with a trigger call On TEXT. Basically, whatever you've told the script to do, it will commence whenever someone types a phrase matching your On TEXT. This might sound a little odd, but an explanation of syntax is shown below.

http://wiki.swiftirc.net/images/7/79/Helpf.png

Once the index is open, type "On TEXT" and hit your Enter key. It should pull up a whole page on how to use this trigger. From this help file, we can conclude the standard syntax is: on <level>:TEXT:<matchtext>:<*><?><#[,#]>:<commands>


Now, within your scripts editor, we're going to type out a little remote. Nothing much, it should just message the channel whenever our trigger is matched.

ON *:TEXT:!hiworld:#: { /msg $chan Hello }


As you can see, the text that triggers the /msg is !hiworld. Let's save this as a new file name.

http://wiki.swiftirc.net/images/2/21/Save.png
Now that the file is saved, whenever someone other than yourself types !hiworld, it will respond with the message: Hello


===Quick Script Debugging===

These are basic scripting techniques for anyone who was oblivious to the resources around them. However before this long and didactic guide is over, it should be pointed out for a few key scripting mistakes.
When using brackets, { and }, be sure to ''always'' close them. Think of them as soul mates, one cannot exist without the other.
You can always check to see why a script isn't working by first triggering it, and checking your status window.
If at anytime you need to turn your remote scripts off, simply type: /remote off


''This concludes the first installment of'' - Remotes and how to use them.

Sloth
01-27-2008, 07:44 PM
***y this helped alot i was so lossed

catman102
03-02-2008, 05:17 AM
sweet i dont know how to make my own mirc thing can you help :S