+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et scripts (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : [TCL] Petit TCL de gestion (/showthread.php?tid=1510)
J'ai codé ce petit code aujourd'hui et j'aimerais avoir votre avis de ce que je pourrais rajouté ou enlever merci !
Code :
tcl
##################################### Aurel-Tchat Network ## Server irc://irc.aurel-tchat.fr## Site-Web http://aurel-tchat.fr ## Forum http://forum.aurel-tchat.fr#####################################
###################################################################################### Attention Si vous toucher le code vous risquer de le faire planter ## Merci de pas toucher si vous avez aucune connaissance dans le domaine du TCL######################################################################################
#********************## Configuration Link ##********************#set laura(link)"Laura.*******.fr"set laura(info)"Service Moderation"set laura(host)"Laura.****.fr"set laura(ip)"IP"set laura(port)"PORT"set laura(pass)"12345678"set laura(pseudo)"Laura"set laura(real)"Laura Service Moderation"set laura(ident)"Laura"set laura(salon)"#salon"set laura(accueil)"#salon"set laura(mode)"+oOSqsw"
#***********## Connexion ##***********#proc connexion {}{global laura
if{![catch"connect $laura(ip) $laura(port)" laura(idx)]}{
putdcc $laura(idx)"PASS $laura(pass)"
putdcc $laura(idx)"SERVER $laura(link) 1 :$laura(info)"
putdcc $laura(idx)":$laura(link) NICK $laura(pseudo) 1 [unixtime] $laura(ident) $laura(host) $laura(link) :$laura(real)"
putdcc $laura(idx)":$laura(pseudo) MODE $laura(pseudo) $laura(mode)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(salon)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(accueil)"
control $laura(idx) event; utimer 30 verification
}}
#**************## Verification ##**************#if{![info exists laura(idx)]}{ connexion }proc verification {}{global laura
if{[valididx $laura(idx)]}{ utimer 30 verification }else{ connexion }}
#***********## Evenement ##***********#proc event {idx arg}{global laura
set arg [split$arg]if{[lindex$arg0]=="PING"}{ putdcc $idx"PONG [lindex $arg 1]"}}
#**********************## Xvoice pour anim ##**********************#
bind pub n "!xvoice" pub:xvoice
proc pub:xvoice { nick handle uhost chan text }{
putserv "MODE $chan +v $nick"
putquick "SAJOIN $nick #Staff"
puthelp "NOTICE $nick Bonne Moderation !"
puthelp "NOTICE $nick Pour savoir mais commandes de modération tape !modere"
putserv "NOTICE $nick Pence Bien a te devoice quand tu anim plus ! => !xdevoice Merci"}
#********************## Xdevoice pour anim ##********************#
bind pub n "!xdevoice" pub:xdevoice
proc pub:xdevoice { nick handle uhost chan text }{
putserv "MODE $chan -v $nick"
puthelp "NOTICE $nick Merci d'avoir animé $nick"}
#*************## Kick Pseudo ##*************#
bind pub n "!kick" pub:kick
proc pub:kick { nick handle uhost chan arg }{set nick [lindex$arg0]
putquick "KICK $chan $arg Merci de rester calme !"return1}
#************## Ban Pseudo ##************#
bind pub n "!kb" pub:kb
proc pub:kb { nick handle uhost chan arg }{set nick [lindex$uhost0]
putquick "MODE $chan +b $arg"
putquick "KICK $chan $arg Reste Cool !"}
#*************## Appel IRCop ##*************#
bind pub n "!appel" pub:appel
proc pub:appel { nick uhost handle chan arg }{
puthelp "PRIVMSG #Staff $nick Appel un IRCop sur $chan"
putserv "NOTICE $nick Les IRCops on ete appelé"}
#***********## Shun Nick ##***********#set ShunTime "3m";
bind pub !"!chut" pub:chut
proc pub:chut { nick uhost handle chan arg }{set nick [lindex$uhost0]
putquick "SHUN $arg $::ShunTime Ferme La Un Peux Tu SOul !!! :)"}
#***************## Help Commande ##***************#
bind pub X "!modere" pub:help
proc pub:help { nick uhost handle chan arg }{
putserv "NOTICE $nick Commande De Mderation !"
putserv "NOTICE $nick La commande !xvoice a utilisé que quand vous moderé sous peine de sanction!"
putserv "NOTICE $nick La Commande !xdevoice a faire quand vous avez fini de moderé !"
putserv "NOTICE $nick La commande !kick sert a kické un user du salon !"
putserv "NOTICE $nick La Commande !kb Sert a kick/ban un user du salon !"
putserv "NOTICE $nick La commande !appel sert a appelé les IRCop en cas de grosse perturbation sur le salon !"
putserv "NOTICE $nick La commande !chut sert a coupé la parole a un user pendant 3minute !"
putserv "NOTICE $nick Fin Des De Moderation !"}
#*********************## Services Moderation ##*********************#
#*************************## CONFIG BADWORD ##*************************#
# prevenir 1 fois avant kick pour les badword? 1/0set Mod(Warn)1
# si on previent kel est le message a envoyer?set Mod(WarnMsg)"4Attention! surveillez votre langage! La prochaine fois vous serez expulsé!"
# bannir pour badword? 1/0set Mod(Ban)1
# bannir combien de temps? (en minute)set Mod(BanTime)10
# kicker pour badword? 1/0set Mod(Kick)1
# kel raison pour le kick?set Mod(KickReason)"Exclu 10 minutes !"
#*************************## CONFIG REPEAT ##*************************#
# combien de repetion maxi?set Mod(RptMax)3
# raisons de kick random pour les repetionsset Mod(Reason){"pas besoin de répéter""on ne répète pas""tu nous dérange en répétant"}
# bannir pour repetition? 1/0set Mod(BanRep)1
# combien de temps? (en minute)set Mod(BanRepTime)10
#*************************## CONFIG CAPS ##*************************#
# Max de Caps ?set Mod(MaxCaps)10
# prevenir la personne en notice ? 1/0set Mod(CapsWarn)1
# quel message?set Mod(CapsWarnMsg)"4Attention! Merci de ne pas ecrire en MAJUSCULE"
# kicker les CAPS ? 1/0set Mod(KCaps)1
# quel raison pour le kick?set Mod(KCapsReason)"pas de MAJUSCULE"
#*************************## CONFIG LONG MOT ##*************************#
# kicker les longs mots? 1/0set Mod(MaxMot)1
# taille maxi d'un mot? 1/0set Mod(MaxMotSize)20
# raison du kick ?set Mod(MaxMotReason)"Flood"
#************************## A ne pas toucher merci ##************************#proc KReason {}{global Mod
return[lindex$Mod(Reason)[rand [llength$Mod(Reason)]]]}
#on set les listes au demarrage en lisant les fichiersset BWC ""foreach c [channels]{if{[file exists "Moderator.[string tolower $c].list"]}{set f [open Moderator.[string tolower $c].list r]set BWL([string tolower $c])"[string tolower [gets $f]]"close$flappend BWC [string tolower $c]}}
#proc pour checker si le channel est a surveillerproc ChkWbBwVar {cha}{global BWC
foreach c $BWC{if{$c == "$cha"}{return1;break}}return0}
#check les NOTICE PRIVMSG ACTION SOUND
bind raw - NOTICE PubChkNOT
proc PubChkNOT {from keyword arg}{set from [split$from!]
PubChk [lindex$from0][lindex$from1]*[lindex$arg0][lrange$arg1 end]}
bind ctcp - ACTION PubChkACTSND
bind ctcp - SOUND PubChkACTSND
proc PubChkACTSND {nick uhost hand dest keyword text}{if{[string match &*$dest] || [string match #*$dest]}{
PubChk $nick$uhost$hand$dest$text}}
bind pubm - * PubChk
proc PubChk {nick userhost handle channel text}{global BWN BWL BWC RPT Mod
# anti bad wordif{[ChkWbBwVar [string tolower $channel]]}{set hostban [lindex[split$userhost @]1]set templist [split[string tolower $text]"!&\"'(-_)=~\{\[|`\\^@\]\}\$%µ?,;:/§"]]foreach wdt $BWL([string tolower $channel]){if{[lsearch -exact "$templist"$wdt]!= -1}{if{$Mod(Warn)}{if{![info exists BWN([string tolower $userhost])]}{
putserv "NOTICE $nick :$Mod(WarnMsg)"set BWN([string tolower $userhost])[expr[clock seconds] + 1800]}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}}return1}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}return1}}}# anti repetitionsregsub -all {\\}$text{\\\\} text
regsub -all {\{}$text{\{} text
regsub -all {\}}$text{\}} text
regsub -all {\]}$text{\]} text
regsub -all {\[}$text{\[} text
regsub -all {\"} $text {\"} text
if {[info exists RPT($nick)]} {
if {[lrange $RPT($nick) 2 end] == "$text"} {
set cnt [lindex $RPT($nick) 1]; incr cnt
set RPT($nick) "[lindex$RPT($nick)0]$cnt[lrange$RPT($nick)2 end]"
if {[lindex $RPT($nick) 1] > $Mod(RptMax)} {
putserv "KICK $channel$nick :[KReason]"
if {$Mod(BanRep)} {newchanban $channel *!*@$hostban Moderator "Repeat" 10}
unset RPT($nick)
}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
# anti majuscule / longue chaine
set upper 0
set space 0
foreach i [split $text {}] {
if [string match \[A-Z\] $i] {incr upper}
if {$i == ""} {incr space}
}
if {$upper > $Mod(MaxCaps)} {
if {$Mod(CapsWarn)} {putserv "NOTICE $nick :$Mod(CapsWarnMsg)"}
if {$Mod(KCaps)} {putserv "KICK $channel$nick :$Mod(KCapsReason)"}
}
if {$space == 0 && [string length $text] > $Mod(MaxMotSize) && $Mod(MaxMot)} {
putserv "KICK $channel$nick :$Mod(MaxMotReason)"
}
}
}
proc UnsetRepeat {} {
global RPT
foreach nick [array names RPT] {
if {[lindex $RPT($nick) 0] < [clock seconds]} {unset RPT($nick)}
}
utimer 5 UnsetRepeat
}
foreach t [utimers] {
if {[lindex $t 1] == "UnsetRepeat"} {killutimer [lindex $t 2]}
}
UnsetRepeat
#toute les minute on check pour unseter les var des nick qui sont en avertissement
bind time - "*****" UnsetTmpVar
proc UnsetTmpVar {min hour day month year} {
global BWN RPT
foreach nt [array names BWN] {
if {$BWN($nt) < [clock seconds]} {unset BWN($nt)}
}
}
#procs pour ajouter, enlever, lister les mots a bannir
bind dcc o|o addword AddBadWord
proc AddBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".addword <mot>(ajoute un mot)"; return 0}
if {![info exists BWL($chan)]} {set BWL($chan) ""}
if {[lsearch -exact "x $BWL($chan)" "$word"] == -1} {
lappend BWL($chan) $word
set f [open Moderator.$chan.list w]
puts $f "$BWL($chan)"
close $f
putdcc $idx "$word ajouté."
return 1
} else {putdcc $idx "$word est deja dans la liste!(taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o delword DelBadWord
proc DelBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".delword <mot>(efface un mot)"; return 0}
if {[lsearch -exact "$BWL($chan)" "$word"] != -1} {
set f [open Moderator.$chan.list r]
gets $f tmpl
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$word"} {lappend newlist $t}
}
set f [open Moderator.$chan.list w]
puts $f "$newlist"
set BWL($chan) $newlist
close $f
putdcc $idx "$word éffacé."
return 1
} else {putdcc $idx "$word est pas dans la liste!(taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o listword ListBadWord
proc ListBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
putdcc $idx "Liste des Badwords: $BWL($chan)"
return 1
}
#procs pour ajouter enlever lister les chans a checker
bind dcc o|o +modchan AddChan
proc AddChan {hand idx args} {
global BWC BWL
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".+modchan <#channel>(ajoute un canal a surveiller)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] == -1} {
set f [open Moderator.$tchan.list w]
close $f
set BWL($tchan) ""
set f [open Moderator.chan w]
puts $f [lappend BWC $tchan]
close $f
putdcc $idx "$tchan ajouté."
return 1
} else {putdcc $idx "$tchan est deja dans la liste!(taper .modchan pour voir la liste)";return 0}
}
bind dcc o|o -modchan DelChan
proc DelChan {hand idx args} {
global BWC
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".-modchan <#channel>(efface un canal surveillé)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] != -1} {
set f [open Moderator.chan r]
set tmpl [gets $f]
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$tchan"} {lappend newlist $t}
}
set f [open Moderator.chan w]
puts $f "$newlist"
close $f
set BWC $newlist
putdcc $idx "$tchan éffacé."
return 1
} else {putdcc $idx "$tchan est pas dans la liste!(taper .modchan pour voir la liste)";return 0}
}
bind dcc - modchan ListChan
proc ListChan {hand idx args} {
global BWC
putdcc $idx "Liste des canaux: $BWC"
return 1
}
bind dcc - Moderator Moderator
proc Moderator {hand idx args} {
global Mod
putdcc $idx " Moderator "
putdcc $idx ""
putdcc $idx "ce script comprend un anti badword, un anti"
putdcc $idx "repetition, un anti caps et un anti long mot."
putdcc $idx "il agit sur les msgs/notices/actions/sounds"
putdcc $idx ""
putdcc $idx "commandes pour les Badword"
putdcc $idx "addword <mot>14(ajoute un mot)"
putdcc $idx "delword <mot>14(efface un mot)"
putdcc $idx "listword 14(liste les mots)"
putdcc $idx ""
putdcc $idx "commandes pour les canaux"
putdcc $idx "+modchan 14<#channel>(ajoute un canal a surveiller)"
putdcc $idx "-modchan 14<#channel>(efface un canal surveillé)"
putdcc $idx "modchan 14(liste les canaux)"
putdcc $idx ""
return 1
}
#*********#
# Fin #
#*********#
##################################### Aurel-Tchat Network ## Server irc://irc.aurel-tchat.fr## Site-Web http://aurel-tchat.fr ## Forum http://forum.aurel-tchat.fr#####################################
###################################################################################### Attention ! Si vous touchez le code, vous risquez de le faire planter ## Merci de ne pas toucher si vous n'avez aucune connaissance dans le domaine du TCL ######################################################################################
#********************## Configuration Link ##********************#set laura(link)"Laura.*******.fr"set laura(info)"Service Modération"set laura(host)"Laura.****.fr"set laura(ip)"IP"set laura(port)"PORT"set laura(pass)"12345678"set laura(pseudo)"Laura"set laura(real)"Laura Service Modération"set laura(ident)"Laura"set laura(salon)"#salon"set laura(accueil)"#salon"set laura(mode)"+oOSqsw"
#***********## Connexion ##***********#proc connexion {}{global laura
if{![catch"connect $laura(ip) $laura(port)" laura(idx)]}{
putdcc $laura(idx)"PASS $laura(pass)"
putdcc $laura(idx)"SERVER $laura(link) 1 :$laura(info)"
putdcc $laura(idx)":$laura(link) NICK $laura(pseudo) 1 [unixtime] $laura(ident) $laura(host) $laura(link) :$laura(real)"
putdcc $laura(idx)":$laura(pseudo) MODE $laura(pseudo) $laura(mode)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(salon)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(accueil)"
control $laura(idx) event; utimer 30 verification
}}
#**************## Vérification ##**************#if{![info exists laura(idx)]}{ connexion }proc verification {}{global laura
if{[valididx $laura(idx)]}{ utimer 30 verification }else{ connexion }}
#***********## Evènement ##***********#proc event {idx arg}{global laura
set arg [split$arg]if{[lindex$arg0]=="PING"}{ putdcc $idx"PONG [lindex $arg 1]"}}
#**********************## Xvoice pour animer ##**********************#
bind pub n "!xvoice" pub:xvoice
proc pub:xvoice { nick handle uhost chan text }{
putserv "MODE $chan +v $nick"
putquick "SAJOIN $nick #Staff"
puthelp "NOTICE $nick Bonne Modération !"
puthelp "NOTICE $nick Pour savoir mes commandes de modération, tape !modere"
putserv "NOTICE $nick Pense bien à te devoicer quand tu n'animes plus ! => !xdevoice Merci"}
#********************## Xdevoice pour animer ##********************#
bind pub n "!xdevoice" pub:xdevoice
proc pub:xdevoice { nick handle uhost chan text }{
putserv "MODE $chan -v $nick"
puthelp "NOTICE $nick Merci d'avoir animé $nick"}
#*************## Kick Pseudo ##*************#
bind pub n "!kick" pub:kick
proc pub:kick { nick handle uhost chan arg }{set nick [lindex$arg0]
putquick "KICK $chan $arg Merci de rester calme !"return1}
#************## Ban Pseudo ##************#
bind pub n "!kb" pub:kb
proc pub:kb { nick handle uhost chan arg }{set nick [lindex$uhost0]
putquick "MODE $chan +b $arg"
putquick "KICK $chan $arg Reste cool !"}
#*************## Appel IRCop ##*************#
bind pub n "!appel" pub:appel
proc pub:appel { nick uhost handle chan arg }{
puthelp "PRIVMSG #Staff $nick Appelle un IRCop sur $chan"
putserv "NOTICE $nick Les IRCops ont été appelé"}
#***********## Shun Nick ##***********#set ShunTime "3m";
bind pub !"!chut" pub:chut
proc pub:chut { nick uhost handle chan arg }{set nick [lindex$uhost0]
putquick "SHUN $arg $::ShunTime Ferme la un peu tu SaOulE !!! :)"}
#***************## Help Commande ##***************#
bind pub X "!modere" pub:help
proc pub:help { nick uhost handle chan arg }{
putserv "NOTICE $nick Commandes de modération !"
putserv "NOTICE $nick La commande !xvoice n'est à utiliser que quand vous modérez. (Sous peine de sanction!)"
putserv "NOTICE $nick La commande !xdevoice est à éxécuter quand vous avez fini de modérer !"
putserv "NOTICE $nick La commande !kick sert à 'kick' un user du salon !"
putserv "NOTICE $nick La Commande !kb sert à 'kick/ban' un user du salon !"
putserv "NOTICE $nick La commande !appel sert à appeler les IRCops en cas de grosse perturbation sur le salon !"
putserv "NOTICE $nick La commande !chut sert à couper la parole à un user pendant 3 minutes !"
putserv "NOTICE $nick Fin des commandes de modération."}
#*********************## Services Modération ##*********************#
#*************************## CONFIG BADWORD ##*************************#
# prévenir 1 fois avant kick pour les badword? 1/0set Mod(Warn)1
# si on prévient quel est le message à envoyer?set Mod(WarnMsg)"4Attention ! Surveillez votre langage ! La prochaine fois vous serez expulsé !"
# bannir pour badword? 1/0set Mod(Ban)1
# bannir pour combien de temps? (en minute)set Mod(BanTime)10
# kicker pour badword? 1/0set Mod(Kick)1
# quelle raison pour le kick?set Mod(KickReason)"Exclu 10 minutes !"
#*************************## CONFIG REPEAT ##*************************#
# combien de répétition maxi?set Mod(RptMax)3
# raisons de kick random pour les répétitionsset Mod(Reason){"Pas besoin de répéter""On ne répète pas""Tu nous déranges en répétant"}
# bannir pour répétition? 1/0set Mod(BanRep)1
# combien de temps? (en minute)set Mod(BanRepTime)10
#*************************## CONFIG CAPS ##*************************#
# Max de Caps ?set Mod(MaxCaps)10
# prévenir la personne en notice ? 1/0set Mod(CapsWarn)1
# quel message?set Mod(CapsWarnMsg)"4Attention! Merci de ne pas écrire en MAJUSCULES"
# kicker les CAPS ? 1/0set Mod(KCaps)1
# quel raison pour le kick?set Mod(KCapsReason)"Pas de MAJUSCULES"
#*************************## CONFIG LONG MOT ##*************************#
# kicker les longs mots? 1/0set Mod(MaxMot)1
# taille maxi d'un mot? 1/0set Mod(MaxMotSize)20
# raison du kick ?set Mod(MaxMotReason)"Flood"
#************************## A ne pas toucher merci ##************************#proc KReason {}{global Mod
return[lindex$Mod(Reason)[rand [llength$Mod(Reason)]]]}
#on set les listes au démarrage en lisant les fichiersset BWC ""foreach c [channels]{if{[file exists "Moderator.[string tolower $c].list"]}{set f [open Moderator.[string tolower $c].list r]set BWL([string tolower $c])"[string tolower [gets $f]]"close$flappend BWC [string tolower $c]}}
#proc pour checker si le channel est à surveillerproc ChkWbBwVar {cha}{global BWC
foreach c $BWC{if{$c == "$cha"}{return1;break}}return0}
#check les NOTICE PRIVMSG ACTION SOUND
bind raw - NOTICE PubChkNOT
proc PubChkNOT {from keyword arg}{set from [split$from!]
PubChk [lindex$from0][lindex$from1]*[lindex$arg0][lrange$arg1 end]}
bind ctcp - ACTION PubChkACTSND
bind ctcp - SOUND PubChkACTSND
proc PubChkACTSND {nick uhost hand dest keyword text}{if{[string match &*$dest] || [string match #*$dest]}{
PubChk $nick$uhost$hand$dest$text}}
bind pubm - * PubChk
proc PubChk {nick userhost handle channel text}{global BWN BWL BWC RPT Mod
# anti bad wordif{[ChkWbBwVar [string tolower $channel]]}{set hostban [lindex[split$userhost @]1]set templist [split[string tolower $text]"!&\"'(-_)=~\{\[|`\\^@\]\}\$%µ?,;:/§"]]foreach wdt $BWL([string tolower $channel]){if{[lsearch -exact "$templist"$wdt]!= -1}{if{$Mod(Warn)}{if{![info exists BWN([string tolower $userhost])]}{
putserv "NOTICE $nick :$Mod(WarnMsg)"set BWN([string tolower $userhost])[expr[clock seconds] + 1800]}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}}return1}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}return1}}}# anti repetitionsregsub -all {\\}$text{\\\\} text
regsub -all {\{}$text{\{} text
regsub -all {\}}$text{\}} text
regsub -all {\]}$text{\]} text
regsub -all {\[}$text{\[} text
regsub -all {\"} $text {\"} text
if {[info exists RPT($nick)]} {
if {[lrange $RPT($nick) 2 end] == "$text"} {
set cnt [lindex $RPT($nick) 1]; incr cnt
set RPT($nick) "[lindex$RPT($nick)0]$cnt[lrange$RPT($nick)2 end]"
if {[lindex $RPT($nick) 1] > $Mod(RptMax)} {
putserv "KICK $channel$nick :[KReason]"
if {$Mod(BanRep)} {newchanban $channel *!*@$hostban Moderator "Repeat" 10}
unset RPT($nick)
}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
# anti majuscule / longue chaine
set upper 0
set space 0
foreach i [split $text {}] {
if [string match \[A-Z\] $i] {incr upper}
if {$i == ""} {incr space}
}
if {$upper > $Mod(MaxCaps)} {
if {$Mod(CapsWarn)} {putserv "NOTICE $nick :$Mod(CapsWarnMsg)"}
if {$Mod(KCaps)} {putserv "KICK $channel$nick :$Mod(KCapsReason)"}
}
if {$space == 0 && [string length $text] > $Mod(MaxMotSize) && $Mod(MaxMot)} {
putserv "KICK $channel$nick :$Mod(MaxMotReason)"
}
}
}
proc UnsetRepeat {} {
global RPT
foreach nick [array names RPT] {
if {[lindex $RPT($nick) 0] < [clock seconds]} {unset RPT($nick)}
}
utimer 5 UnsetRepeat
}
foreach t [utimers] {
if {[lindex $t 1] == "UnsetRepeat"} {killutimer [lindex $t 2]}
}
UnsetRepeat
#toute les minutes on check pour unseter les var des nick qui sont en avertissement
bind time - "*****" UnsetTmpVar
proc UnsetTmpVar {min hour day month year} {
global BWN RPT
foreach nt [array names BWN] {
if {$BWN($nt) < [clock seconds]} {unset BWN($nt)}
}
}
#procs pour ajouter, enlever, lister les mots à bannir
bind dcc o|o addword AddBadWord
proc AddBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".addword <mot>(ajoute un mot)"; return 0}
if {![info exists BWL($chan)]} {set BWL($chan) ""}
if {[lsearch -exact "x $BWL($chan)" "$word"] == -1} {
lappend BWL($chan) $word
set f [open Moderator.$chan.list w]
puts $f "$BWL($chan)"
close $f
putdcc $idx "$word ajouté."
return 1
} else {putdcc $idx "$word est déjà dans la liste !(taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o delword DelBadWord
proc DelBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".delword <mot>(efface un mot)"; return 0}
if {[lsearch -exact "$BWL($chan)" "$word"] != -1} {
set f [open Moderator.$chan.list r]
gets $f tmpl
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$word"} {lappend newlist $t}
}
set f [open Moderator.$chan.list w]
puts $f "$newlist"
set BWL($chan) $newlist
close $f
putdcc $idx "$word éffacé."
return 1
} else {putdcc $idx "$word n'est pas dans la liste !(Taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o listword ListBadWord
proc ListBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Accès refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
putdcc $idx "Liste des Badwords: $BWL($chan)"
return 1
}
#procs pour ajouter enlever lister les chans à checker
bind dcc o|o +modchan AddChan
proc AddChan {hand idx args} {
global BWC BWL
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".+modchan <#channel>(ajoute un canal à surveiller)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] == -1} {
set f [open Moderator.$tchan.list w]
close $f
set BWL($tchan) ""
set f [open Moderator.chan w]
puts $f [lappend BWC $tchan]
close $f
putdcc $idx "$tchan ajouté."
return 1
} else {putdcc $idx "$tchan est déjà dans la liste !(Taper .modchan pour voir la liste)";return 0}
}
bind dcc o|o -modchan DelChan
proc DelChan {hand idx args} {
global BWC
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".-modchan <#channel>(efface un canal surveillé)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] != -1} {
set f [open Moderator.chan r]
set tmpl [gets $f]
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$tchan"} {lappend newlist $t}
}
set f [open Moderator.chan w]
puts $f "$newlist"
close $f
set BWC $newlist
putdcc $idx "$tchan éffacé."
return 1
} else {putdcc $idx "$tchan n'est pas dans la liste !(Taper .modchan pour voir la liste)";return 0}
}
bind dcc - modchan ListChan
proc ListChan {hand idx args} {
global BWC
putdcc $idx "Liste des canaux: $BWC"
return 1
}
bind dcc - Moderator Moderator
proc Moderator {hand idx args} {
global Mod
putdcc $idx " Moderator "
putdcc $idx ""
putdcc $idx "Ce script comprend un anti badword, un anti"
putdcc $idx "répétition, un anti caps et un anti long mot."
putdcc $idx "il agit sur les msgs/notices/actions/sounds"
putdcc $idx ""
putdcc $idx "Commandes pour les Badwords"
putdcc $idx "addword <mot>14(ajoute un mot)"
putdcc $idx "delword <mot>14(efface un mot)"
putdcc $idx "listword 14(liste les mots)"
putdcc $idx ""
putdcc $idx "Commandes pour les canaux"
putdcc $idx "+modchan 14<#channel>(ajoute un canal à surveiller)"
putdcc $idx "-modchan 14<#channel>(efface un canal surveillé)"
putdcc $idx "modchan 14(liste les canaux)"
putdcc $idx ""
return 1
}
#*********#
# Fin #
#*********#
---------------
Mit freundlichen Grüßen
Pia :)
RE: Petit TCL de gestion - aliasangelius - 20/03/2014
La proc event "à revoir elle et mal faites.."
Même erreur dans les putserv, et puthelp..
j'ai dit utilisé pushmodes serait le mieux pour se familliarisé..
Et un puthelp pour un message transmis ? putserv serait le mieux.
Putquick pour un kick pareil sa sert à rien.. autant mettre des putnow aussi.; faites des putkick ou pareeil un putserv suffit.
Et idem dans le message tu aura des soucis, et return o serais mieux.
Pour le ban, tu utilise $arg comme format de ban ? heu.. à quoi sa te sert de set nick alors ?
Et puis kick sur $arg utilité ?
Ne poster pas des codes avec les même erreurs, et avec d'autres avec..
La j'essaye de lui faire comprendre quelques trucs, donc arrêter de poster pour mettre des anneries.
Re-voyer plutôt vos codes TCL qui sont complètement pas bon.
Laisser BaGrift, Faire les modifications sa sera plus simple.
@BaGrift, j'attend ton post pour que l'ont puisse faire plusieurs modifications "ceci c'est pour que tu apprenne certaines choses qui je pense va te plaire"
Je viens de voir tes critique qui sont important a mais yeux lol tu c pourquoi je dis ca ^^ Bref.
voila j'ai modifié ce que tu ma demander ca donne ca :
Code :
tcl
##################################### Aurel-Tchat Network ## Server irc://irc.aurel-tchat.fr## Site-Web http://aurel-tchat.fr ## Forum http://forum.aurel-tchat.fr#####################################
###################################################################################### Attention Si vous toucher le code vous risquer de le faire planter ## Merci de pas toucher si vous avez aucune connaissance dans le domaine du TCL######################################################################################
#********************## Configuration Link ##********************#set laura(link)"Laura.*******.fr"set laura(info)"Service Moderation"set laura(host)"Laura.****.fr"set laura(ip)"IP"set laura(port)"PORT"set laura(pass)"12345678"set laura(pseudo)"Laura"set laura(real)"Laura Service Moderation"set laura(ident)"Laura"set laura(salon)"#salon"set laura(accueil)"#salon"set laura(mode)"+oOSqsw"
#***********## Connexion ##***********#proc connexion {}{global laura
if{![catch"connect $laura(ip) $laura(port)" laura(idx)]}{
putdcc $laura(idx)"PASS $laura(pass)"
putdcc $laura(idx)"SERVER $laura(link) 1 :$laura(info)"
putdcc $laura(idx)":$laura(link) NICK $laura(pseudo) 1 [unixtime] $laura(ident) $laura(host) $laura(link) :$laura(real)"
putdcc $laura(idx)":$laura(pseudo) MODE $laura(pseudo) $laura(mode)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(salon)"
putdcc $laura(idx)":$laura(pseudo) JOIN $laura(accueil)"
control $laura(idx) event; utimer 30 verification
}}
#**************## Verification ##**************#if{![info exists laura(idx)]}{ connexion }proc verification {}{global laura
if{[valididx $laura(idx)]}{ utimer 30 verification }else{ connexion }}
#***********## Evenement ##***********#proc event {idx arg}{global laura
set arg [split$arg]if{[lindex$arg0]=="PING"}{ putdcc $idx"PONG [lindex $arg 1]"}}
#**********************## Xvoice pour anim ##**********************#
bind pub n "!xvoice" pub:xvoice
proc pub:xvoice { nick handle uhost chan text }{
putserv "MODE $chan +v $nick"
putquick "SAJOIN $nick #Staff"
putserv "NOTICE $nick Bonne Moderation !"
putserv "NOTICE $nick Pour savoir mais commandes de modération tape !modere"
putserv "NOTICE $nick Pence Bien a te devoice quand tu anim plus ! => !xdevoice Merci"}
#********************## Xdevoice pour anim ##********************#
bind pub n "!xdevoice" pub:xdevoice
proc pub:xdevoice { nick handle uhost chan text }{
putserv "MODE $chan -v $nick"
putserv "NOTICE $nick Merci d'avoir animé $nick"}
#*************## Kick Pseudo ##*************#
bind pub n "!kick" pub:kick
proc pub:kick { nick handle uhost chan arg }{set nick [lindex$arg0]
putquick "KICK $chan $arg Merci de rester calme !"return1}
#************## Ban Pseudo ##************#
bind pub n "!kb" pub:kb
proc pub:kb { nick handle uhost chan arg }{set nick [lindex$uhost0]
putquick "MODE $chan +b $arg"
putquick "KICK $chan $arg Reste Cool !"}
#*************## Appel IRCop ##*************#
bind pub n "!appel" pub:appel
proc pub:appel { nick uhost handle chan arg }{
putserv "PRIVMSG #Staff : $nick Appel un IRCop sur $chan"
putserv "NOTICE $nick Les IRCops on ete appelé"}
#***********## Shun Nick ##***********#set ShunTime "3m";
bind pub n "!chut" pub:chut
proc pub:chut { nick uhost handle chan arg }{set nick [lindex$uhost0]
putquick "SHUN $arg $::ShunTime Ferme La Un Peux Tu SOul !!! :)"}
#***************## Help Commande ##***************#
bind pub n "!modere" pub:help
proc pub:help { nick uhost handle chan arg }{
puthelp "NOTICE $nick Commande De Mderation !"
puthelp "NOTICE $nick La commande !xvoice a utilisé que quand vous moderé sous peine de sanction!"
puthelp "NOTICE $nick La Commande !xdevoice a faire quand vous avez fini de moderé !"
puthelp "NOTICE $nick La commande !kick sert a kické un user du salon !"
puthelp "NOTICE $nick La Commande !kb Sert a kick/ban un user du salon !"
puthelp "NOTICE $nick La commande !appel sert a appelé les IRCop en cas de grosse perturbation sur le salon !"
puthelp "NOTICE $nick La commande !chut sert a coupé la parole a un user pendant 3minute !"
puthelp "NOTICE $nick Fin Des De Moderation !"}
#*********************## Services Moderation ##*********************#
#*************************## CONFIG BADWORD ##*************************#
# prevenir 1 fois avant kick pour les badword? 1/0set Mod(Warn)1
# si on previent kel est le message a envoyer?set Mod(WarnMsg)"\002\0030,4Attention! surveillez votre langage! La prochaine fois vous serez expulsé !"
# bannir pour badword? 1/0set Mod(Ban)1
# bannir combien de temps? (en minute)set Mod(BanTime)10
# kicker pour badword? 1/0set Mod(Kick)1
# kel raison pour le kick?set Mod(KickReason)"\002\00312,0Exclu 10 minutes !"
#*************************## CONFIG REPEAT ##*************************#
# combien de repetion maxi?set Mod(RptMax)3
# raisons de kick random pour les repetionsset Mod(Reason){"\002\0036pas besoin de répéter""\002\0030on ne répète pas""\002\0033tu nous dérange en répétant"}
# bannir pour repetition? 1/0set Mod(BanRep)1
# combien de temps? (en minute)set Mod(BanRepTime)10
#*************************## CONFIG CAPS ##*************************#
# Max de Caps ?set Mod(MaxCaps)10
# prevenir la personne en notice ? 1/0set Mod(CapsWarn)1
# quel message?set Mod(CapsWarnMsg)"\002\00313Attention! Merci de ne pas ecrire en MAJUSCULE"
# kicker les CAPS ? 1/0set Mod(KCaps)1
# quel raison pour le kick?set Mod(KCapsReason)"\002\0030,0pas de MAJUSCULE"
#*************************## CONFIG LONG MOT ##*************************#
# kicker les longs mots? 1/0set Mod(MaxMot)1
# taille maxi d'un mot? 1/0set Mod(MaxMotSize)20
# raison du kick ?set Mod(MaxMotReason)"\002\00312Flood"
#************************## A ne pas toucher merci ##************************#proc KReason {}{global Mod
return[lindex$Mod(Reason)[rand [llength$Mod(Reason)]]]}
#on set les listes au demarrage en lisant les fichiersset BWC ""foreach c [channels]{if{[file exists "Moderator.[string tolower $c].list"]}{set f [open Moderator.[string tolower $c].list r]set BWL([string tolower $c])"[string tolower [gets $f]]"close$flappend BWC [string tolower $c]}}
#proc pour checker si le channel est a surveillerproc ChkWbBwVar {cha}{global BWC
foreach c $BWC{if{$c == "$cha"}{return1;break}}return0}
#check les NOTICE PRIVMSG ACTION SOUND
bind raw - NOTICE PubChkNOT
proc PubChkNOT {from keyword arg}{set from [split$from!]
PubChk [lindex$from0][lindex$from1]*[lindex$arg0][lrange$arg1 end]}
bind ctcp - ACTION PubChkACTSND
bind ctcp - SOUND PubChkACTSND
proc PubChkACTSND {nick uhost hand dest keyword text}{if{[string match &*$dest] || [string match #*$dest]}{
PubChk $nick$uhost$hand$dest$text}}
bind pubm - * PubChk
proc PubChk {nick userhost handle channel text}{global BWN BWL BWC RPT Mod
# anti bad wordif{[ChkWbBwVar [string tolower $channel]]}{set hostban [lindex[split$userhost @]1]set templist [split[string tolower $text]"!&\"'(-_)=~\{\[|`\\^@\]\}\$%µ?,;:/§"]]foreach wdt $BWL([string tolower $channel]){if{[lsearch -exact "$templist"$wdt]!= -1}{if{$Mod(Warn)}{if{![info exists BWN([string tolower $userhost])]}{
putserv "NOTICE $nick :$Mod(WarnMsg)"set BWN([string tolower $userhost])[expr[clock seconds] + 1800]}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}}return1}else{if{$Mod(Ban)}{newchanban $channel*!*@$hostban Moderator "$Mod(KickReason)"$Mod(BanTime)}if{$Mod(Kick)}{putserv "KICK $channel $nick :$Mod(KickReason)"}return1}}}# anti repetitionsregsub -all {\\}$text{\\\\} text
regsub -all {\{}$text{\{} text
regsub -all {\}}$text{\}} text
regsub -all {\]}$text{\]} text
regsub -all {\[}$text{\[} text
regsub -all {\"} $text {\"} text
if {[info exists RPT($nick)]} {
if {[lrange $RPT($nick) 2 end] == "$text"} {
set cnt [lindex $RPT($nick) 1]; incr cnt
set RPT($nick) "[lindex$RPT($nick)0]$cnt[lrange$RPT($nick)2 end]"
if {[lindex $RPT($nick) 1] > $Mod(RptMax)} {
putserv "KICK $channel$nick :[KReason]"
if {$Mod(BanRep)} {newchanban $channel *!*@$hostban Moderator "Repeat" 10}
unset RPT($nick)
}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
} else {set RPT($nick) "[expr[clock seconds] + 10]1$text"}
# anti majuscule / longue chaine
set upper 0
set space 0
foreach i [split $text {}] {
if [string match \[A-Z\] $i] {incr upper}
if {$i == ""} {incr space}
}
if {$upper > $Mod(MaxCaps)} {
if {$Mod(CapsWarn)} {putserv "NOTICE $nick :$Mod(CapsWarnMsg)"}
if {$Mod(KCaps)} {putserv "KICK $channel$nick :$Mod(KCapsReason)"}
}
if {$space == 0 && [string length $text] > $Mod(MaxMotSize) && $Mod(MaxMot)} {
putserv "KICK $channel$nick :$Mod(MaxMotReason)"
}
}
}
proc UnsetRepeat {} {
global RPT
foreach nick [array names RPT] {
if {[lindex $RPT($nick) 0] < [clock seconds]} {unset RPT($nick)}
}
utimer 5 UnsetRepeat
}
foreach t [utimers] {
if {[lindex $t 1] == "UnsetRepeat"} {killutimer [lindex $t 2]}
}
UnsetRepeat
#toute les minute on check pour unseter les var des nick qui sont en avertissement
bind time - "*****" UnsetTmpVar
proc UnsetTmpVar {min hour day month year} {
global BWN RPT
foreach nt [array names BWN] {
if {$BWN($nt) < [clock seconds]} {unset BWN($nt)}
}
}
#procs pour ajouter, enlever, lister les mots a bannir
bind dcc o|o addword AddBadWord
proc AddBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".addword <mot>(ajoute un mot)"; return 0}
if {![info exists BWL($chan)]} {set BWL($chan) ""}
if {[lsearch -exact "x $BWL($chan)" "$word"] == -1} {
lappend BWL($chan) $word
set f [open Moderator.$chan.list w]
puts $f "$BWL($chan)"
close $f
putdcc $idx "$word ajouté."
return 1
} else {putdcc $idx "$word est deja dans la liste!(taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o delword DelBadWord
proc DelBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
set word [string tolower [lindex $args 0]]
if {$word == ""} {putdcc $idx ".delword <mot>(efface un mot)"; return 0}
if {[lsearch -exact "$BWL($chan)" "$word"] != -1} {
set f [open Moderator.$chan.list r]
gets $f tmpl
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$word"} {lappend newlist $t}
}
set f [open Moderator.$chan.list w]
puts $f "$newlist"
set BWL($chan) $newlist
close $f
putdcc $idx "$word éffacé."
return 1
} else {putdcc $idx "$word est pas dans la liste!(taper .listword pour voir la liste)"; return 0}
}
bind dcc o|o listword ListBadWord
proc ListBadWord {hand idx args} {
global BWL
set chan [string tolower [lindex [console $idx] 0]]
if {![validchan $chan]} {putdcc $idx "Console invalide ($chan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $chan]} {putdcc $idx "Acces refusé pour $chan"; return 0}
if {![info exists BWL($chan)]} {putdcc $idx "Aucun mot pour $chan"; return 0}
putdcc $idx "Liste des Badwords: $BWL($chan)"
return 1
}
#procs pour ajouter enlever lister les chans a checker
bind dcc o|o +modchan AddChan
proc AddChan {hand idx args} {
global BWC BWL
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".+modchan <#channel>(ajoute un canal a surveiller)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] == -1} {
set f [open Moderator.$tchan.list w]
close $f
set BWL($tchan) ""
set f [open Moderator.chan w]
puts $f [lappend BWC $tchan]
close $f
putdcc $idx "$tchan ajouté."
return 1
} else {putdcc $idx "$tchan est deja dans la liste!(taper .modchan pour voir la liste)";return 0}
}
bind dcc o|o -modchan DelChan
proc DelChan {hand idx args} {
global BWC
set tchan [string tolower [lindex $args 0]]
if {$tchan == ""} {putdcc $idx ".-modchan <#channel>(efface un canal surveillé)"; return 0}
if {![validchan $tchan]} {putdcc $idx "Channel invalide ($tchan)"; return 0}
if {![matchattr [idx2hand $idx] o|o $tchan]} {putdcc $idx "Acces refusé pour $tchan"; return 0}
if {[lsearch -exact "x $BWC" "$tchan"] != -1} {
set f [open Moderator.chan r]
set tmpl [gets $f]
close $f
set newlist ""
foreach t $tmpl {
if {$t != "$tchan"} {lappend newlist $t}
}
set f [open Moderator.chan w]
puts $f "$newlist"
close $f
set BWC $newlist
putdcc $idx "$tchan éffacé."
return 1
} else {putdcc $idx "$tchan est pas dans la liste!(taper .modchan pour voir la liste)";return 0}
}
bind dcc - modchan ListChan
proc ListChan {hand idx args} {
global BWC
putdcc $idx "Liste des canaux: $BWC"
return 1
}
bind dcc - Moderator Moderator
proc Moderator {hand idx args} {
global Mod
putdcc $idx " Moderator "
putdcc $idx ""
putdcc $idx "ce script comprend un anti badword, un anti"
putdcc $idx "repetition, un anti caps et un anti long mot."
putdcc $idx "il agit sur les msgs/notices/actions/sounds"
putdcc $idx ""
putdcc $idx "commandes pour les Badword"
putdcc $idx "addword <mot>14(ajoute un mot)"
putdcc $idx "delword <mot>14(efface un mot)"
putdcc $idx "listword 14(liste les mots)"
putdcc $idx ""
putdcc $idx "commandes pour les canaux"
putdcc $idx "+modchan 14<#channel>(ajoute un canal a surveiller)"
putdcc $idx "-modchan 14<#channel>(efface un canal surveillé)"
putdcc $idx "modchan 14(liste les canaux)"
putdcc $idx ""
return 1
}
#*********#
# Fin #
#*********#
RE: Petit TCL de gestion - aliasangelius - 20/03/2014
Salut,
Relis :p
Lorsque tu tape "!modere" Ton bot n'affiche rien non ?
si toute les commande fonctionne je les testé avant de le mètre ici
Regarde :)
tcl
|15:13:23| <TonyMontana>!modere
|15:13:24| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ Commande De Mderation !
|15:13:25| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La commande !xvoice a utilisé que quand vous moderé sous peine de sanction!
|15:13:26| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La Commande !xdevoice a faire quand vous avez fini de moderé !
|15:13:27| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La commande !kick sert a kické un user du salon !
|15:13:29| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La Commande !kb Sert a kick/ban un user du salon !
|15:13:31| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La commande !appel sert a appelé les IRCop en cas de grosse perturbation sur le salon !
|15:13:33| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ La commande !chut sert a coupé la parole a un user pendant 3minute !
|15:13:35| 15¤1 N3o1t3i1c3e 1d3e4 AurelBot 15¤ Fin Des De Moderation !
RE: Petit TCL de gestion - aliasangelius - 20/03/2014
o_O
Bisard, car normalement sa devrais pas.
Toi ta ça dans la proc :
tcl
bind pub n "!modere" pub:help
proc pub:help { nick uhost handle chan arg }{
puthelp "NOTICE $nick Commande De Mderation !"
puthelp "NOTICE $nick La commande !xvoice a utilisé que quand vous moderé sous peine de sanction!"
puthelp "NOTICE $nick La Commande !xdevoice a faire quand vous avez fini de moderé !"
puthelp "NOTICE $nick La commande !kick sert a kické un user du salon !"
puthelp "NOTICE $nick La Commande !kb Sert a kick/ban un user du salon !"
puthelp "NOTICE $nick La commande !appel sert a appelé les IRCop en cas de grosse perturbation sur le salon !"
puthelp "NOTICE $nick La commande !chut sert a coupé la parole a un user pendant 3minute !"
puthelp "NOTICE $nick Fin Des De Moderation !"}
Hors sa devrais être ainsis :
tcl
bind pub n "!modere" pub:help
proc pub:help { nick uhost handle chan arg }{
puthelp "NOTICE $nick :Commande De Mderation !"
puthelp "NOTICE $nick :La commande !xvoice a utilisé que quand vous moderé sous peine de sanction!"
puthelp "NOTICE $nick :La Commande !xdevoice a faire quand vous avez fini de moderé !"
puthelp "NOTICE $nick :La commande !kick sert a kické un user du salon !"
puthelp "NOTICE $nick :La Commande !kb Sert a kick/ban un user du salon !"
puthelp "NOTICE $nick :La commande !appel sert a appelé les IRCop en cas de grosse perturbation sur le salon !"
puthelp "NOTICE $nick :La commande !chut sert a coupé la parole a un user pendant 3minute !"
puthelp "NOTICE $nick :Fin Des De Moderation !"}
Bref, Maintenant en PL tape : .tcl pushmode
Puis : .tcl putkick
Sa te retourne quoi ?
"Désoler sa va faire long les post mais je veux que tu apprenne et c'est la meilleur solution."
RE: Petit TCL de gestion - aliasangelius - 20/03/2014
Et sur le salon ta eut une action que le bot à effectué non ?
EDIT : Montre moi ce que sa donner aussi sur le salon, pour voir ce que sa donne, même si je connais le résultat.
C'est pour tu comprenne étapes par étapes :)