Sounds manager personalisable

Description

ayant vue pas mal de code de ce genre et rarement interessant et surtout pas mal critiqué je me suis codé le mien pour être satisfait et obtenir ce qui me convenait , je le poste à titre utile pour les personnes qui le trouverait interessant et à leur gout. Il est sous mdx et regroupe la gestion des effets sonores de l'ensemble des actions sous mirc à savoir les notice hl pv kick ban op deop voice deop etc le tout activable ou non et modifiable à volonté avec le petit plus permettant de pré-écouter le son choisis.Le code peut surement être optimisé , mais il est 100% fonctionnel.Il suffit de dézipper le tout dans votre dossier mirc et de loader le remote sounds.mrc.libre à vous de mettre autant de son dans le dossier son de votre mirc pour avoir le choix de l'embarras.critiques constructives bienvenues

Source / Exemple :


dialog sounds {
  title ""
  size -1 -1 194 188
  option dbu
  text "?sounds manager©?", 1, 71 4 52 8
  text "highlight", 2, 39 21 26 7, center
  text "choix du son", 3, 72 21 32 7
  text "play", 4, 163 21 15 7, center
  text "voice", 5, 39 37 26 7, center
  text "choix du son", 6, 72 37 32 7
  text "play", 7, 163 37 15 7, center
  text "fermer", 8, 96 186 18 7, center
  text "kick", 9, 39 69 26 7, center
  text "choix du son", 10, 72 69 32 7
  text "play", 11, 163 69 15 7, center
  text "devoice", 12, 39 53 26 7, center
  text "choix du son", 13, 72 53 32 7
  text "play", 14, 163 53 15 7, center
  text "op", 15, 39 101 26 7, center
  text "choix du son", 16, 72 101 32 7
  text "play", 17, 163 101 15 7, center
  text "kickban", 18, 39 85 26 7, center
  text "choix du son", 19, 72 85 32 7
  text "play", 20, 163 85 15 7, center
  text "pv", 21, 39 133 26 7, center
  text "choix du son", 22, 72 133 32 7
  text "play", 23, 163 133 15 7, center
  text "deop", 24, 39 117 26 7, center
  text "choix du son", 25, 72 117 32 7
  text "play", 26, 163 117 15 7, center
  text "notify", 27, 39 165 26 7, center
  text "choix du son", 28, 72 165 32 7
  text "play", 29, 163 165 15 7, center
  text "notice", 30, 39 149 26 7, center
  text "choix du son", 31, 72 149 32 7
  text "play", 32, 163 149 15 7, center
  check "", 33, 13 21 8 8
  check "", 34, 13 37 8 8
  check "", 35, 13 53 8 8
  check "", 36, 13 69 8 8
  check "", 37, 13 85 8 8
  check "", 38, 13 101 8 8
  check "", 39, 13 117 8 8
  check "", 40, 13 133 8 8
  check "", 41, 13 149 8 8
  check "", 42, 13 165 8 8
  edit "", 43, 109 20 50 9, multi hsbar
  edit "", 44, 109 36 50 9, multi hsbar
  edit "", 45, 109 68 50 9, multi hsbar
  edit "", 46, 109 52 50 9, multi hsbar
  edit "", 47, 109 100 50 9, multi hsbar
  edit "", 48, 109 84 50 9, multi hsbar
  edit "", 49, 109 132 50 9, multi hsbar
  edit "", 50, 109 116 50 9, multi hsbar
  edit "", 51, 109 164 50 9, multi hsbar
  edit "", 52, 109 148 50 9, multi hsbar
  button "Button", 53, 400 400 1 12, flat cancel
  box "", 54, 86 182 37 13
  box "", 55, 37 17 30 12
  box "", 56, 37 33 30 12
  box "", 57, 70 17 34 12
  box "", 58, 163 17 15 12
  box "", 59, 163 33 15 12
  box "", 60, 7 30 183 18
  box "", 61, 7 14 183 18
  box "", 62, 7 46 183 18
  box "", 63, 7 62 183 18
  box "", 64, 163 65 15 12
  box "", 65, 163 49 15 12
  box "", 66, 70 65 34 12
  box "", 67, 70 49 34 12
  box "", 68, 37 65 30 12
  box "", 69, 37 49 30 12
  box "", 70, 7 78 183 18
  box "", 71, 7 94 183 18
  box "", 72, 163 97 15 12
  box "", 73, 163 81 15 12
  box "", 74, 70 97 34 12
  box "", 75, 70 81 34 12
  box "", 76, 37 97 30 12
  box "", 77, 37 81 30 12
  box "", 78, 7 110 183 18
  box "", 79, 7 126 183 18
  box "", 80, 163 129 15 12
  box "", 81, 163 113 15 12
  box "", 82, 70 129 34 12
  box "", 83, 70 113 34 12
  box "", 84, 37 129 30 12
  box "", 85, 37 113 30 12
  box "", 86, 7 142 183 18
  box "", 87, 7 158 183 18
  box "", 88, 163 161 15 12
  box "", 89, 163 145 15 12
  box "", 90, 70 161 34 12
  box "", 91, 70 145 34 12
  box "", 92, 37 161 30 12
  box "", 93, 37 145 30 12
  box "", 94, 70 33 34 12
  box "", 95, 4 11 189 168
  icon 113, 176 20 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 114, 177 36 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 115, 177 52 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 116, 177 68 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 117, 177 84 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 118, 177 100 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 119, 176 116 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 120, 177 132 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 121, 177 148 9 9,  soundsmanager\play.jpg, 0, noborder
  icon 122, 177 164 9 9,  soundsmanager\play.jpg, 0, noborder
  text "", 97, 22 21 14 7
  text "", 98, 22 37 14 7
  text "", 99, 22 53 14 7
  text "", 100, 22 69 14 7
  text "", 101, 22 85 14 7
  text "", 102, 22 101 14 7
  text "", 103, 22 117 14 7
  text "", 104, 22 133 14 7
  text "", 105, 22 149 14 7
  text "", 106, 22 165 14 7
}
alias sounds { dialog -m sounds sounds }
on *:dialog:sounds:*:*:{
  if ($devent == init) {
    dll dll\mdx.dll SetMircVersion $version
    dll dll\mdx.dll MarkDialog $dname
    dll dll\mdx.dll SetDialog $dname bgcolor $rgb(128,0,255)
    dll dll\mdx.dll SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,97,98,99,100,101,102,103,104,105,106 textbg $rgb(128,0,255)
    dll dll\mdx.dll SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,97,98,99,100,101,102,103,104,105,106 text $rgb(255,255,255)
    dll dll\mdx.dll SetColor $dname 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,97,98,99,100,101,102,103,104,105,106 background $rgb(128,0,255)
    dll dll\mdx.dll SetDialog $dname style noborder
    aff
    if (%sounda == $null) { set %sounda 0 }
    if (%sounda) { did -c sounds 33 | did -a sounds 97 on }
    else { did -a sounds 97 off | did -b sounds 43 }
    if (%soundb == $null) { set %soundb 0 }
    if (%soundb) { did -c sounds 34 | did -a sounds 98 on }
    else { did -a sounds 98 off | did -b sounds 44 }
    if (%soundc == $null) { set %soundc 0 }
    if (%soundc) { did -c sounds 35 | did -a sounds 99 on }
    else { did -a sounds 99 off | did -b sounds 46 }
    if (%soundd == $null) { set %soundd 0 }
    if (%soundd) { did -c sounds 36 | did -a sounds 100 on }
    else { did -a sounds 100 off | did -b sounds 45 }
    if (%sounde == $null) { set %sounde 0 }
    if (%sounde) { did -c sounds 37 | did -a sounds 101 on }
    else { did -a sounds 101 off | did -b sounds 48 }
    if (%soundf == $null) { set %soundf 0 }
    if (%soundf) { did -c sounds 38 | did -a sounds 102 on }
    else { did -a sounds 102 off | did -b sounds 47 }
    if (%soundg == $null) { set %soundg 0 }
    if (%soundg) { did -c sounds 39 | did -a sounds 103 on }
    else { did -a sounds 103 off | did -b sounds 50 }
    if (%soundh == $null) { set %soundh 0 }
    if (%soundh) { did -c sounds 40 | did -a sounds 104 on }
    else { did -a sounds 104 off | did -b sounds 49 }
    if (%soundi == $null) { set %soundi 0 }
    if (%soundi) { did -c sounds 41 | did -a sounds 105 on }
    else { did -a sounds 105 off | did -b sounds 52 }
    if (%soundj == $null) { set %soundj 0 }
    if (%soundj) { did -c sounds 42 | did -a sounds 106 on }
    else { did -a sounds 106 off | did -b sounds 51 }
  }
  elseif ($devent == sclick) {
    if ($mouse.x isnum 140-210 && $mouse.y isnum 40-60) { 
      did -r $dname 43 | unset %sound1 {
        set %sound1 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 43 %sound1
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 70-90) { 
      did -r $dname 44 | unset %sound2 {
        set %sound2 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 44 %sound2
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 100-120) { 
      did -r $dname 45 | unset %sound3 {
        set %sound3 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 45 %sound3
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 130-150) { 
      did -r $dname 46 | unset %sound4 {
        set %sound4 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 46 %sound4
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 160-180) { 
      did -r $dname 47 | unset %sound5 {
        set %sound5 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 47 %sound5
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 195-215) { 
      did -r $dname 48 | unset %sound6 {
        set %sound6 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 48 %sound6
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 225-245) { 
      did -r $dname 49 | unset %sound7 {
        set %sound7 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 49 %sound7
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 265-285) { 
      did -r $dname 50 | unset %sound8 {
        set %sound8 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 50 %sound8
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 295-315) { 
      did -r $dname 51 | unset %sound9 {
        set %sound9 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 51 %sound9
      }
    }
    if ($mouse.x isnum 140-210 && $mouse.y isnum 325-345) { 
      did -r $dname 52 | unset %sound10 {
        set %sound10 $$sfile( sounds\*.mp3, Choix du son, add) | did -a $dname 52 %sound10
      }
    }
    if ($mouse.x isnum 170-245 && $mouse.y isnum 370-390) { 
      dialog -x sounds 
    }
    if ($did == 33) {  
      if (!%sounda) { set %sounda 1 | did -a sounds 97 on | did -e  sounds 43 } 
      elseif (%sounda) { set %sounda 0 | did -a sounds 97 off | did -b  sounds 43 }
    }
    if ($did == 34) {  
      if (!%soundb) { set %soundb 1 | did -a sounds 98 on | did -e  sounds 44 } 
      elseif (%soundb) { set %soundb 0 | did -a sounds 98 off | did -b  sounds 44 }
    }
    if ($did == 35) {  
      if (!%soundc) { set %soundc 1 | did -a sounds 99 on | did -e  sounds 45 } 
      elseif (%soundc) { set %soundc 0 | did -a sounds 99 off | did -b  sounds 45 }
    }
    if ($did == 36) {  
      if (!%soundd) { set %soundd 1 | did -a sounds 100 on | did -e  sounds 46 } 
      elseif (%soundd) { set %soundd 0 | did -a sounds 100 off | did -b  sounds 46 }
    }
    if ($did == 37) {  
      if (!%sounde) { set %sounde 1 | did -a sounds 101 on | did -e  sounds 47 } 
      elseif (%sounde) { set %sounde 0 | did -a sounds 101 off | did -b  sounds 47 }
    }
    if ($did == 38) {  
      if (!%soundf) { set %soundf 1 | did -a sounds 102 on | did -e  sounds 48 } 
      elseif (%soundf) { set %soundf 0 | did -a sounds 102 off | did -b  sounds 48 }
    }
    if ($did == 39) {  
      if (!%soundg) { set %soundg 1 | did -a sounds 103 on | did -e  sounds 49 } 
      elseif (%soundg) { set %soundg 0 | did -a sounds 103 off | did -b  sounds 49 }
    }
    if ($did == 40) {  
      if (!%soundh) { set %soundh 1 | did -a sounds 104 on | did -e  sounds 50 } 
      elseif (%soundh) { set %soundh 0 | did -a sounds 104 off | did -b  sounds 50 }
    }
    if ($did == 41) {  
      if (!%soundi) { set %soundi 1 | did -a sounds 105 on | did -e  sounds 51 } 
      elseif (%soundi) { set %soundi 0 | did -a sounds 105 off | did -b  sounds 51 }
    }
    if ($did == 42) {  
      if (!%soundj) { set %soundj 1 | did -a sounds 106 on | did -e  sounds 52 } 
      elseif (%soundj) { set %soundj 0 | did -a sounds 106 off | did -b  sounds 52 }
    }
    if ($did == 113) { splay %sound1 }
    if ($did == 114) { splay %sound2 }
    if ($did == 115) { splay %sound3 }
    if ($did == 116) { splay %sound4 }
    if ($did == 117) { splay %sound5 }
    if ($did == 118) { splay %sound6 }
    if ($did == 119) { splay %sound7 }
    if ($did == 120) { splay %sound8 }
    if ($did == 121) { splay %sound9 }
    if ($did == 122) { splay %sound10 }
  }
}
on *:OPEN:?: {
  if (%soundh) {
    .splay %sound8
  }
}
on *:TEXT:*:#: {
  if ($me isin $strip($1-)) && (%sounda) {
     .splay %sound1
  }
}
on *:ACTION:*:#: {
  if ($me isin $strip($1-)) && (%sounda) {
     .splay %sound1
  }
}
on *:NOTICE:*:*: {
  if (%soundi) {
    .splay %sound9
  }
}
ON *:NOTIFY:{
  if (%soundj) {
    .splay %sound10 
  }
}
ON *:op:#:{
  if ($opnick == $me) && (%soundf) {
    .splay %sound6
  }
}
ON *:voice:#:{
  if ($vnick == $me) && (%soundb) {
    .splay %sound2
  }
}

ON *:DEOP:#:{
  if ($opnick == $me) && (%soundg) {
    .splay %sound7
  }
}
ON *:DEVOICE:#:{
  if ($vnick == $me) && ($nick != $me) && (%soundc) {
    .splay %sound3
  }
}
ON *:BAN:#:{
  if ( $bnick == $me ) && (%sounde) { 
    .splay %sound5
  }
}
ON *:KICK:#:{
  if ( $knick == $me ) && (%soundd) { 
    .splay %sound4
  }
}
alias aff  {
  var %a 43 ,%b 1 ,%c = 52
  while (%a <= %c) {
    did -a $dname %a $($+(%,sound,%b),2)
    inc %a
    inc %b
  }
}
alias sing {
  if ($did isnum 113-122) { splay %sound [ $+ [ $calc($did - 112) ] ] }
}

Codes Sources

A voir également

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.

Du même auteur (cs_lebaronrouge)