RaZgRiZ

Simple Music Player 1.12

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