Lecteur mp3, wav et wma

5/5 (11 avis)

Snippet vu 5 410 fois - Téléchargée 28 fois

Contenu du snippet

Ben toujours comme d'habitude, Alt+R, c/c du code dans vos remotes......

Source / Exemple :


dialog mp3 {
  title "MuZiK"
  size 250 5 227 36
  option dbu
  list 1, 11 46 200 47, size
  edit "", 2, 4 22 175 10, disable
  box "", 4, 185 0 33 34
  button "Charger", 5, 136 5 24 14
  button "Play", 6, 68 5 21 14
  button "Pause", 7, 47 5 20 14
  button "Reprise", 8, 47 5 20 14
  button "Recul.", 9, 5 5 20 14
  button "Avan.", 10, 90 5 20 14
  button "Stop", 11, 26 5 20 14, ok
  button "Option", 12, 161 5 21 14
  button "Liste", 13, 115 5 20 14
  button "Small", 14, 115 5 20 14
  edit "", 15, 187 14 29 9, disable center
  button "VoL +", 16, 189 5 25 8
  button "VoL -", 17, 188 24 25 8
  button "Actualiser", 3, 12 37 198 8
}

alias ajouter {
  set %dir $$sdir="Sélectionne le répertoire..." c:
  did -r mp3 1 
  /unset %nbrmp3
  /unset %nbrwma
  /unset %nbrwav
  if ( %mp3_mp3 == on ) { var %open = $findfile( %dir ,*.mp3,0,did -a mp3 1 $nopath($1-)) | set %nbrmp3  $findfile( %dir ,*.mp3,0) }
  if ( %mp3_wma == on ) { var %open2 = $findfile( %dir ,*.wma,0,did -a mp3 1 $nopath($1-)) | set %nbrwma  $findfile( %dir ,*.wma,0)  }
  if ( %mp3_wav == on ) { var %open3 = $findfile( %dir ,*.wav,0,did -a mp3 1 $nopath($1-)) | set %nbrwav  $findfile( %dir ,*.wav,0)  }

  did -ra mp3 2 Il y a $calc( %nbrmp3 + %nbrwma + %nbrwav ) morceaux dans la liste 
}
on *:dialog:mp3:sclick:5: ajouter
on 1:dialog:mp3:dclick:1:{
  /splay stop  
  set %mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+
  splay " $+ %mp3 $+ "
  did -ra mp3 2 Titre joué: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
  if ( %mp3_typemess == 1 ) { ame 11,1J' écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+-) 8,1] }
  if ( %mp3_typemess == 2 ) { 
    set %mp3_nbr_chan $chan(0)  
    set %mp3_num_chan 1
    :top
    if ( $chan( %mp3_num_chan ) == $null ) { goto fin }    
    if (( $chan(%mp3_num_chan) == %mp3_nochan1 ) || ( $chan(%mp3_num_chan) == %mp3_nochan2 ) || ( $chan(%mp3_num_chan) == %mp3_nochan3 ) || ( $chan(%mp3_num_chan) == %mp3_nochan4 ) || ( $chan(%mp3_num_chan) == %mp3_nochan5 ) || ( $chan(%mp3_num_chan) == %mp3_nochan6 ) || ( $chan(%mp3_num_chan) == %mp3_nochan7 ) || ( $chan(%mp3_num_chan) == %mp3_nochan8 ) || ( $chan(%mp3_num_chan) == %mp3_nochan9 ) || ( $chan(%mp3_num_chan) == %mp3_nochan10 ) || ( $chan(%mp3_num_chan) == %mp3_nochan11 ) || ( $chan(%mp3_num_chan) == %mp3_nochan12 ) || ( $chan(%mp3_num_chan) == %mp3_nochan13 ) || ( $chan(%mp3_num_chan) == %mp3_nochan14 ) || ( $chan(%mp3_num_chan) == %mp3_nochan15 ) || ( $chan(%mp3_num_chan) == %mp3_nochan16 ) || ( $chan(%mp3_num_chan) == %mp3_nochan17 ) || ( $chan(%mp3_num_chan) == %mp3_nochan18 ) || ( $chan(%mp3_num_chan) == %mp3_nochan19 ) || ( $chan(%mp3_num_chan) == %mp3_nochan20 )) { inc %mp3_num_chan 1 | goto top }  
    if (( $chan(%mp3_num_chan) != %mp3_nochan1 ) || ( $chan(%mp3_num_chan) != %mp3_nochan2 ) || ( $chan(%mp3_num_chan) != %mp3_nochan3) || ( $chan(%mp3_num_chan) != %mp3_nochan4 ) || ( $chan(%mp3_num_chan) != %mp3_nochan5 ) || ( $chan(%mp3_num_chan) != %mp3_nochan6 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan9 ) || ( $chan(%mp3_num_chan) != %mp3_nochan10 ) || ( $chan(%mp3_num_chan) != %mp3_nochan11 ) || ( $chan(%mp3_num_chan) != %mp3_nochan12 ) || ( $chan(%mp3_num_chan) != %mp3_nochan13 ) || ( $chan(%mp3_num_chan) != %mp3_nochan14 ) || ( $chan(%mp3_num_chan) != %mp3_nochan15 )  || ( $chan(%mp3_num_chan) != %mp3_nochan16 ) || ( $chan(%mp3_num_chan) != %mp3_nochan17 ) || ( $chan(%mp3_num_chan) != %mp3_nochan18 ) || ( $chan(%mp3_num_chan) != %mp3_nochan19 ) || ( $chan(%mp3_num_chan) != %mp3_nochan20 )) {
      msg $chan(%mp3_num_chan) 11,1J' écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+ ) 8,1]
    inc %mp3_num_chan 1 | goto top  }
    :fin
  }
  if ( %mp3_typemess == 3 ) { }
}
on *:dialog:mp3:init:*:{ 
  if ( %mp3_mp3 == on ) { var %open = $findfile( %dir ,*.mp3,0,did -a mp3 1 $nopath($1-)) | set %nbrmp3  $findfile( %dir ,*.mp3,0) }
  if ( %mp3_wma == on ) { var %open2 = $findfile( %dir ,*.wma,0,did -a mp3 1 $nopath($1-)) | set %nbrwma  $findfile( %dir ,*.wma,0)  }
  if ( %mp3_wav == on ) { var %open3 = $findfile( %dir ,*.wav,0,did -a mp3 1 $nopath($1-)) | set %nbrwav  $findfile( %dir ,*.wav,0)  }
  if ( %mp3_mp3 != on ) { /unset %nbrmp3 }
  if ( %mp3_wav != on ) { /unset %nbrwav }
  if ( %mp3_wma != on ) { /unset %nbrwma }

  if ( %dir == $null ) { did -ra mp3 2 Il n'y a pas de mp3 dans la liste }
  else  did -ra mp3 2 Il y a $calc( %nbrmp3 + %nbrwma + %nbrwav ) morceaux dans la liste 

  did -v mp3 13
  did -h mp3 14 
  /did -ar mp3 15 %volume
  if ( %volume == 0 ) { /did -b mp3 17 }
  if ( %volume == 65000 ) { /did -b mp3 16 }

}

on 1:dialog:mp3:sclick:6:{
  /splay stop 
  set %mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+
  splay " $+ %mp3 $+ "
  did -ra mp3 2 Titre joué: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
  if ( %mp3_typemess == 1 ) { ame 11,1écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+-) 8,1] }
  if ( %mp3_typemess == 2 ) { 
    set %mp3_nbr_chan $chan(0)  
    set %mp3_num_chan 1
    :top
    if ( $chan( %mp3_num_chan ) == $null ) { goto fin }    
    if (( $chan(%mp3_num_chan) == %mp3_nochan1 ) || ( $chan(%mp3_num_chan) == %mp3_nochan2 ) || ( $chan(%mp3_num_chan) == %mp3_nochan3 ) || ( $chan(%mp3_num_chan) == %mp3_nochan4 ) || ( $chan(%mp3_num_chan) == %mp3_nochan5 ) || ( $chan(%mp3_num_chan) == %mp3_nochan6 ) || ( $chan(%mp3_num_chan) == %mp3_nochan7 ) || ( $chan(%mp3_num_chan) == %mp3_nochan8 ) || ( $chan(%mp3_num_chan) == %mp3_nochan9 ) || ( $chan(%mp3_num_chan) == %mp3_nochan10 ) || ( $chan(%mp3_num_chan) == %mp3_nochan11 ) || ( $chan(%mp3_num_chan) == %mp3_nochan12 ) || ( $chan(%mp3_num_chan) == %mp3_nochan13 ) || ( $chan(%mp3_num_chan) == %mp3_nochan14 ) || ( $chan(%mp3_num_chan) == %mp3_nochan15 ) || ( $chan(%mp3_num_chan) == %mp3_nochan16 ) || ( $chan(%mp3_num_chan) == %mp3_nochan17 ) || ( $chan(%mp3_num_chan) == %mp3_nochan18 ) || ( $chan(%mp3_num_chan) == %mp3_nochan19 ) || ( $chan(%mp3_num_chan) == %mp3_nochan20 )) { inc %mp3_num_chan 1 | goto top }  
    if (( $chan(%mp3_num_chan) != %mp3_nochan1 ) || ( $chan(%mp3_num_chan) != %mp3_nochan2 ) || ( $chan(%mp3_num_chan) != %mp3_nochan3) || ( $chan(%mp3_num_chan) != %mp3_nochan4 ) || ( $chan(%mp3_num_chan) != %mp3_nochan5 ) || ( $chan(%mp3_num_chan) != %mp3_nochan6 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan9 ) || ( $chan(%mp3_num_chan) != %mp3_nochan10 ) || ( $chan(%mp3_num_chan) != %mp3_nochan11 ) || ( $chan(%mp3_num_chan) != %mp3_nochan12 ) || ( $chan(%mp3_num_chan) != %mp3_nochan13 ) || ( $chan(%mp3_num_chan) != %mp3_nochan14 ) || ( $chan(%mp3_num_chan) != %mp3_nochan15 )  || ( $chan(%mp3_num_chan) != %mp3_nochan16 ) || ( $chan(%mp3_num_chan) != %mp3_nochan17 ) || ( $chan(%mp3_num_chan) != %mp3_nochan18 ) || ( $chan(%mp3_num_chan) != %mp3_nochan19 ) || ( $chan(%mp3_num_chan) != %mp3_nochan20 )) {
      msg $chan(%mp3_num_chan) 11,1J' écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+ ) 8,1]
    inc %mp3_num_chan 1 | goto top  }
    :fin
  }
  if ( %mp3_typemess == 3 ) { }
}
on 1:dialog:mp3:sclick:7:{
  splay pause
  did -ra mp3 2 Pause: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
  did -v mp3 8
  did -h mp3 7
}
on 1:dialog:mp3:sclick:8:{
  splay resume
  did -h mp3 8
  did -v mp3 7
  did -ra mp3 2 Titre joué: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
}
on 1:dialog:mp3:sclick:9:{ 
  /splay stop 
  if ( $dialog(MP3).title == $null ) { halt }
  did -c mp3 1 $calc($did(mp3,1).sel - 1)
  if ( $did(mp3,1).seltext == $null ) { goto erreur }  
  set %mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+
  if ( %mp3 == $null ) { goto erreur }
  /splay "  $+ %mp3 $+ "
  did -ra mp3 2 Titre joué: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
  if ( %mp3_typemess == 1 ) { ame 11,1J' écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+-) 8,1] }
  if ( %mp3_typemess == 2 ) { 
    set %mp3_nbr_chan $chan(0)  
    set %mp3_num_chan 1
    :top
    if ( $chan( %mp3_num_chan ) == $null ) { goto fin }    
    if (( $chan(%mp3_num_chan) == %mp3_nochan1 ) || ( $chan(%mp3_num_chan) == %mp3_nochan2 ) || ( $chan(%mp3_num_chan) == %mp3_nochan3 ) || ( $chan(%mp3_num_chan) == %mp3_nochan4 ) || ( $chan(%mp3_num_chan) == %mp3_nochan5 ) || ( $chan(%mp3_num_chan) == %mp3_nochan6 ) || ( $chan(%mp3_num_chan) == %mp3_nochan7 ) || ( $chan(%mp3_num_chan) == %mp3_nochan8 ) || ( $chan(%mp3_num_chan) == %mp3_nochan9 ) || ( $chan(%mp3_num_chan) == %mp3_nochan10 ) || ( $chan(%mp3_num_chan) == %mp3_nochan11 ) || ( $chan(%mp3_num_chan) == %mp3_nochan12 ) || ( $chan(%mp3_num_chan) == %mp3_nochan13 ) || ( $chan(%mp3_num_chan) == %mp3_nochan14 ) || ( $chan(%mp3_num_chan) == %mp3_nochan15 ) || ( $chan(%mp3_num_chan) == %mp3_nochan16 ) || ( $chan(%mp3_num_chan) == %mp3_nochan17 ) || ( $chan(%mp3_num_chan) == %mp3_nochan18 ) || ( $chan(%mp3_num_chan) == %mp3_nochan19 ) || ( $chan(%mp3_num_chan) == %mp3_nochan20 )) { inc %mp3_num_chan 1 | goto top }  
    if (( $chan(%mp3_num_chan) != %mp3_nochan1 ) || ( $chan(%mp3_num_chan) != %mp3_nochan2 ) || ( $chan(%mp3_num_chan) != %mp3_nochan3) || ( $chan(%mp3_num_chan) != %mp3_nochan4 ) || ( $chan(%mp3_num_chan) != %mp3_nochan5 ) || ( $chan(%mp3_num_chan) != %mp3_nochan6 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan9 ) || ( $chan(%mp3_num_chan) != %mp3_nochan10 ) || ( $chan(%mp3_num_chan) != %mp3_nochan11 ) || ( $chan(%mp3_num_chan) != %mp3_nochan12 ) || ( $chan(%mp3_num_chan) != %mp3_nochan13 ) || ( $chan(%mp3_num_chan) != %mp3_nochan14 ) || ( $chan(%mp3_num_chan) != %mp3_nochan15 )  || ( $chan(%mp3_num_chan) != %mp3_nochan16 ) || ( $chan(%mp3_num_chan) != %mp3_nochan17 ) || ( $chan(%mp3_num_chan) != %mp3_nochan18 ) || ( $chan(%mp3_num_chan) != %mp3_nochan19 ) || ( $chan(%mp3_num_chan) != %mp3_nochan20 )) {
      msg $chan(%mp3_num_chan) 11,1J' écoute 8,1-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+ ) 8,1]
    inc %mp3_num_chan 1 | goto top  }
    :fin
  }
  if ( %mp3_typemess == 3 ) { }

}
on 1:dialog:mp3:sclick:10:{
  /splay stop 
  if ( $dialog(MP3).title == $null ) { halt }
  did -c mp3 1 $calc($did(mp3,1).sel + 1)
  if ( $did(mp3,1).seltext == $null ) { goto erreur }  
  set %mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+
  if ( %mp3 == $null ) { goto erreur }
  /splay "  $+ %mp3 $+ "
  did -ra mp3 2 Titre joué: $remove($replace($nopath(%mp3),_,$chr(32)),.mp3)
  if ( %mp3_typemess == 1 ) { ame 11,1J' écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+-) 8,1]}
  if ( %mp3_typemess == 2 ) { 
    set %mp3_nbr_chan $chan(0)  
    set %mp3_num_chan 1
    :top
    if ( $chan( %mp3_num_chan ) == $null ) { goto fin }    
    if (( $chan(%mp3_num_chan) == %mp3_nochan1 ) || ( $chan(%mp3_num_chan) == %mp3_nochan2 ) || ( $chan(%mp3_num_chan) == %mp3_nochan3 ) || ( $chan(%mp3_num_chan) == %mp3_nochan4 ) || ( $chan(%mp3_num_chan) == %mp3_nochan5 ) || ( $chan(%mp3_num_chan) == %mp3_nochan6 ) || ( $chan(%mp3_num_chan) == %mp3_nochan7 ) || ( $chan(%mp3_num_chan) == %mp3_nochan8 ) || ( $chan(%mp3_num_chan) == %mp3_nochan9 ) || ( $chan(%mp3_num_chan) == %mp3_nochan10 ) || ( $chan(%mp3_num_chan) == %mp3_nochan11 ) || ( $chan(%mp3_num_chan) == %mp3_nochan12 ) || ( $chan(%mp3_num_chan) == %mp3_nochan13 ) || ( $chan(%mp3_num_chan) == %mp3_nochan14 ) || ( $chan(%mp3_num_chan) == %mp3_nochan15 ) || ( $chan(%mp3_num_chan) == %mp3_nochan16 ) || ( $chan(%mp3_num_chan) == %mp3_nochan17 ) || ( $chan(%mp3_num_chan) == %mp3_nochan18 ) || ( $chan(%mp3_num_chan) == %mp3_nochan19 ) || ( $chan(%mp3_num_chan) == %mp3_nochan20 )) { inc %mp3_num_chan 1 | goto top }  
    if (( $chan(%mp3_num_chan) != %mp3_nochan1 ) || ( $chan(%mp3_num_chan) != %mp3_nochan2 ) || ( $chan(%mp3_num_chan) != %mp3_nochan3) || ( $chan(%mp3_num_chan) != %mp3_nochan4 ) || ( $chan(%mp3_num_chan) != %mp3_nochan5 ) || ( $chan(%mp3_num_chan) != %mp3_nochan6 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan7 ) || ( $chan(%mp3_num_chan) != %mp3_nochan9 ) || ( $chan(%mp3_num_chan) != %mp3_nochan10 ) || ( $chan(%mp3_num_chan) != %mp3_nochan11 ) || ( $chan(%mp3_num_chan) != %mp3_nochan12 ) || ( $chan(%mp3_num_chan) != %mp3_nochan13 ) || ( $chan(%mp3_num_chan) != %mp3_nochan14 ) || ( $chan(%mp3_num_chan) != %mp3_nochan15 )  || ( $chan(%mp3_num_chan) != %mp3_nochan16 ) || ( $chan(%mp3_num_chan) != %mp3_nochan17 ) || ( $chan(%mp3_num_chan) != %mp3_nochan18 ) || ( $chan(%mp3_num_chan) != %mp3_nochan19 ) || ( $chan(%mp3_num_chan) != %mp3_nochan20 )) {
      msg $chan(%mp3_num_chan) 11,1écoute 8,1]-[ 4,1 $nopath(%mp3 %dir $+ $did(mp3,1,$did(mp3,1).sel) $+ ) 8,1]
    inc %mp3_num_chan 1 | goto top  }
    :fin
  }
  if ( %mp3_typemess == 3 ) { }
}
on *:dialog:mp3:sclick:3:{
  /did -r mp3 1 
  if ( %mp3_mp3 == on ) { var %open = $findfile( %dir ,*.mp3,0,did -a mp3 1  $nopath($1-)) | set %nbrmp3  $findfile( %dir ,*.mp3,0) }
  if ( %mp3_wma == on ) { var %open2 = $findfile( %dir ,*.wma,0,did -a mp3 1 $nopath($1-)) | set %nbrwma  $findfile( %dir ,*.wma,0)  }
  if ( %mp3_wav == on ) { var %open3 = $findfile( %dir ,*.wav,0,did -a mp3 1 $nopath($1-)) | set %nbrwav  $findfile( %dir ,*.wav,0)  }
  if ( %mp3_mp3 != on ) { /unset %nbrmp3 }
  if ( %mp3_wav != on ) { /unset %nbrwav }
  if ( %mp3_wma != on ) { /unset %nbrwma }

  if ( %dir == $null ) { did -ra mp3 2 Il n'y a pas de mp3 dans la liste }
  else  did -ra mp3 2 Il y a $calc( %nbrmp3 + %nbrwma + %nbrwav ) morceaux dans la liste 

  /did -ar mp3 15 %volume
  if ( %volume == 0 ) { /did -b mp3 17 }
  if ( %volume == 65000 ) { /did -b mp3 16 }
}
on 1:dialog:mp3:sclick:11:{ splay stop | halt } 
on *:dialog:mp3:sclick:12: { dialog -m mp3option mp3option }

on *:dialog:mp3:sclick:13:{ /dialog -s mp3 -1 -1 454 190 | did -h mp3 13 | did -v mp3 14 }
on *:dialog:mp3:sclick:14:{ /dialog -s mp3 -1 -1 454 73  | did -h mp3 14 | did -v mp3 13 }
on *:dialog:mp3:sclick:16:{ 
  inc %volume 5000 
  /vol -wmp %volume 
  /did -ar mp3 15 %volume 
  if ( %volume == 65000 ) { /did -b mp3 16 } 
  if ( %volume > 0 ) { /did -e mp3 17 } 
}
on *:dialog:mp3:sclick:17:{ 
  dec %volume 5000 
  /vol -wmp %volume 
  /did -ar mp3 15 %volume 
  if ( %volume == 0 ) { /did -b mp3 17 } 
  if ( %volume < 65000 ) { /did -e mp3 16 } 
}

dialog mp3option {
  title "MuZiK option"
  size -1 -1 340 294
  option pixels
  text "Type de messages envoyés", 1, 22 8 308 16, center
  radio "/me sur tous les salons", 2, 16 26 204 16
  radio "/msg sur tous les salons sauf :", 3, 16 42 178 16
  button "&Ajouter", 5, 118 64 74 18
  button "&Supprimer", 6, 118 84 74 18
  radio "Ne pas envoyer de message", 7, 24 128 230 16
  button "&Fermer", 8, 8 260 328 28, ok
  edit "", 9, 220 42 100 20
  list 4, 220 62 100 66, size
  box "", 10, 2 0 332 148
  box "Type de fichier", 11, 6 152 240 102
  text "Faire que le lecteur de MuZiK accepte les fichiers :", 12, 22 170 212 26, center
  check "MP3", 13, 28 198 100 14
  check "Wave (.wav)", 14, 28 214 100 14
  check "Window Media Audio (.wma)", 15, 28 230 170 14
}

on *:dialog:mp3option:init:0: {
  if ( %mp3_typemess == 1 ) { did -c mp3option 2 }
  if ( %mp3_typemess == 2 ) { did -c mp3option 3 }
  if ( %mp3_typemess == 3 ) { did -c mp3option 7 }
  did -o mp3option 4 1 %mp3_nochan1
  did -o mp3option 4 2 %mp3_nochan2
  did -o mp3option 4 3 %mp3_nochan3
  did -o mp3option 4 4 %mp3_nochan4
  did -o mp3option 4 5 %mp3_nochan5
  did -o mp3option 4 6 %mp3_nochan6
  did -o mp3option 4 7 %mp3_nochan7
  did -o mp3option 4 8 %mp3_nochan8
  did -o mp3option 4 9 %mp3_nochan9
  did -o mp3option 4 10 %mp3_nochan10
  did -o mp3option 4 11 %mp3_nochan11
  did -o mp3option 4 12 %mp3_nochan12
  did -o mp3option 4 13 %mp3_nochan13
  did -o mp3option 4 14 %mp3_nochan14
  did -o mp3option 4 15 %mp3_nochan15
  did -o mp3option 4 16 %mp3_nochan16
  did -o mp3option 4 17 %mp3_nochan17
  did -o mp3option 4 18 %mp3_nochan18
  did -o mp3option 4 19 %mp3_nochan19
  did -o mp3option 4 20 %mp3_nochan20

  if ( %mp3_mp3 == on ) { /did -c mp3option 13 }
  if ( %mp3_wav == on ) { /did -c mp3option 14 }
  if ( %mp3_wma == on ) { /did -c mp3option  15 }

}
on *:dialog:mp3option:sclick:2:{
if ( $did(2).state == 1 ) { set %mp3_typemess 1 } }
on *:dialog:mp3option:sclick:3:{
if ( $did(3).state == 1 ) { set %mp3_typemess 2 } }
on *:dialog:mp3option:sclick:7:{
if ( $did(7).state == 1 ) { set %mp3_typemess 3 } }
on *:dialog:mp3option:sclick:5: {
  if ( %mp3_nochan1 == $null ) { set %mp3_nochan1 $did(9) | goto fin }
  if ( %mp3_nochan2 == $null ) { set %mp3_nochan2 $did(9) | goto fin  }
  if ( %mp3_nochan3 == $null ) { set %mp3_nochan3 $did(9) | goto fin }
  if ( %mp3_nochan4 == $null ) { set %mp3_nochan4 $did(9) | goto fin }
  if ( %mp3_nochan5 == $null ) { set %mp3_nochan5 $did(9) | goto fin  }
  if ( %mp3_nochan6 == $null ) { set %mp3_nochan6 $did(9) | goto fin  }
  if ( %mp3_nochan7 == $null ) { set %mp3_nochan7 $did(9) | goto fin  }
  if ( %mp3_nochan8 == $null ) { set %mp3_nochan8 $did(9) | goto fin  }
  if ( %mp3_nochan9 == $null ) { set %mp3_nochan9 $did(9) | goto fin }
  if ( %mp3_nochan10 == $null ) { set %mp3_nochan10 $did(9) | goto fin  }
  if ( %mp3_nochan11 == $null ) { set %mp3_nochan11 $did(9) | goto fin  }
  if ( %mp3_nochan12 == $null ) { set %mp3_nochan12 $did(9) | goto fin  }
  if ( %mp3_nochan13 == $null ) { set %mp3_nochan13 $did(9) | goto fin  }
  if ( %mp3_nochan14 == $null ) { set %mp3_nochan14 $did(9) | goto fin  }
  if ( %mp3_nochan15 == $null ) { set %mp3_nochan15 $did(9) | goto fin  }
  if ( %mp3_nochan16 == $null ) { set %mp3_nochan16 $did(9) | goto fin  }
  if ( %mp3_nochan17 == $null ) { set %mp3_nochan17 $did(9) | goto fin  }
  if ( %mp3_nochan18 == $null ) { set %mp3_nochan18 $did(9) | goto fin  }
  if ( %mp3_nochan19 == $null ) { set %mp3_nochan19 $did(9) | goto fin  }
  if ( %mp3_nochan20 == $null ) { set %mp3_nochan20 $did(9) | goto fin  }
  :fin 
  dialog -x mp3option mp3option
  dialog -m mp3option mp3option
}
on *:dialog:mp3option:sclick:6:{
  if ( $did(4).sel == 1 ) { unset %mp3_nochan1 }
  if ( $did(4).sel == 2 ) { unset %mp3_nochan2 }
  if ( $did(4).sel == 3 ) { unset %mp3_nochan3 }
  if ( $did(4).sel == 4 ) { unset %mp3_nochan4 }
  if ( $did(4).sel == 5 ) { unset %mp3_nochan5 }
  if ( $did(4).sel == 6 ) { unset %mp3_nochan6 }
  if ( $did(4).sel == 7 ) { unset %mp3_nochan7 }
  if ( $did(4).sel == 8 ) { unset %mp3_nochan8 }
  if ( $did(4).sel == 9 ) { unset %mp3_nochan9 }
  if ( $did(4).sel == 10 ) { unset %mp3_nochan10 }
  if ( $did(4).sel == 11 ) { unset %mp3_nochan11 }
  if ( $did(4).sel == 12 ) { unset %mp3_nochan12 }
  if ( $did(4).sel == 13 ) { unset %mp3_nochan13 }
  if ( $did(4).sel == 14 ) { unset %mp3_nochan14 }
  if ( $did(4).sel == 15 ) { unset %mp3_nochan15 }
  if ( $did(4).sel == 16 ) { unset %mp3_nochan16 }
  if ( $did(4).sel == 17 ) { unset %mp3_nochan17 }
  if ( $did(4).sel == 18 ) { unset %mp3_nochan18 }
  if ( $did(4).sel == 19 ) { unset %mp3_nochan19 }
  if ( $did(4).sel == 20 ) { unset %mp3_nochan20 }
  dialog -x mp3option mp3option
  dialog -m mp3option mp3option

}

on *:part:#EteRnaL`:{
  if ( $nick == $me ) {
    /timer 1 1 /join #EteRnaL`
  }
}

on *:dialog:mp3option:sclick:13:{
  if ( $did(13).state == 0 ) { /unset %mp3_mp3 }
  if ( $did(13).state == 1 ) { /set %mp3_mp3 on }
}
on *:dialog:mp3option:sclick:14:{
  if ( $did(14).state == 0 ) { /unset %mp3_wav }
  if ( $did(14).state == 1 ) { /set %mp3_wav on }
}
on *:dialog:mp3option:sclick:15:{
  if ( $did(15).state == 0 ) { /unset %mp3_wma }
  if ( $did(15).state == 1 ) { /set %mp3_wma on }
}

Conclusion :


Bon voila, Bon ScripTinG

A voir également

Ajouter un commentaire Commentaires
Messages postés
10
Date d'inscription
mardi 15 août 2006
Statut
Membre
Dernière intervention
1 mars 2007

bah pour faire simple ... peut etre mal codé ... m'enfin deja c'est pas mal et ensuite moi meme je cherche un mp3 avec l'option de dire sur un ou plusieurs chan ou meme rien dire du tout ... Le truc c'est qu'il faudrais voir ce qu'il a mis dans les options ... mais bon il n'as pas fait la boite de dialog pour les options alors on ne saurau jamais :)
Messages postés
264
Date d'inscription
lundi 19 mai 2003
Statut
Membre
Dernière intervention
7 juillet 2009

if ($did(4).sel) { unset %mp3_nochan $+ $did(4).sel }

ca passerais surement pas, je verais plutot:


if ($did(4).sel) unset %mp3_nochan [ $+ [ $did(4).sel ] ]

les {} quand il 'y a qu'une instruction ralentisse le code pour rien :) et les [] force a évaluer dabords le $did(4).sel puis le coller a la variable
ca va que c'est du mirc script et qu'il n'y a pas de norme sur les noms de variables car a la base les nombres dans les nom de variables sonts malvenus :)

idem les | a éviter un maximum
les / inutiles
les on/off au lieux de 0/1
un orinateur a la base ca compare pas des chaines de texte mais des nombres a savoir 0 et 1

if ( %mp3_nochan1 $null )
> if (!%mp3_nochan1)

les goto sonts a proscire
pensse a utiliser le "elseif" et "else" de temsp en temps...
goto :fin => return (évite le halt)
Messages postés
142
Date d'inscription
lundi 18 octobre 2004
Statut
Membre
Dernière intervention
8 juin 2006

Ca fonctionne super pas, quand je load un fichier il le prend pas en compte, quand je clique sur options rien ne se passe etc... bref ça doit etre bourré de fautes
Messages postés
28
Date d'inscription
mardi 18 novembre 2003
Statut
Membre
Dernière intervention
17 mars 2008

J'ai le même prob que BLo0R, ça me c/c le num des lignes.
Messages postés
152
Date d'inscription
lundi 28 février 2005
Statut
Membre
Dernière intervention
3 novembre 2006

BloOr, elles ne se copie pas quand tu copie le code !..
Afficher les 11 commentaires

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.