View difference between Paste ID: rDjMtTkt and 3C6eHz1q
SHOW: | | - or go back to the newest paste.
1
append = [$arg1 = (concat (getalias $arg1) $arg2)]
2-
rndo = [result (at $arg1 (rnd (listlen $arg1)))]
2+
rndo = [at $arg1 (rnd (listlen $arg1))]
3
4-
// Simple music player for Sauerbraten
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-
	playlist = [] ; _ext = [.wma .wav .ogg .mid]
7+
8
	_playlist = [] ; _ext = [.wma .wav .ogg .mid]
9
	loopfiles f "packages/fanatic" "" [
10-
			append playlist (format ["%1"] $f)
10+
11
			append _playlist (format ["%1"] $f)
12
		]
13-
	song = (rndo $playlist)
13+
14-
	music (format "fanatic/%1" $song) playasong
14+
	_song = (rndo $_playlist)
15-
	echo "^f7Now playing:^f2" $song
15+
	music (format "fanatic/%1" $_song) playasong
16-
]
16+
	echo "^f7Now playing:^f2" $_song
17
]
18