#mIRCscript Tutorial
The Basics
ALIAS performed with the keyboard
KEYBOARD SHORTCUT: ALT+A
POPUP performed with the mouse
KEYBOARD SHORTCUT: ALT+P
REMOTE executed automatically
KEYBOARD SHORTCUT: ALT+R
|
To begin Scripting in mIRC click on the
HINT: It is wise to start a NEW file in the mIRC Script Editor when adding your own scripts to a chat client.
Name the new file whatever you'd like, but DO NOT overwrite existing files. "Save" the
new files with a title you will easily recognize.
To load a new script utilizing the mIRC Script Editor
FILE / NEW
LOAD
Read The Mirc Help Files!Keyboard Shortcut = F1
RECOMMENDED
What is an mIRC script?
mIRC scripting is a basic form of programming. This web site has examples of chat client scripting for mIRC and information about PnPv4.22.
What is he difference between a program and a script? Programs are a compiled executable and can
"run by itself" while a script is a plain text ascii file (addon or snippet) which needs a program
to process, run or function...
You can use NOTEPAD to create and edit mIRC Scripts using the folowing File Extensions:
.txt
.ini
.mrc
The mIRC scripting language is extensive and powerful which makes the
possibilities of what you can utilize it for almost unlimited. The main things
IRC chatters use it for is to customize the way a client looks (themes) and functions and to
automate repetitive tasks.
What do I need to create an mIRC script?
All you need to start scripting is the mIRC help file [Keyboard Shortcut = F1] that comes with the chat client and Microsoft NotePad. If you don't have the latest version of mIRC you should, because mIRC's scripting language is constanly changing and expanding. Once you get into more advanced scripting, you might need additional
reference materials, tools and program extensions but to begin with all you need is NotePad, mIRC ... and READ the help file.
How do I learn to write an mIRC script?
READ THE HELP FILES IN mIRC!
Chat Client Scripting isn't a short term project - it takes time, patience and READING. When learning to script, your best source of information is the mIRC help file. It contains the syntax and examples for all of the available commands, events and identifiers mIRC has to offer. Other places to obtain information about mIRC Scripting are search engines [google.com] or scripting channels on IRC [/list *script*] or... stop by our channel... [/join #script]
Popup Menus ALT+P
Scripting allows you to create Popup Menus in mIRC for the status window, the channel you are chatting in, the nicklist or even the "popdown" menu at the top of the software.
[Right Mouse Click on this web page for an example of a Popup Menu] Back, Forward, etc...
Popup menus can be scripted to perform many different commands that are activated by using the mouse. Popup menus can be scripted in two places: The Popups tab in mIRC's Script Editor (alt+p) or in the Remotes tab of the Script Editor (alt+r). mIRC's pre-made Popups are in the popups section The Remotes section popups are a little more flexible and easier to work with.
(Popups can be created for use in: status, menubar, channel, nicklist, query).
This scripting example is a Nicklist Popup. (As mentioned before, there are others but all use the same Scripting Syntax.)
menu nicklist {
Hello:{ msg $chan Hi $1 !! }
}
$chan refers to the active channel
$1 refers to the user nick you clicked on.
The first and last lines are simple - they define the start
and end of the menu. The second line is what is seen in the menu and
the commands that get executed. If you put this code in your remotes (ALT+R)
and right click someones name in the nicklist, you will see "Hello" in the
menu. Click "Hello" to execute the commands - The output in the channel is your nick saying
Hi to the specified nick in the channel.
menu nicklist {
COMMENTS
.Hello:{ msg $chan Hi $1 !! }
.Goodbye:{ msg $chan Cya $1 !! }
}
The above example shows how to create sub-menus using the "." (fullstop) prefix.
It's basically the same as the first example but instead of "Hello" appearing
in the main menu it appears as a sub-menu under the menu "Stuff".
Aliases ALT+A
Aliases are basically 'custom commands' that allow you to make you own
/commands from existing mIRC commands and are used mainly to shorten existing
commands (e.g /j is short for /join) and to condense a few commands into one to
save time. Like popup menus, aliases can be created in two different places:
The Aliases tab in the scripts editor and the Remotes tab - again, I'll be
showing you how to do it in the Remotes tab.
alias hi {
msg $chan Hi there $$1 !!
}
If you put that in remotes and type "/hi Bob" in a channel window, the output will
be you saying "Hi there Bob !!" in the channel. $chan refers to the active channel
and $$1 refers to the word you typed after "/hi" ("Bob"). Similarly, you can use
$2 to refer to the second word and so on. To refer to ALL the words you can use $1-
(note the added "-" at the end).
alias hi2 {
msg $chan Hi there $$1 !
msg $chan How are you?
}
Another example which uses all the same commands but executes two commands instead
of one. This demonstrates how you can use an alias to do a few things things in one
go rather than typing each command out. To try it out, put the code in remotes and
type "/hi2 Bob" in a channel window.
Remotes ALT+A
The remote allows you to create scripts that react to IRC Server events, such as when a user joins a channel or sends you a message. This tool is the most complex part of mIRC and to use it you must already know how to use IRC Commands, how to create Aliases, and how to use Variables and Identifiers.
The remote consists of three distinct sections:
The Users section, where user addresses with assigned access levels are listed. Each User in your Users section can be assigned one or more levels. These access levels dictate which events a user will be able to access.
The Variables section, where the currently active variables are listed.
The Scripts section, where the scripts that you create are listed. You can load multiple scripts which work independently of each other. This means that a single IRC Server event can trigger events in one or more scripts. Scripts consist of events which can only be triggered by users who have the required access levels. You can also place Aliases in your scripts by using the alias prefix, and menus in your scripts by using the menu prefix.
EXAMPLES (POPUP) ALT+P
You have the choice of placing these in:
STATUS
CHAT
CHANNEL
NICKLIST
MENUBAR
COMMENTS
.HI: /say Hi
.TYT: /say tyt...
.TC: /say Take care.
By adding this script to the POPUP section in the mIRC Script Editor you would be able to use your mouse and simply click on those choices to "type" the selections.
EXAMPLES: (ALIAS) ALT+A
/1 /me is Back
/2 /say :' )
/3 /say ;p
/4 /say :-0
/5 /say :(
/A /me has been asked ASL 993,409,567 times | /say old - yes - earth
/B /say BRB » $$?="enter message" «
/F /say I am fine thanks...
/G /say cya folks... gotta go... take care.
/N /say [Reg Nick] type: /nickserv register password email@address
/Z /me zzzZZZZzzz
For instance, with the above example loaded into Alias [ALT A] when you type:
/1
the mIRC client will automatically post:
* YourNick is Back
in the channel you are in.
EXAMPLES (REMOTE) ALT+R
With the script below added to the remote section of an mIRC client:
on *:JOIN:#ChannelName: {
/notice $nick welcome! enjoy your visit...
/notice $nick To learn more about #©hat please visit: http://channels.dal.net/3w/
}
on *:PART:#ChannelName: {
/notice $nick thanks for stopping by $chan
}
Users will see announcements and depart messages when they join or leave the channel that you are in.
(Use with care. Some channels do not allow auto messages)
1 - Black
2 - Navy Blue
3 - Green
4 - Red
5 - Brown
6 - Purple
7 - Olive
8 - Yellow
9 - Lime Green
10 - Teal
11 - Aqua Light
12 - Royal Blue
13 - Hot Pink
14 - Dark Gray
15 - Light Gray
16 - White
|
COLORS & Text Effects
Control + K is used for colored text
Control + B is used for Bold test
Control + U is used for underlined text
Control + R is used for reverse text *
Control + I is used for italics text **
Control + O returns your text back to plain black
EXAMPLE: CtrlK14 YourText CtrlK
KEYBOARD SHORTCUTS
F1 - Help
F10 - Activate menuline
CTRL+C - Copy marked text or graphics
CTRL+X - Cut marked text or graphics
CTRL+V - Paste marked text or graphics
CTRL+Z - Undo last operation
ALT+TAB - Change between open programs
ALT+UL - Opens menus by clicking Alt+Undescored letter
ALT+F4 - Close active window
CTRL+A - Mark all
CTRL+F4 - Close window
CTRL+ESC - Open start menu
CTRL+HOME - Fastest way to the beginning of a document
CTRL+END - Fastest way to the end of a document
WIN - Open Start menu
WIN+F1 - Windows help
WIN+E - Explorer
WIN+F - Starts Search for catalogs/files
WIN+M - Minimizes all windows
WIN+R - Opens Run dialogbox
WIN+TAB - Browses the toolbar.
WIN+BREAK - Open dialog box System Preferences.
SKIFT+WIN+M - Undo minimize all windows
CTRL/WIN+F - Dialogbox search for computer
Example Script
This mIRC Help File example script shows you how you can
place related aliases, popups, and events in a single file
making it easier to distribute a whole script to other people.
;XYZ Script v1.0 - contains XYZ related functions
;This menu definition adds a submenu to your channel popup menu
menu channel {
XYZ
.happily:/describe # XYZs are happy :)
.woefully:/describe # XYZs are woeful :(
.philosophically:/describe # XYZs are deep thinkers
.colorfully:/describe # XYZs are colorful
}
;These add aliases for shortcuts to often used messages
alias how /msg $1 Heard about XYZ?
alias XYZ /sound XYZ.wav
;This adds a ctcp command which reacts to a XYZ ctcp from someone
ctcp 1:XYZ:*:/notice $nick Sorry, I'm all out of XYZs right now.
;These add events which react to specific words said on a channel
on 1:text:*XYZ*:#:/msg $chan okay, who knows XYZ?
on 1:text:*grass*:#:/describe $chan XYZ is a widget or an example
;These add join and part events which react to a user joining/parting the channel #XYZ
on 1:join:#XYZ:{
/msg $nick Welcome $nick to channel #XYZ!
/msg $nick This is a XYZ channel, there are XYZers present!
/msg $nick Please refrain from profaine XYZing and/or lameness.
/msg $nick Idiots enaging in such acts will be promptly XYZ'd
}
on 1:part:#XYZ:/msg $nick Thanks for chatting with us on #XYZ!
;The following line is processed while you're doing a channels list. It
;prints to the status window any channel name/topic that has the word XYZ in it
raw 322:*XYZ*:/echo -s $2-
Read The Mirc Help Files!Keyboard Shortcut = F1
#script Tutorial
|
|