Scripting Menus » History » Revision 21
« Previous |
Revision 21/52
(diff)
| Next »
Per Amundsen, 05/18/2016 01:10 PM
- Table of contents
- Scripting Menus
Scripting Menus¶
You can edit most AdiIRC menus in the Menu Editor located at Tools -> Edit Menus.
Status - Edit the status menus.
Channel - Edit the channel menus.
Query - Edit the query menus.
Nicklist - Edit the nicklist menus.
Menubar - Edit the menubar menus.
A menu syntax consists of <Menu text><colon><Menu command>.
For this reason, only one colon is allowed in a menu, neither the text nor the command can contain any other colons for the menu to work properly.
Example
; Add a new menu item with the text "Query", when clicked, execute "/query $1" where $1 means the first word given to this menu, usually a nick. Query:/query $1
Menu prefix¶
The "menu" prefix can also be used in a custom script to add more items to a menu.
Example
;Add a new menu item with the text "Whois", when clicked execute "/whois $1".
menu nicklist {
Whois:/whois $1
}
Target multiple menus¶
Multiple menus can be targeted with the same menu item by separating them with comma.
Example
;Add a new menu item for nicklist and channels with the text "Hello World", when clicked execute "/echo -ag Hello World".
menu nicklist,channel {
Hello World/echo -ag Hello World
}
Wildcards can also be used.
Example
; Add a new menu item for all menus with the text "Hello World", when clicked execute "/echo -ag Hello World".
menu * {
Hello World/echo -ag Hello World
}
; Add a new menu item for all custom window menus with the text "Hello World", when clicked execute "/echo -ag Hello World".
menu @* {
Hello World/echo -ag Hello World
}
Menu hierarchy¶
The menu hierarchy is determined by punctuation marks.
This works in both the Menu Editor and in a custom script using the Menu prefix.
Example
menu nicklist {
;Create a upper menu item called "Tools", notice you don't need a colon for the upper menu.
Tools
;Use a punctuation mark to put a sub menu item inside "Tools"
.Whois:/whois $1
;Use a punctuation mark to put another sub menu item inside "Tools"
.Who:/who $1
;Create another upper menu item called "Operate"
Operate
;Use a punctuation mark to put a sub menu item inside "Operate"
.Kill:kill $1
;Create a sub menu item called "Operate More" inside "Operate"
.Operate More
;Use two punctuation marks to put a sub menu item inside "Operate More"
..Kill again:kill $1
}
Separator¶
Hyphen (-) can be used to add a menu separator.
Example
menu nicklist {
;Create a upper menu item called "Tools"
Tools
;Add a separator
-
;Create another upper menu item called "More Tools"
More Tools
}
$1- lines inside menus¶
$1- will be filled with different words depending on the menu type.
Status - The currently connected $network name.
Channel - The current $chan name.
Query - The $nick associated with the query window.
Nicklist - A list of selected nicks in the nicklist.
Menubar - Your nick ($me) on currently connected server.
Adding top menus¶
As of AdiIRC 1.9.7 new top menus can be inserted in the Menubar after the "Help" item using the /menubar command.
Regular scripted menus can be used by referencing the @popup name, e.g "menu @mymenu { }"
Updated by Per Amundsen over 9 years ago · 52 revisions