Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:connect:{
- .timer.music.check 0 5 music
- }
- on *:load:{ .timer.music.check 0 5 music }
- on *:unload:{ .timer.music.check off }
- alias -l _foobar {
- if (!$regex($1,/(play|pause|playpause|prev(ious)?|next|rand|stop|config)/Si)) {
- echo Error | return $false
- }
- :check
- if (!%cfg_foodir) {
- var %tmp $findfile(C:\,*foobar2000.exe,1)
- if (%tmp != $null) set %cfg_foodir $remove(%tmp,foobar2000.exe)
- else set %cfg_foodir $getFullPath($sdir($mircdir,Locate your foobar2000 installation folder))
- }
- var %exe $+(%cfg_foodir,foobar2000.exe), %switch $+(/,$1)
- if ($exists(%exe)) run %exe %switch
- else goto check
- }
- alias fplay {
- _foobar playpause
- }
- alias fpause {
- play
- }
- alias fstop {
- _foobar stop
- }
- alias fprev {
- _foobar prev
- }
- alias fnext {
- _foobar next
- }
- alias frand {
- _foobar rand
- }
- alias fconfig {
- _foobar config
- }
- alias -l fe {
- return $exists($+(%cfg_foodir,foobar2000.exe))
- }
- alias -l fcheck {
- if (!%cfg_foodir) {
- var %tmp $findfile(C:\,*foobar2000.exe,1)
- if (%tmp != $null) {
- set %cfg_foodir $remove(%tmp,foobar2000.exe)
- noop $input(The location of foobar2000.exe has been automatically determined.,o,Foobar control script,)
- return $true
- }
- else {
- set %cfg_foodir $getFullPath($sdir($mircdir,Locate your foobar2000 installation folder))
- }
- }
- }
- alias music {
- set %oldmusic %music
- set %music $read(music.txt)
- if ($read(music.txt) = stopped) { return }
- if ($read(music.txt) = $null) { return }
- if (%oldmusic == %music) { return }
- else { scon -a ame [Song] %music }
- }
- menu status,channel {
- $iif($fe,Foobar,$null)
- .Play/Pause:/fplay
- .Stop:/fstop
- .-
- .Previous:/fprev
- .Next:/fnext
- .-
- .Rand:/frand
- .-
- .Preferences:/fconfig
- .$iif($isalias(np),-,$null)
- .$iif($isalias(np),Now playing,$null):/np
- $iif(!$fe,Locate foobar2000.exe,$null):/fcheck
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement