Autojoin par network en dialog

Contenu du snippet

autojoin par network en dialog ,supporte un nombre infini de channels

Source / Exemple :


;codé par _NicX_

menu channel {
  [Auto-Join]
  .voir:dialog -m join join
  .ajouter $chan:ajouter 
}

dialog join {
  title "Auto-join"
  size -1 -1 118 215
  option dbu
  box "", 10, 1 56 116 158
  box "network actuel", 2, 2 2 114 52
  edit "", 3, 5 21 108 10, read
  radio "On", 8, 68 42 17 10, left
  radio "Off", 9, 91 42 17 10, left
  list 1, 3 62 61 149, size
  box "", 11, 65 61 50 37
  button "Ajouter", 12, 67 66 46 13
  button "Enlever", 13, 67 83 46 13
  box "", 14, 65 98 50 34
  button "Joindre", 15, 67 102 46 13
  button "Names", 16, 67 117 46 13
  box "", 17, 66 161 49 50
  button "Tout effacer", 18, 68 167 45 20
  button "Fermer", 19, 68 188 45 20, ok
}

alias ajouter { 
  /write $network $+ .jcvd $chan
echo -a Le channel $chan a bien été ajouté à l'autojoin pour le réseau $network
}

on *:dialog:join:init:0: {
  did -r join 3 | /did -a join 3 $network 
  if ($group(#join) == on) { did -c join 8 }
  if ($group(#join) == off) { did -c join 9 }
  if ($network $+ .jcvd == $null) halt
  if ($lines($network $+ .jcvd) != $null) { loadbuf 1-100 -o join 1 $network $+ .jcvd }
  else halt

}

on *:dialog:join:sclick:6: { /write $network $+ .jcvd |  /echo -a le fichier $network $+ .jcvd a bien était créé  }
on *:dialog:join:sclick:8: { .enable #join }
on *:dialog:join:sclick:9: { .disable #join }
on *:dialog:join:sclick:12: { ajout }
on *:dialog:join:sclick:13: { vire }
on *:dialog:join:sclick:15: { joindre }
on *:dialog:join:sclick:16: { noms }
on *:dialog:join:sclick:18: { remove $network $+ .jcvd | /echo -a le fichier $network $+ .jcvd a bien était effacé }

alias ajout { 
  set %ajout $$?="Entre un channel à joindre comme #france"
  /write $network $+ .jcvd %ajout
  /did -a join 1 %ajout
  /echo -a Le channel %ajout a bien été ajouté à l'autojoin pour le réseau $network
  unset %ajout
}

alias vire {
  set %deline $did(1).sel
  if (%deline == $null) { echo -a Tu n'as rien sélectionné }
  else {
    /echo -a Le channel $did(1,$did(1).sel).text a bien été enlevé de l'autojoin pour le réseau $network
    Write -dw"* $+ $did(1,$did(1).sel).text $+ *" $network $+ .jcvd 
    /did -d join 1 $did(1).sel
    unset %deline
  }
}

alias joindre {
  if ($did(1).sel == $null) { echo -a Tu dois sélectionner un channel }
  else {
    set %joinline $did(1,$did(1).sel).text
    /join %joinline
    unset %joinline
  }
}

alias noms {
  if ($did(1).sel == $null) { echo -a Tu dois sélectionner un channel }
  else {
    set %joinoms $did(1,$did(1).sel).text
    /names %joinoms
    unset %joinoms
  }
}

#join on

on *:connect: {
  set %conjoin 0
  while (%conjoin < $lines($network $+ .jcvd)) {
    inc %conjoin
    .timerjoin [ $+ [ %conjoin ] ] 1 $calc(%conjoin * 3) join $read($network $+ .jcvd,%conjoin) 
  }
}

#join end

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.