Popup Menus

From Scriptwiki
Revision as of 08:33, 16 April 2007 by Cail (talk | contribs) (some more changes)

Jump to: navigation, search

mIRC allows you to create custom popup menus for the status window, query/chat windows, channel windows, the channel nickname listbox, and main menubar.

menuitem:commands

Popups

If you wanted to add menuitem with name 'join #help.script', which joins the channel #help.script:

join #help.script:/join #help.script

If you want submenus for some item, you'll need to put dot in front of the itemname (submenus are always under the parent menuitem):

Most used commands
.auth:/.msg Q@CServe.quakenet.org AUTH username password
.www.quakenet.org:/run http://www.quakenet.org

This would make a popup like this:

Menupopup1.png


You can also create submenus for submenus with ..menutitem:commands, and ...menuitem:command and so on:

Most used commands
.auth:/.msg Q@CServe.quakenet.org AUTH username password
.websites
..Quakenet sites
...www.quakenet.org:/run http://www.quakenet.org
...script.quakenet.org:/run http://script.quakenet.org/
..Some other sites
...google:/run http://www.google.com

That would make a popup like this:

Menupopup2.png


"-" works as a seperator

Menuitem1:/echo -a hello
-
Menuitem2:/echo -a hi there

note: You need to put dots infront of the seperator, if you want it into submenus: ..-


To use the popup menu for a channel nickname listbox, you need to select a nickname before the menu will pop up. Here is a simple nickname listbox popup menu:

Who Is?:/whois $1

You can use { } brackets to perform several commands:

test {
 var %variable = testing
 echo -a %variable
}

Note: To add a visible menuitem that doesn't do anything, you could do: Menuitem:/

Identifiers and Variables

Variables or identifiers that are a part of a the title of a menu definition are evaluated each time the popup appears. This allows you to create popup menus that vary in appearance. If an entire menu item evaluates to $null, it is not displayed.

;%menuitem is set to Auth
;%menucommand is set to /.msg Q@CServe.quakenet.org AUTH username password

%menuitem:%menucommand

You can't use if in popup menus, you'll need to use $iif, the next example will show menuitem "cookie", if active channel is not #help.script:

$iif($active != #help.script,cookie,):/describe $active offers a cookie to everyone!


MENU prefix

You can use menu prefix in your remote to create popup menus for channels,nicklists,chats,status window or custom windows

menu channel {
 part:/part
 join:/join $?
}

With custom windows you can use various mouse events to trigger an action:

menu @test {
 mouse:/echo mouse moved at $mouse.x $mouse.y in $active $1
 sclick:/echo single click at $mouse.x $mouse.y
 dclick:/echo double click at $mouse.x $mouse.y
 uclick:/echo mouse released at $mouse.x $mouse.y
 rclick:/echo single right-click at $mouse.x $mouse.y in $active $1
 lbclick:/echo mouse selected $active $1
 leave:/echo mouse left $leftwin $leftwinwid
 drop:/echo drag and drop at $mouse.x $mouse.y
}

The mouse event is triggered when you move a mouse inside a picture window. You can use the $mouse identifier (see below) for the x and y position of the mouse. The sclick event is triggered when you click once inside a picture window. It will also trigger if you double-click. The dclick event is triggered when you double-click inside a picture window. The uclick event is triggered when a mouse button is released inside a picture window. The lbclick event is triggered when an item is selected in a listbox, either with the mouse or the cursor keys. The leave event is triggered when the mouse is moved outside the borders of a custom window. The drop event is triggered if you clicked in the window, held the button down, moved the mouse, and then let go of the button.

You can also specify multiple window names for menus

menu @window1,@test,@somewin {
 My nick is:/echo -a $me
}