Refreshsong » History » Version 2
Per Amundsen, 04/30/2018 05:41 PM
1 | 1 | Per Amundsen | _Added in 3.1_ |
---|---|---|---|
2 | |||
3 | */refreshsong* |
||
4 | |||
5 | Forces AdiIRC to refresh the song title for the current media player. |
||
6 | |||
7 | *Example* |
||
8 | |||
9 | <pre> |
||
10 | ; Override the '/np' command. |
||
11 | alias np { |
||
12 | if ($1 == itunes) { |
||
13 | ; if the first parameter is 'itunes', change the media player to itunes. |
||
14 | ; 4 means the 4th item in Options -> Media Player, starting from index 0. |
||
15 | .setoption MediaPlayer MediaPlayer 4 |
||
16 | |||
17 | ; Tell AdiIRC to immediately refresh the song title. |
||
18 | refreshsong |
||
19 | |||
20 | ; Call the internal /np command which will now print the refreshed song. |
||
21 | !np $2- |
||
22 | } |
||
23 | else if ($1 == foobar) { |
||
24 | ; if the first parameter is 'foobar', change the media player to foobar2000. |
||
25 | .setoption MediaPlayer MediaPlayer 8 |
||
26 | |||
27 | ; Tell AdiIRC to immediately refresh the song title. |
||
28 | refreshsong |
||
29 | |||
30 | ; Call the internal /np command which will now print the refreshed song. |
||
31 | !np $2- |
||
32 | } |
||
33 | else { |
||
34 | 2 | Per Amundsen | ; No parameter given just call the built-in /np command to print the current song. |
35 | 1 | Per Amundsen | !np $1- |
36 | } |
||
37 | } |
||
38 | </pre> |