{{>toc}} h1. Scripting Menus You can edit most AdiIRC menus in the Menu Editor located at [[Menubar_Control|Menubar]] -> Tools -> [[Menus_Dialog|Edit Menus]]. Status - Edit the status menus. Channel - Edit the channel menus. Query - Edit the query menus. Nicklist - Edit the nicklist menus. [[Menubar_Control|Menubar]] - Edit the menubar menus. ChannelLink - Edit the channel link menus. *(AdiIRC only)* Link - Edit the regular link menus. *(AdiIRC only)* A menu syntax consists of
; 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
; Add a new menu item with the text "Query", when clicked, execute both "/query $1" and "/whois $1". Query:{ /query $1 /whois $1 }
; Add a new menu item with the text "Whois", when clicked execute "/whois $1". menu nicklist { Whois:/whois $1 }
; 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 }
; 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 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 }
menu nicklist { ; Create a upper menu item called "Tools". Tools ; Add a separator. - ; Create another upper menu item called "More Tools". More Tools ; Create a submenu. .Submenu ; Add a separator inside the submenu. ; Separators need the same amount of punctuations "." as the submenu itself. .- ; Create another submenu. .Submenu2 }
; Both "Apple" and "Banana" will be shown in the "Fruit" menu. menu * { Fruit .Banana } menu * { Fruit .Apple }
; Create a custom window. /window @test ; Add a mouse menu. menu @test { sclick:echo -ag Left mouse button was clicked. rclick:echo -ag Right mouse button was clicked. Menu:echo -ag Just a regular menu item. }
menu * { Checked $style(1):noop }
menu * { Disabled $style(2):noop }
menu * { Checked and disabled $style(3):noop }
menu * { Icon $menuicon($scriptdir\icon.ico):noop }
menu * { Animal .$submenu($animal($1)) } alias animal { if ($1 == begin) return - if ($1 == 1) return Dog:echo Dog if ($1 == 2) return Cat:echo Cat if ($1 == 3) return Bird:echo Bird if ($1 == end) return - }