Scripting Menus » History » Version 7
Per Amundsen, 03/29/2014 09:00 PM
| 1 | 1 | Per Amundsen | *Scripting Menus* |
|---|---|---|---|
| 2 | |||
| 3 | 5 | Per Amundsen | You can edit most AdiIRC menus in the Menu Editor located at Tools -> Edit Menus. |
| 4 | 1 | Per Amundsen | |
| 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 | 6 | Per Amundsen | *Separator* |
| 67 | |||
| 68 | 7 | Per Amundsen | Hyphen (-) can be used to add a menu separator. |
| 69 | 6 | Per Amundsen | |
| 70 | *Example* |
||
| 71 | |||
| 72 | <pre> |
||
| 73 | menu nicklist { |
||
| 74 | ;Create a upper menu item called "Tools" |
||
| 75 | Tools |
||
| 76 | |||
| 77 | ;Add a separator |
||
| 78 | - |
||
| 79 | |||
| 80 | ;Create another upper menu item called "More Tools" |
||
| 81 | More Tools |
||
| 82 | } |
||
| 83 | </pre> |
||
| 84 | |||
| 85 | |||
| 86 | 2 | Per Amundsen | *$1- lines inside menus* |
| 87 | |||
| 88 | $1- will be filled with different words depending on the menu type. |
||
| 89 | |||
| 90 | Status - The currently connected [[$network]] name. |
||
| 91 | Channel - The current [[$chan]] name. |
||
| 92 | Query - The [[$nick]] associated with the query window. |
||
| 93 | Nicklist - A list of selected nicks in the nicklist. |
||
| 94 | 4 | Per Amundsen | Menubar - Your nick ([[$me]]) on currently connected server. |