SHOW:
|
|
- or go back to the newest paste.
| 1 | - | // simple music player |
| 1 | + | append = [$arg1 = (concat (getalias $arg1) $arg2)] |
| 2 | rndo = [result (at $arg1 (rnd (listlen $arg1)))] | |
| 3 | ||
| 4 | // Simple music player for Sauerbraten | |
| 5 | ||
| 6 | - | looplist i $audiolibrary [ |
| 6 | + | |
| 7 | - | if (=s (substr $f (- (strlen $f) 4)) $i) [append playlist (format ["%1"] $f)] |
| 7 | + | |
| 8 | loopfiles f "packages/fanatic" "" [ | |
| 9 | if (> (indexof $audiolibrary (substr $f (- (strlen $f) 4))) -1) [ | |
| 10 | append playlist (format ["%1"] $f) | |
| 11 | ] | |
| 12 | ] | |
| 13 | - | ] |
| 13 | + | |
| 14 | music (format "fanatic/%1" $song) playasong | |
| 15 | echo (concat "^f7Now playing:^f2" $song) | |
| 16 | ] | |
| 17 | ||
| 18 |