Comme prévu, je poste la nouvelle version de mon premier anti clones sans dialog, sans rien d'ailleurs...
Code completement autonome, pas de confirmation de kick.
Possibilité:
d'ignoré un host/nick ( ilimité)
de régler le nombre de clones
d'avertir ou non avant de kickall/kickbanall
de choisir vos mode lorsque les clones entrent
de choisir vos chan ( ilimité)
choisir la raison du kick
le désactivé :P
Merci de pas etre trop méchant, c'est mon premier dialog :))
Plopman
Laissé donc un pti message ...
Source / Exemple :
alias anticlones { dialog -m a.c a.c }
dialog a.c {
title "Anti-clones"
size -1 -1 160 312
option dbu
box "Général", 1, 8 9 143 23
button "Ajouter", 3, 57 64 36 12, flat
button "Supprimer", 2, 57 80 36 12, flat
radio "off", 7, 42 15 26 10, flat
radio "on", 6, 14 15 26 10, flat
box "Salons", 8, 9 33 142 75
list 4, 98 41 47 64, size
box "Réglage", 5, 8 111 142 46
edit "", 9, 45 43 50 10
text "Chan", 10, 15 44 25 8
text "Quand on dépasse le nombre maximum de clones:", 15, 13 122 123 8
radio "Kickall", 16, 15 133 27 10
radio "Kickbanall", 17, 15 144 35 10
button "Ok / Enregistrer", 18, 8 297 142 12, flat
radio "Mode +im", 19, 76 134 35 10
radio "mode+", 20, 76 145 25 10
edit "", 21, 101 145 36 10
box "Host/nick a ignoré", 22, 8 159 142 80
text "Nick/host", 23, 28 172 37 8
button "Ajouter à la liste", 24, 11 199 65 12, flat
list 25, 81 166 64 64, size
edit "", 26, 11 184 65 10
button "Supprimer de la liste", 27, 11 217 65 12, flat
text "Anti-clones par Plopman", 28, 85 1 65 8
edit "", 12, 125 16 22 10
text "Max clones:", 13, 89 17 35 8
box "Avertissement / Raisons", 14, 8 242 142 50
text "raison du kick", 29, 13 255 38 8
edit "", 30, 54 253 85 10, autohs
check "Avertir quand max clones ( notice )", 31, 13 267 132 10
}
ON *:DIALOG:a.c:*:*:{
if ($devent == init) {
update.a
update.h
did -a a.c 12 %nc.ac
did -a a.c 30 %raison.a
if (%ac.e == on) { did -c a.c 6 }
else {
did -c a.c 7
}
if (%ac.mode == im) {
did -c a.c 19
did -b a.c 21
}
else { did -c a.c 20
did -a a.c 21 %ac.mode
}
if (%type.a == kba) {
did -c a.c 17
}
else {
did -c a.c 16
}
if (%prev.a == on) {
did -c a.c 31
}
else {
did -u a.c 31
}
}
if ($devent == sclick) {
if ($did == 31) {
if ($did(31).state == 1) { set %prev.a on }
else {
set %prev.a off
}
}
if ($did == 16) {
set %type.a ka
if (%ac.e == on) {
did -c a.c 6
}
else {
did -c a.c 7
}
if (%ac.mode == im) {
did -c a.c 19 }
else { did -c a.c 20
}
}
if ($did == 3) {
set %chan.a $addtok(%chan.a,$did(9),32)
update.a
}
if ($did == 17) {
set %type.a kba
if (%ac.e == on) {
did -c a.c 6
}
else {
did -c a.c 7
}
if (%ac.mode == im) {
did -c a.c 19 }
else {
did -c a.c 20
}
}
if ($did == 7) {
set %ac.e off
if (%type.a == kba) {
did -c a.c 17
}
else {
did -c a.c 16
}
if (%ac.mode == im) {
did -c a.c 19 }
else {
did -c a.c 20
}
}
if ($did == 6) {
set %ac.e on
if (%type.a == kba) {
did -c a.c 17
}
else {
did -c a.c 16
}
if (%ac.mode == im) {
did -c a.c 19 }
else {
did -c a.c 20
}
}
if ($did == 2) {
var %del.a = $did(4).seltext
set %chan.a $remtok(%chan.a,%del.a,32)
update.a
}
if ($did == 27) {
var %del.a = $did(25).seltext
set %chan.h $remtok(%chan.h,%del.a,32)
update.h
}
if ($did == 24) { set %chan.h $addtok(%chan.h,$did(26),32)
update.h
}
if ($did == 20) {
did -e a.c 21
set %ac.mode m
if (%ac.e == on) {
did -c a.c 6
}
else {
did -c a.c 7
}
if (%type.a == kba) {
did -c a.c 17
}
else {
did -c a.c 16
}
}
if ($did == 18) {
set %nc.ac $did(12)
set %raison.a $did(30)
if ( %ac.mode == im ) { halt } else {
set %ac.mode $did(21)
}
dialog -x a.c a.c
}
if ($did == 19) {
set %ac.mode im
did -b a.c 21
if (%ac.e == on) {
did -c a.c 6 |
}
else {
did -c a.c 7
}
if (%type.a == kba) {
did -c a.c 17
}
else {
did -c a.c 16
}
}
}
}
alias update.a {
did -r a.c 4
var %update.a = 1
if ($gettok(%chan.a,%update.a,32) != $null) {
:update.a
did -a a.c 4 $gettok(%chan.a,%update.a,32)
inc %update.a
if ($gettok(%chan.a,%update.a,32) != $null) {
goto update.a
}
}
}
alias update.h {
did -r a.c 25
var %update.h = 1
if ($gettok(%chan.h,%update.h,32) != $null) {
:update.h
did -a a.c 25 $gettok(%chan.h,%update.h,32)
inc %update.h
if ($gettok(%chan.h,%update.h,32) != $null) { goto update.h
}
}
}
on *:JOIN:%chan.a: {
if (%ac.e == on) && ($me isop $chan ) && ($address($nick,2) != $address($me,2)) && ( $ialchan($address($nick,2),$chan,0) >= %nc.ac ) {
if ($address($nick,2) isin %chan.h) { halt }
if ($nick isin %chan.h) { halt }
if (%type.a == kba) {
ban # $nick 2
}
if (%ac.mode == im) {
mode $chan +im
}
if (%ac.mode != im) {
mode $chan + $+ %ac.mode
}
var %ir 1
while ($ial($address($nick,2),%ir).nick != $null) {
kick # $ial($address($nick,2),%ir).nick %raison.a
inc %ir
}
if (%ac.mode == im) {
mode $chan -m
timer 1 3 mode $chan -i
}
if (%ac.mode != im) {
mode $chan - $+ %ac.mode
}
}
set %nc.ac1 $calc(%nc.ac -1)
if (%ac.e == on) && (%prev.a == on) && ( $me isop $chan ) && ($address($nick,2) != $address($me,2)) && ( $ialchan($address($nick,2),$chan,0) = %nc.ac1 ) {
if ($address($nick,2) isin %chan.h) { halt }
if ($nick isin %chan.h) { halt }
notice $nick 4/!\1 Dernier clones autorisé avant sanction! Attention 4/!\ 1 %nc.ac Clones maximum autorisé sur $chan
echo -a [Anti-Clones] Info: 4Maximum de clones atteind pour $nick . A recu une notice d'avertissement.
}
}
Conclusion :
Pour lancer c'est /anticlones
Je pense que ce code est parfait si vous devez garder un salon lorsque vous etes absent ;o)
Si vous voullez pas changer le mode du salon, cliquer sur mode+ et laissé la case vide.
Plopman
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.