mIRC Home    About    Download    Register    News    Help

Print Thread
#186707 25/09/07 07:46 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I need help with this code, clean it up a bit, and improve it. I dont know if i have the best sulution for some functions like:

if (!$dialog(playlist)) { dialog -md playlist playlist | dialog -i playlist playlist | .timercdp 1 2 dialog -x playlist playlist }
if ($nopath(%mp3file) == $did(playlist,1,$did(playlist,1).lines)) { .splay stop | echo Mp3 player stoped, last mp3 in list played. | return }

%rep.h = it stop the mp3 player when last file in list is played, if set to 1.
%randmp3 = it play a random mp3, if set to 1.

Code:
on *:mp3end: {
  if (%rep.h == 1) {
    if (!$dialog(playlist)) { dialog -md playlist playlist | dialog -i playlist playlist | .timercdp 1 2 dialog -x playlist playlist  }
    if ($nopath(%mp3file) == $did(playlist,1,$did(playlist,1).lines)) { .splay stop | echo Mp3 player stoped, last mp3 in list played. | return }
  }
  if (%randmp3 == 1) { set %mp3file $read($mircdirsystem\txt\mp3list.txt) | set %r.line $readn | goto play }
  inc %r.line
  mp3.timepl.stop
  if ($read(" $+ $mircdirsystem\txt\mp3list.txt $+ ",%r.line) == $null) { set %r.line 1 }
  .splay $read(" $+ $mircdirsystem\txt\mp3list.txt $+ ",%r.line)
  set %mp3file $read(" $+ $mircdirsystem\txt\mp3list.txt $+ ",%r.line)
  if ($dialog(playlist)) { did -c playlist 1 %r.line }
  did -r mp3player 3
  .timerfix -iom 1 1000 did -ra mp3player 3 $nopath(%mp3file)
  mp3.timepl
  mp3tmp
  return
  :play
  if ($dialog(playlist)) { did -c playlist 1 %r.line }
  .splay $read(" $+ $mircdirsystem\txt\mp3list.txt $+ ",%r.line)
  did -r mp3player 3
  .timerfix -iom 1 1000 did -ra mp3player 3 $nopath(%mp3file)
  mp3.timepl
  mp3tmp
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #186709 25/09/07 09:51 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on *:mp3end: {
  var %m = mp3player, %p = playlist, %f = system\txt\mp3list.txt
  if (%rep.h == 1) {
    if (!$dialog(%p)) { 
      dialog -md %p %p 
      dialog -i %p %p 
      .timercdp 1 2 dialog -x %p  
    }
    if ($nopath(%mp3file) == $did(%p,1,$did(%p,1).lines)) { 
      splay stop 
      echo Mp3 player stoped, last mp3 in list played. 
      return 
    }
  }
  if (%randmp3) { 
    set %mp3file $read(%f,n) 
    set %r.line $readn 
    if ($dialog(%p)) { did -c %p 1 %r.line }
    splay %mp3file
    did -r %m 3
    .timerfix -iom 1 1000 did -ra %m 3 $nopath(%mp3file)
    mp3.timepl
    mp3tmp
    return
  }
  inc %r.line
  mp3.timepl.stop
  if ($read(%f,n,%r.line) == $null) { set %r.line 1 }
  set %mp3file $read(%f,n,%r.line)
  splay %mp3file
  if ($dialog(%p)) { did -c %p 1 %r.line }
  did -r %m 3
  .timerfix -iom 1 1000 did -ra %m 3 $nopath(%mp3file)
  mp3.timepl
  mp3tmp
}


Link Copied to Clipboard