PDA

View Full Version : GameGuru's Guide to mIRC scripting part 2


GameGuru
06-06-2001, 19:04
Before I start the 2nd Tutorial, I will show how to perform a ban & kick in an alias


/bk {
/mode # +b $$1
/kick # $$1
}


This is probably the simplest form of the alias possible, there are many improvements that can be made, we could of checked for operator status first, asked for a reason for the ban, banned the user address rather than nickname, and so on.

Part 2 - The Basics - Popups

Popups are to Aliases what GUI's are to CLI's. Popups work similarly to aliases except that popups involve the use of the mouse rather than typing. Loading up your popup file (using Alt + P or by selecting it from the tools menu) you will find some popups already created for you.

Popups are seperated into 5 sections detailed below.


Status: This is the first window that can be viewed in mIRC, it contains all server information is also a place where information and messages are when they come from an unknown origin.
Channel: The channel window is the window where the channel chat is displayed, by default this only contains one popup command "Channel Modes" which is used to see the information on the channel
Query/Chat: These popups are displayed when in a DCC Chat or Query Session (Private Chat) and usually contain commands for working with the user you are conversing with
Nickname List: These popups are used in the side listbox of each channel, where people's nicknames are located, these tend to be where most of the popup menu is located.
Menubar: This is the only popup not summoned with the right mouse button. It is located in the toolbar. The default name "Commands" can be changed by changing the text in the first line of this section.


The default structure for popups are shown below:


Menu
.Submenu
..Sub-Submenu
...Label:commands
- Seperator


The menu will be the first list you see when right clicking in the popups, then each submenu will appear when the mouse is placed on the parent menu. The label for the popup is displayed on the popup, and when clicking on it, its associated commands are performed. To ease categorising of commands a seperator can be used for breaking down sections of the popup. To show this more simply I will take an example from standard mIRC's popup file.


-
Control
.Ignore:/ignore $$1 1


This code is located in the Nickname list popup section. Before it there is a seperator, to seperate it from the UCentral, Whois and Query commands, then a menu called "Control" is made, which expands to reveal a list of commands used for control of users, the first being "Ignore". If you were to click on this it would perform the command "/ignore $$1 1" where $$1 is the selected user in the nickname list. This is the basis on how popups work. Note that you cannot attach commands to parent menus which create a submenu, i.e.


-
Actions:/me performs an action
.Spade slap:/me slaps someone with a spade


The "Actions" Popup will not perform a command as intended, it will merely display "Actions:/me performs an action" instead.

It is also possible to create shortcuts to menus by underlining a certain letter as the shortcut key to it, take this example:


&User Options
.&Positive Actions
..&Op:/mode # +o $$1
.&Negative Actions
..&Deop:/mode # -o $$1


If you were to place this code in your Nickname list section of your popups file, you would find that you could op a user by right clicking then pressing "UPO" this is much the same as toolbar shortcuts (the most common being Alt+f then s for Save :))

This concludes the Popup tutorial, try experimenting with creating popup actions and messages and keeping them sorted in sections.

[Edit - Made a tiny typo :)]

[Edited by GameGuru on 06-06-2001 at 07:56 PM]

MCHammer
06-06-2001, 19:16
Superb!

/me claps :)

-=SE|Blizzard=-
06-06-2001, 19:59
GamGuru could u plz checka post made on part 1?

btw... nice job... very newbie though

GameGuru
07-06-2001, 11:55
its supposed to be :P

wuaffiliate
11-06-2001, 04:52
nice 1, now on to remote :)

*THC*Muppet
24-06-2001, 15:37
Great idea GameGuru but I am having difficulty with pop ups.
Could you explain how to make/edit the default slap pop up,
so it looks like

Menu=Fun Stuff
.Submenu=Slaps
..Label:commands=slaps
hits
thumps
- Seperator

Cos i dont get :( i can add a thump menu but only by editing the popup ini file in the mirc please please please I need help

Thanx in advane :)

GameGuru
24-06-2001, 19:25
To make a slap menu in your popups file, make sure you have the nickname list section being viewed (read the tutorial to find out how) and then add this:

Fun Stuff
.Slaps
..Hits: me hits $$1 really hard
..Thumps: me thumps $$1 in the arm


And so on, there's no need for the / before me since mIRC already knows it's a command.

HTH

*THC*Muppet
24-06-2001, 19:36
Cheers m8y ill remove the / now

im sure ill come up with another newbie question for ya

*THC*Muppet
25-06-2001, 03:14
Ok GameGuru i really cant figure this one out, how can i create a pop up that will set a background to the channel im on. Lets say the backgrounds are matrix.jpg and FAcup.bmp

Backgrounds
.Film
..Matrix:?matrix.jpg?
.Sport
..FA Cup:?FAcup.bmp?
-

I havent a clue is it possible to do ?

GameGuru
25-06-2001, 09:37
Firstly only BMP's may be used as backgrounds in mIRC so make sure any pictures you want making into a background are BMP's and are also 16 or 256 colours (although it may be possible, I'm only reading from the mIRC help file)


Backgrounds
.Film
..Matrix: background -ar <filename>
.Clear: background -ax


HTH

*THC*Muppet
25-06-2001, 18:24
It does m8 cheers :)

Now how do ya create a shortcut, say for example

Plug-Ins
.Winamp:run "C:\Program Files\Winamp\winamp.exe"

how would i create a shortcut for this "F1" shall we say instead of going through the pop ups :)

*THC*Muppet
25-06-2001, 19:12
Just a quickie how do ya tell mirc to fill the background
so when i choose a bmp file it will fill the bacground of the channel im in and also to make that bmp default for that channel

T.I.A. :)

GameGuru
26-06-2001, 21:07
To use F keys, load up your alias file, and add

/F1 {
run c:\winamp\winamp.exe (or wotever)
}


use the -r flag to stretch the image to fill the channel (as in my example) use the -t to tile the image.

to make it default add a -e flag :)

HTH