On LOAD » History » Version 6
Per Amundsen, 11/14/2015 06:32 AM
1 | 1 | Per Amundsen | _Added in 1.8.10_ |
---|---|---|---|
2 | |||
3 | *on <level>:LOAD:<commands>* |
||
4 | |||
5 | Triggers the first time a script file is loaded. |
||
6 | |||
7 | 6 | Per Amundsen | See also [[/load]], [[/reload]], [[/unload]], [[on START]], [[on UNLOAD]]. |
8 | 3 | Per Amundsen | |
9 | 1 | Per Amundsen | *Parameters* |
10 | |||
11 | <level> - The level for the event to trigger. |
||
12 | <commands> - The commands to be performed when the event listener's criteria is met. |
||
13 | |||
14 | *Example* |
||
15 | |||
16 | <pre> |
||
17 | ; Create a init alias. |
||
18 | alias -l initscript { |
||
19 | 2 | Per Amundsen | ; Set the %loaded variable to 'on' |
20 | 1 | Per Amundsen | set %loaded on |
21 | } |
||
22 | |||
23 | ; Listen for the LOAD event, and when matched, run this initscript alias. |
||
24 | 2 | Per Amundsen | on *:LOAD:initscript | echo -ag Script is $iif(%loaded,loaded,not loaded) |
25 | 1 | Per Amundsen | </pre> |