Project

General

Profile

Scripting Menus » History » Version 2

Per Amundsen, 03/29/2014 08:53 PM

1 1 Per Amundsen
*Scripting Menus*
2
3
You can edit most AdiIRC menus by in the Menu Editor located at Tools -> Edit Menus.
4
5
Status - Edit the status menus.
6
Channel - Edit the channel menus.
7
Query - Edit the query menus.
8
Nicklist - Edit the nicklist menus.
9
Menubar - Edit the menubar menus.
10
11
A menu syntax consists of Menu text<colon>Menu command.
12
13
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.
14
15
*Example*
16
17
<pre>
18
; 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.
19
Query:/query $1
20
</pre>
21
22
The "menu" prefix can also be used in a script to add more items to a menu.
23
24
*Example*
25
26
<pre>
27
;Add a new menu item with the text "Whois", when clicked execute "/whois $1".
28
menu nicklist {
29
  Whois:/whois $1
30
}
31
</pre>
32
33
*Menu hierarchy*
34
35
The menu hierarchy is determined by punctuation marks.
36
37
This works in both the Menu Editor and in a custom script.
38
39
*Example*
40
41
<pre>
42
menu nicklist {
43
  ;Create a upper menu item called "Tools", notice you don't need a colon for the upper menu.
44
  Tools
45
46
  ;Use a punctuation mark to put a menu item inside "Tools"
47
  .Whois:/whois $1
48
49
  ;Use a punctuation mark to put another menu item inside "Tools"
50
  .Who:/who $1
51
52
  ;Create another upper menu item called "Operate"
53
  Operate
54
55
  ;Use a punctuation mark to put a menu item inside "Operate"
56
  .Kill:kill $1
57
58
  ;Create a sub menu item called "Operate More" inside "Operate"
59
  .Operate More
60
61
  ;Use two punctuation mark to put a menu item inside "Operate More"
62
  ..Kill again:kill $1
63
}
64
</pre>
65 2 Per Amundsen
66
*$1- lines inside menus*
67
68
$1- will be filled with different words depending on the menu type.
69
70
Status - The currently connected [[$network]] name.
71
Channel - The current [[$chan]] name.
72
Query - The [[$nick]] associated with the query window.
73
Nicklist - A list of selected nicks in the nicklist.
74
Menubar - Your nick on currently connected server.