C'est un auto-joint... aussi...

Contenu du snippet

Il présente l’avantage d’utiliser le chan-folder de mirc, (ajout/suppression…) et de ne pas être limité, il a aussi de rapides options de Founder (encore sous ChanServ)

Source / Exemple :


;======Procédures internes
alias setautogoreg {
  set %numchan 0
  unset %autogoreg
  :loop
  set %donnée $readini mirc.ini chanfolder n [ $+ [ %numchan ] ]
  inc %numchan 1
  if (%donnée == $null ) goto finsetautogoreg
  set %autogoreg $insertreg(%autogoreg, %donnée)
  goto loop 
  :finsetautogoreg
  unset %donnée %numchan
} 

alias ajouterchan {
  set %numreg 1
  :loop
  set %donnée $gettok(%autogoreg,%numreg,44)
  if (%donnée == $nul) goto finajouter
  set %numécrire %numreg - 1
  writeini mirc.ini chanfolder n $+ %numécrire %donnée
  inc %numreg
  goto loop 
  :finajouter
  unset %donnée %numreg %numécrire
}

alias suprimerchan {
  set %numreg 1
  :loop
  set %donnée $gettok(%autogoreg,%numreg,44)
  if (%donnée == $nul) goto finajouter
  set %numécrire %numreg - 1
  writeini mirc.ini chanfolder n $+ %numécrire %donnée
  inc %numreg
  goto loop 
  :finajouter
  set %numécrire %numreg - 1
  remini mirc.ini chanfolder n $+ %numécrire
  unset %donnée %numreg %numécrire
}

alias lesrejoindre {
  set %autoacte.count.n 0
  set %tps 10
  :loopact
  inc %autoacte.count.n
  set %goin $gettok(%autoactereg,%autoacte.count.n,44)
  if (%goin == $null) goto fini
  .timer 1 %tps /join %goin
  inc %tps 5
  goto loopact 
  :fini
  unset %autoacte.count.n %tps %goin
}

alias setautogo_2 {
  did -r autogo 2
  set %autogo.count.n 0
  :loop
  inc %autogo.count.n
  set %donnée $gettok(%autogoreg,%autogo.count.n,44)
  if (%donnée == $nul) goto finsetautogo_2
  did -a autogo 2 %donnée
  goto loop 
  :finsetautogo_2
  unset %autogo.count.n
  unset %donnée
} 

alias setautogo_3 {
  did -r autogo 3
  set %autoacte.count.n 0
  :loopact
  inc %autoacte.count.n
  set %donnée $gettok(%autoactereg,%autoacte.count.n,44)
  if (%donnée == $null) /goto finsetautogo_3
  did -a autogo 3 %donnée
  goto loopact 
  :finsetautogo_3
  unset %autoacte.count.n 
  unset %donnée
}
;========== Dialog ============
alias autogo dialog -m autogo autogo
dialog autogo {
  size -1 -1 410 300
  title "Auto rejoindre les salons "

  tab "Joindre",20, 170 50 230 185
  tab "Founder",30

  button "Fermer", 1, 330 245 70 20, ok
  button "Joindre", 13, 330 20 70 20

  check "Rejoindre automatiquement", 11, 175 75 200 20,tab 20
  button "Les joindres", 14, 325 198 70 20,tab 20
  list 3,175 95 140 140,tab 20
  check "Activer l'auto-Join", 6, 10 245 130 20,tab 20
  check "Afficher à la connection", 12, 140 245 130 20, tab 20

  box "Liste des Chanels", 10, 10 5 395 230
  button "Ajouter", 7, 15 20 70 20
  button "Enlever", 8, 90 20 70 20
  list 2, 15 45 150 200
  edit "", 4,  170 20 150 20, autohs

  check "Activer l'auto-identification- founder", 56, 10 245 200 20,tab 30
  button "s'identifier", 512, 180 130 60 20, tab 30
  button "Changer", 513, 245 130 60 20, tab 30
  button "Enregistrer", 514, 310 130 60 20, tab 30
  button "DROPPER", 515, 315 170 60 20, tab 30
  box "",516, 175 150 210 50, tab 30
  text "Attention , commande pour désenregistrer le salon",517, 180 165 130 40, tab 30

  edit "Mot de passe", 54, 210 80 175 20, autohs, tab 30
  text "Passe:" 55,175 80 35 20,tab 30
  check "Activer l'indentification", 511, 175 100 200 20,tab 30

}

on *:dialog:autogo:init:*:{
  /setautogoreg
  /setautogo_2
  /setautogo_3
  did -b autogo 11,7,8
  if (%autojoindre == ON) { did -c autogo 6 }
  if (%afficherautojoin == ON) { did -c autogo 12 }
  if (%autoidfounder == ON) { did -c autogo 56 }

}

on *:dialog:autogo:sclick:2:{
  did -e autogo 11,8
  did -u autogo 11,511
  if (%autojoindre [ $+ [ $did(2,$did(2).sel).text ] ] == On ) { did -c autogo 11 }
  did -r autogo 4
  did -a autogo 4 $did(2,$did(2).sel).text
  if (%autoidfounder  [ $+ [ $did(2,$did(2).sel).text ] ] == On ) { did -c autogo 511 }
  did -ra autogo 54 %founderid [ $+ [ $did(4) ] ]

}

on *:dialog:autogo:sclick:3:{
  did -e autogo 11,8
  did -r autogo 4
  did -a autogo 4 $did(3,$did(3).sel).text
  did -u autogo 11
  if (%autojoindre [ $+ [ $did(3,$did(3).sel).text ] ] == On ) { did -c autogo 11 }
  /setautogo_2
}

on *:dialog:autogo:edit:4:{
  if ($did(4) == $null) { 
    did -br autogo 11
    did -b autogo 7,8
  }
  if ($did(4) != $null) {
    set %modif $did(4) $+ ,
    if (%modif isin %autogoreg) {
      did -e autogo 11
      did -b autogo 7
      did -e autogo 8
      if (%autojoindre [ $+ [ $did(4) ] ] == On ) { did -c autogo 11 }
    }
    else {
      did -br autogo 11
      did -b autogo 8
      did -e autogo 7
    }
    unset %modif
  }
}

on *:dialog:autogo:sclick:7:{
  if ($did(4) != $null) {
    set %whoadd $did(4) $+ ,
    if (%whoadd !isin %autogoreg) {
      set %autogoreg $insertreg(%autogoreg, $did(4).text )
      /setautogo_2
      /setautogo_3
      /ajouterchan
      did -r autogo 4
      did -u autogo 11
    }
    unset %whoadd
  }
}

on *:dialog:autogo:sclick:8:{

  if ($did(4) != $null) {
    set  %whoremove $did(4) $+ ,

    if (%whoremove isin %autoactereg) { 
      set %autoactereg $remove(%autoactereg,%whoremove)
      unset %autojoindre $+ $did(4)
      /setautogo_3
      did -u autogo 11
    }
    if (%whoremove isin %autogoreg) {    
      set %autogoreg $remove(%autogoreg,%whoremove)
      /setautogo_2
      /suprimerchan
      did -r autogo 4
      did -b autogo 11,7,8
    }
    unset %whoremove
  }
}

on *:dialog:autogo:sclick:6: {
  if ($did(6).state == 0) { .disable #autojoindre | set %autojoindre Off | echo 1 -s  *** autojoindre maintenant Inactif }
  if ($did(6).state == 1) { .enable #autojoindre | set %autojoindre On | echo 1 -s  *** autojoindre maintenant Actif }
}

on *:dialog:autogo:sclick:11: {
  if ($did(4) != $null) {
    if ($did(11).state == 0) { 
      unset %autojoindre $+ $did(4) 
      set %autoacte-remove $did(4) $+ ,
      set %autoactereg $remove(%autoactereg,%autoacte-remove)
      /setautogo_3
      unset %autoacte-remove
    } 

  }
  if ($did(11).state == 1) { 
    set %autojoindre $+ $did(4) On  
    set %whatthat $did(4) $+ ,
    if (%whatthat !isin %autoactereg) {
      set %autoactereg $insertreg(%autoactereg, $did(4) )
      /setautogo_3
      unset %whatthat
    }
  }
}

on *:dialog:autogo:sclick:12: {
  if ($did(12).state == 0) { .disable #autoaffiche | set %afficherautojoin Off | echo 1 -s  *** autoafficher maintenant Inactif }
  if ($did(12).state == 1) { .enable #autoaffiche | set %afficherautojoin On | echo 1 -s  *** autoafficher maintenant Actif }
}
on *:dialog:autogo:sclick:13: {
  if ($did(4) != $null) { /join $did(4)  }

}
on *:dialog:autogo:sclick:14: {
  /lesrejoindre
  dialog -x autogo
}

on *:dialog:autogo:sclick:511: {
  if ($did(511).state == 0) { set %autoidfounder $+ $did(4)  Off  }
  if ($did(511).state == 1) { set %autoidfounder $+ $did(4) On  }
}

on *:dialog:autogo:sclick:512: {
  if ($did(4) != $null) {  
    if (%founderid [ $+ [ $did(4) ] ] != $null) { 
      /msg ChanServ identify $did(4) %founderid [ $+ [ $did(4) ] ] 
    }
  }
} 

on *:dialog:autogo:sclick:513: {
  if ($did(4) != $null) {  
    if (%founderid [ $+ [ $did(4) ] ] != $null) { 
      /msg ChanServ set $did(4) password %founderid [ $+ [ $did(4) ] ] 
    }
  }
} 
on *:dialog:autogo:sclick:514: {
  if ($did(4) != $null) {  
    if (%founderid [ $+ [ $did(4) ] ] != $null) { 
      /msg ChanServ register $did(4) %founderid [ $+ [ $did(4) ] ] 
    }
  }
} 

on *:dialog:autogo:sclick:515: {
  if ($did(4) != $null) {  
    if (%founderid [ $+ [ $did(4) ] ] != $null) { 
      /msg ChanServ drop $did(4) %founderid [ $+ [ $did(4) ] ] 
    }
  }
} 

on *:dialog:autogo:edit:54:{
  set %founderid [ $+ [ $did(4) ] ]  $did(54)
}

on *:dialog:autogo:sclick:56: {
  if ($did(56).state == 0) { .disable #autoidfounder | set %autoidfounder Off | echo 1 -s  *** autoidfounder maintenant Inactif }
  if ($did(56).state == 1) { .enable #autoidfounder | set %autoidfounder On | echo 1 -s  *** autoidfounder maintenant Actif }
}
;======================================  Groupes
#autoaffiche off
on *:CONNECT: /autogo 
#autoaffiche end

#autojoindre on
on *:CONNECT: /lesrejoindre
#autojoindre end
; ====================================== Menus
menu channel,status,menubar {
  -
  Joindre ou ajout
  . Joindre un ou des chans:/autogo
  .Identifier  Founder:/autogo
  .$iif($chan,Ajouter $chan dans la liste) :/autoajout $$chan
  .$iif($chan,Ajouter et mettre en autojoint $chan): /autoajout $$chan | /joindreauto $$chan
  .$iif($chan, Suprimer $chan de la liste):/autodelete $$chan | /part $$chan
}

alias autoidfounder.id {
  if (%autoidfounder [ $+ [ $chan ] ] == On) {  /msg ChanServ identify $chan %founderid [ $+ [ $chan ] ]   }
}

alias autoajout {
  if ($1 != $null) {
    set %whoadd $1 $+ ,
    if (%whoadd !isin %autogoreg) {
      set %autogoreg $insertreg(%autogoreg, $1 )
      /ajouterchan
    }
    unset %whoadd
  }
}

alias joindreauto {

  set %autojoindre $+ $1 On  
  set %whatthat $1 $+ ,
  if (%whatthat !isin %autoactereg) {
    set %autoactereg $insertreg(%autoactereg, $1 )
    unset %whatthat
  }
}

alias autodelete {
  if ($1 != $null) {
    set  %whoremove $1 $+ ,

    if (%whoremove isin %autoactereg) { 
      set %autoactereg $remove(%autoactereg,%whoremove)
      unset %autojoindre $+ $1
    }
    if (%whoremove isin %autogoreg) {    
      set %autogoreg $remove(%autogoreg,%whoremove)
      /suprimerchan
    }
    unset %whoremove
  }
}

#autoidfounder off
on *:JOIN:#:{ if ($nick == $me) { .autoidfounder.id } }
#autoidfounder end

Conclusion :


C’est le tout premier addon que j’ai écrit pour mon script, ce qui explique qu’il est un petit peu fouillis, mais il fonctionne bien, et je n’ai pas eu jusqu’ici besoin de le modifier
Il peut ajouter ou supprimer les chans dans le folder de mIRC avec le click droit dans le chan.
Que dire de plus, on a le choix de faire afficher le dialogue à la connection pour modifier les chan à rejoindre, ou rejoindre directement les chans.. les chans à rejoindre en auto sont dans une liste à part…
:)
Et Quidni !

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.