Auto voice et auto message à la connection

Contenu du snippet

Ben comme d'habitude, Alt+R et mettez cet add-on dans vos remotes

Source / Exemple :


dialog autovm {
  title "« Auto-Voice et Auto-Message »"
  size -1 -1 300 250
  tab "Chans en Auto-Voice", 2, 0 65 300 150
  check "Salon n°1", 3, 10 90 80 20, left tab 2
  edit %nomone, 4, 10 110 80 20, autohs tab 2
  check "Salon n°2", 5, 10 150 80 20, left tab 2
  edit %nomtwo, 6, 10 170 80 20, autohs tab 2
  check "Salon n°3", 7, 200 90 80 20, tab 2
  edit %nomthree, 8, 200 110 80 20, autohs tab 2
  check "Salon n°4", 9, 200 150 80 20, tab 2
  edit %nomfour, 10, 200 170 80 20, autohs tab 2
  tab "Chans en Auto-Message", 11, 0 200 300 130
  check "Salon n°1", 12, 25 90 80 20, left tab 11
  edit %messone, 13, 10 110 117 20, autohs tab 11
  check "Salon n°2", 14, 25 150 80 20, left tab 11
  edit %messtwo, 15, 10 170 117 20, autohs tab 11
  check "Salon n°3", 16, 200 90 80 20, tab 11
  edit %messthree, 17, 170 110 117 20, autohs tab 11
  check "Salon n°4", 18, 200 150 80 20, tab 11
  edit %messfour, 19, 170 170 117 20, autohs tab 11
  button "Ok", 20, 50 220 80 20, ok default
  button "Fermer", 21, 175 220 80 20, cancel
}
on *:dialog:autovm:sclick:3:{
  if ( %premierchan == on ) { /set %premierchan off }
  else { /set %premierchan on }
}
on *:dialog:autovm:sclick:5:{
  if ( %deuxiemechan == on ) { /set %deuxiemechan off }
  else { /set %deuxiemechan on }
}
on *:dialog:autovm:sclick:7:{
  if ( %troisiemechan == on ) { /set %troisiemechan off }
  else { /set %troisiemechan on }
}
on *:dialog:autovm:sclick:9:{
  if ( %quatriemechan == on ) { /set %quatriemechan off }
  else { /set %quatriemechan on }
}

on *:dialog:autovm:sclick:12:{
  if ( %premiermess == on ) { /set %premiermess off }
  else { /set %premiermess on }
}

on *:dialog:autovm:sclick:14:{
  if ( %deuxiememess == on ) { /set %deuxiememess off }
  else { /set %deuxiememess on }
}
on *:dialog:autovm:sclick:16:{
  if ( %troisiememess == on ) { /set %troisiememess off }
  else { /set %troisiememess on }
}
on *:dialog:autovm:sclick:18:{
  if ( %quatriememess == on ) { /set %quatriememess off }
  else { /set %quatriememess on }
}
on *:dialog:autovm:edit:4:{
  /set %nomone $did($dname,4)
}
on *:dialog:autovm:edit:6:{
  /set %nomtwo $did($dname,6)
}
on *:dialog:autovm:edit:8:{
  /set %nomthree $did($dname,8)
}
on *:dialog:autovm:edit:10:{
  /set %nomfour $did($dname,10)
}
on *:dialog:autovm:edit:13:{
  /set %messone $did($dname,13)
}
on *:dialog:autovm:edit:15:{
  /set %messtwo $did($dname,15)
}
on *:dialog:autovm:edit:17:{
  /set %nomthree $did($dname,17)
}
on *:dialog:autovm:edit:19:{
  /set %nomfour $did($dname,19)
}

on *:join:#: {
  if ( $nick == $me ) {
    if (( %premiermess == on) && ( %nomone != $null ) && ( # == %nomone )) { /msg $chan %messone }
    if (( %deuxiememess == on) && ( %nomtwo != $null ) && ( # == %nomtwo )) { /msg $chan %messtwo }
    if (( %troisiememess == on) && ( %nomthree != $null ) && ( # == %nomthree )) { /msg $chan %messthree }
    if (( %quatriememess == on) && ( %nomfour != $null ) && ( # == %nomfour )) { /msg $chan %messfour }
  }
  if ( $me isop # ) {
    if (( %premierchan == on ) && ( %nomone != $null ) && ( # == %nomone )) { /mode # +v $nick  } 
    if (( %deuxiemechan == on ) && ( %nomtwo != $null ) && ( # == %nomtwo )) { /mode # +v $nick }
    if (( %troisiemechan == on ) && ( %nomthree != $null ) && ( # == %nomthree )) { /mode # +v $nick }
    if (( %quatriemechan == on ) && ( %nomfour != $null ) && ( # == %nomfour )) { /mode # +v $nick }
  }
}

on *:dialog:autovm:init:0:{

  if ( %premierchan == on ) {  /did -c autovm 3 }
  if ( %deuxiemechan == on ) {  /did -c autovm 5 }
  if ( %troisiemechan == on ) {  /did -c autovm 7 }
  if ( %quatriemechan == on ) {  /did -c autovm 9 }
  if ( %premiermess == on ) {  /did -c autovm 12 }
  if ( %deuxiememess == on ) {  /did -c autovm 14 }
  if ( %troisiememess == on ) {  /did -c autovm 16 }
  if ( %quatriememess == on ) {  /did -c autovm 18 }
  /did -r autovm 4,6,8,10,13,15,17,19
  /did -a autovm 4 %nomone
  /did -a autovm 6 %nomtwo
  /did -a autovm 8 %nomthree
  /did -a autovm 10 %nomfour
  /did -a autovm 13 %messone
  /did -a autovm 15 %messtwo
  /did -a autovm 17 %messthree
  /did -a autovm 19 %messfour

}

on *:load:{
  /set %premierchan on
  /set %premiermess on
  /set %nompremierchan #<nom de votre chan>
  /set %messpremierchan <votre message>
  /set %deuxiemechan off
  /set %deuxiememess off
  /set %troisiemechan off
  /set %troisiememess off
  /set %quatriemechan off
  /set %quatriememess off
}

Conclusion :


Voila, bon Scripting à tous

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.