Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- append = [$arg1 = (concat (getalias $arg1) $arg2)]
- rndo = [at $arg1 (rnd (listlen $arg1))]
- // Simple music player for Sauerbraten. Can't get simpler than this.
- // If you want to play songs from another folder, change the "fanatic" part.
- playasong = [
- _playlist = [] ; _ext = [.wma .wav .ogg .mid]
- loopfiles f "packages/fanatic" "" [
- if (> (indexof $_ext (substr $f (- (strlen $f) 4))) -1) [
- append _playlist (format ["%1"] $f)
- ]
- ]
- _song = (rndo $_playlist)
- music (format "fanatic/%1" $_song) playasong
- echo "^f7Now playing:^f2" $_song
- ]
Advertisement
Add Comment
Please, Sign In to add comment