Je sais qu'il existe sur cs des milliers d'auto-join
cela dit j'en ai retrouvé un que j'avais fait il y a assez longtemps, qui etait assez complet et que je n'ai que legerement retouché
j'attend vos commentaires
edit: donc comme demaindé j'ai ajouté l'auto join par server
Source / Exemple :
dialog aj {
title "Auto Join"
size -1 -1 176 148
option dbu
list 1, 6 9 91 129, size
combo 2, 107 16 60 50, size drop
button "add", 5, 107 32 25 12,
button "del", 6, 142 32 25 12,
box "Servers and Channels", 7, 102 6 70 95
button "add channel", 8, 108 66 58 12, ok
button "del channel", 10, 108 82 58 12,
check "open dialog on connect", 11, 105 114 70 10,
check "enable auto join", 14, 105 104 58 10,
button "!", 15, 108 49 10 10, flat
text "Quel serveur ?", 19, 123 51 50 10
button "&Cancel", 16, 138 126 33 12,cancel
button "&OK", 17, 102 126 33 12
link "JOIN ALL", 18, 33 139 33 12
}
on *:dialog:aj:*:*:{
if ($devent == init) {
mdx SetMircVersion $version
mdx MarkDialog $dname
mdx SetBorderStyle 1 border
mdx SetControlMDX $dname 1 ListView report single grid > dll/views.mdx
did -i $dname 1 1 headerdims 60 80 60
did -i $dname 1 1 headertext Channel $chr(9) Description $chr(9) Pass
if (!%aj.state) { set %aj.state c } | if (!%aj.owin) { set %aj.owin c }
if (!$server) { did -h $dname 18 }
did - $+ %aj.state $dname 14 | did - $+ %aj.owin $dname 11 | did -b $dname 8,10
boucle-s | boucle-c
if ($did(2)) { did -e $dname 8,6 }
}
if ($devent == sclick) {
if ($did == 1) {
did -e $dname 10 | tokenize 32 $did(1).seltext | set %aj.sel.chan $remove($6, +)
if (!%aj.sel.chan) { did -b $dname 10 }
}
else { did $+(-,$iif($server,v,h)) $dname 18 | did -b $dname 10 }
if ($did == 2) {
if ($did(2)) { did -e $dname 8,6 }
if ($lines(ajoin\ $+ $did(2))) { boucle-c } | else { did -r $dname 1 }
}
if ($did == 5) { if ($input(Rentrer ici le nom du serveur ou du network ,iey,Ajout d'un network/serveur irc)) { did -cua $dname 2 $! | write $s($shortfn($mircdirajoin\ $+ $!)) | did -r $dname 1 | did -e $dname 8,6 } }
if ($did == 6) {
if ($did(2)) { if ($hget($did(2))) hfree $did(2)
.remove $s($shortfn($mircdirajoin\ $+ $did(2))) | did -r $dname 2,1 | unset %aj.sel.chan | boucle-s | boucle-c }
}
if ($did == 8) {
if ($input(Rentrez le channel à ajouter à la liste :,iye,Ajout d'un channel)) { var %channel = $iif($left($!,1) == $chr(35),$!,$chr(35) $+ $!) } | if (!%channel) halt
if ($input(Description du channel :,iye,Ajout d'un channel)) { var %desc = $! } | else { var %desc = aucune }
if ($input(Mot de passe du channel (laisser vide si aucun mot de passe) :,ipye,Ajout d'un channel)) { var %pas = * $+ $! }
hadd -m $did(2) %channel %desc %pas | hsave -o $did(2) $s($shortfn($mircdirajoin\ $+ $did(2)))
boucle-c | halt
}
if ($did == 10) { if (%aj.sel.chan) { hdel $did(2) %aj.sel.chan | hsave -o $did(2) $shortfn($mircdirajoin\ $+ $did(2)) | boucle-c } }
if ($did == 15) { if ($input(Si vous ne connaissez pas le serveur sur lequel vous vous trouvez tapez //echo -a $chr(36) $+ server lorsque vous êtes connecté à celui-ci. $crlf Pour savoir le network tapez //echo -a $chr(36) $+ network lorsque vous êtes connecté. $iif($server != $null,$crlf $crlf Actuellement connecté à: $crlf Network : $network $crlf Serveur : $server), io,Aide)) { halt } }
if ($did == 17) { set %aj.state $iif(!$did(14).state,u,c) | set %aj.owin $iif(!$did(11).state,u,c) | dialog -x $dname $dname }
if ($did == 18) {
if ($lines(ajoin\ $+ $network)) {
if (!$hget($network)) hmake $network 1000 | hload $network $s($shortfn($mircdirajoin\ $+ $network))
var %i = $hget($network,0).item
while (%i) {
tokenize 32 $hget($network,%i).data | join $hget($network,%i).item $iif($left($ [ $+ [ $0] ],1) == *,$remove($ [ $+ [ $0] ],*),) | dec %i }
}
elseif ($lines(ajoin\ $+ $server)) {
if (!$hget($server)) hmake $server 1000 | hload $server $s($shortfn($mircdirajoin\ $+ $server))
var %i = $hget($server,0).item
while (%i) {
tokenize 32 $hget($server,%i).data | join $hget($server,%i).item $iif($left($ [ $+ [ $0] ],1) == *,$remove($ [ $+ [ $0] ],*),) | dec %i }
}
}
}
}
alias -l boucle-s {
var %i 1, %total $findfile($mircdirajoin,*.*,0)
if (%total == 0) { did -b $dname 8,10,6 | halt }
while (%i <= %total) {
var %t = $nopath($findfile($mircdirajoin,*.*,%i))
did $iif($network == %t || $server == %t,-cua,-a) $dname 2 %t
inc %i }
}
alias -l boucle-c {
if ($did(2)) { if (!$hget($did(2))) { hmake $did(2) 1000 }
hload $did(2) $s($shortfn($mircdirajoin\ $+ $did(2))) }
did -r aj 1
var %i = $hget($did(2),0).item
while (%i) {
tokenize 32 $hget($did(2),%i).data
did -a aj 1 $tab($hget($did(2),%i).item,$iif($left($ [ $+ [ $0 ] ],1) != *,$1- [ $+ [ $0 ] ] ,$1- [ $+ [ $calc($0 - 1) ] ]), $iif($left($ [ $+ [ $0 ] ],1) == *,$pass($remove($ [ $+ [ $0 ] ],*) ,)))
dec %i }
}
alias -l tab {
if (!$1) return $chr(9) | var %t,%w = 1
while ($($+($,%w),2)) { %t = $instok(%t,$($+($,%w),2),0,9) | inc %w }
return %t
}
alias aj if (!$dialog(aj)) dialog -m aj aj
alias -l pass { return $str(*,$len($1)) }
alias -l mdx dll $shortfn($mircdirdll\mdx.dll) $1-
alias -l s return $+(",$1-,")
on *:load:{ if (!$exists($scriptdirajoin)) { mkdir ajoin } echo -a chargement du script ok }
on *:unload:{
if ($exists(ajoin)) {
.echo -q $findfile(ajoin,*.*,0,remove $s($1-))
rmdir ajoin
}
unset %aj.* | echo -a Script correctement déchargé
}
on *:connect:{
if (%aj.state == c && $lines(ajoin\ $+ $network)) {
if (!$hget($network)) { hmake $network 1000 | hload $network $s($shortfn(ajoin\ $+ $network)) }
var %i = $hget($network,0).item
while (%i) { tokenize 32 $hget($network,%i).data | join $hget($network,%i).item $iif($left($ [ $+ [ $0 ] ],1) == *,$remove($ [ $+ [ $0 ] ],*),) | dec %i }
}
elseif (%aj.state == c && $lines(ajoin\ $+ $server)) {
if (!$hget($server)) { hmake $server 1000 | hload $server $s($shortfn(ajoin\ $+ $server)) }
var %i = $hget($server,0).item
while (%i) { tokenize 32 $hget($server,%i).data | join $hget($server,%i).item $iif($left($ [ $+ [ $0 ] ],1) == *,$remove($ [ $+ [ $0 ] ],*),) | dec %i }
}
if (%aj.owin == c) aj
}
Conclusion :
il vous faut placer mdx.dll et views.mdx dans un dossier dll ds la racine de votre script
important: signaler moi tous les bugs que vs pouvez trouver merci
utilisation: /aj
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.