Scripting
Bonjour / Bonsoir,

Bienvenue sur ce forum.

Merci, de vous connectez si vous ne l'êtes pas.

Merci, de vous enregistrez si vous ne l'êtes pas. Ceci prend même pas une minute.

Cordialement,

Dylan

Rejoignez le forum, c’est rapide et facile

Scripting
Bonjour / Bonsoir,

Bienvenue sur ce forum.

Merci, de vous connectez si vous ne l'êtes pas.

Merci, de vous enregistrez si vous ne l'êtes pas. Ceci prend même pas une minute.

Cordialement,

Dylan
Scripting
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le deal à ne pas rater :
Display 24 boosters Star Wars Unlimited – Crépuscule de la ...
Voir le deal

Modération

Aller en bas

Modération Empty Modération

Message  Dylan Mar 29 Déc - 4:59

Code:
#================================================================================#
# Information d'utilisation                      #
#================================================================================#
# Les Commandes actives via ce Tcl sont:                #
#                               #
# .moderation --> Aide à la configuration de la modération.          #
# .listemot\002   (liste les mots)"
# .effacermot <mot> efface un mot)"
# .ajoutermot <mot> (ajoute un mot)"                #
#                               #
# Commandes pour les canaux detection Pub                #
# .antipub listchan --> Liste des Channels Antipub             #
# .antipub <salon> off --> Efface un canal a surveiller             #
# .antipub <salon> on --> Ajoute un canal a surveiller             #
#                               #
# Commandes pour les canaux detection Flood, Majuscule, Mots Interdit & Limite    #
# .modchan --> Liste les canaux                      #
# .-modchan <salon> --> Efface un canal surveillé             #
# .+modchan <salon> --> Ajoute un canal a surveiller             #
#                               #
#================================================================================#

#================================================================================#
# Configuration.
#--------------------------------------------------------------------------------#
# Flag d'accé autoriser à configurer la Modération de l'Eggy.
set moderation(flag) "m|m"

# Flag d'Exception pour ke la Modération de l'Eggy n'agisse pas sur une catégorie d'accés.
set moderation(flagexept) "fo|fo"

#================================================================================#
# Configuration de la Limite salon (mode +l...).
#--------------------------------------------------------------------------------#
#Indiquer ici de combien la limite doit etre augmenté
set moderation(plus) 2

#================================================================================#
# Configuration Publicité.
#--------------------------------------------------------------------------------#
# Temps apres lequel l'avertissement est oublié et le compteur des pub remis a zéro,
# ce qui permets que si kkun fait de la pub UNE fois, se fait kicker pour warning,
# et n'en refait que 2h plus tard, de pas le bannir (il risquerais de pas trop capter aussi)
# par defaut le temps de remise a zero du compteur est de 30 minutes (1800 secondes)
set moderation(pubtime) 1800

# nombre de recidive entrainant le ban (si =3 la personne pourra faire 3 fois de la pub sans etre inquiete
# et sera banni a la 4 eme tentative... par defaut =1)
set moderation(nb_check) 1

# liste des pubs interdites sur le channel.
set moderation(pubnolist) {
  *.*.com
  *.*.fr
  *.*.net
  *.*.ru
  *.*.es
  *.*.ca
  *.*.org
  *.*.be
*.*@hotmail.com
*.*@hotmail.fr
*.*@msn.com
*.*@msn.fr
}

# liste des pubs autorisées sur le channel.
set moderation(puboklist) {
  *.wanadoo.*
  *.fusionet.*
}

# prevenir avec un avertissement pour chaque pub envoyé dans le salon? 1/0
set moderation(pubaverto) 1

# quel message?
set moderation(pubavertomsg) "4Attention! Evitez vos Publicités! La prochaine fois vous serez Expulsé!"

# kicker pour pub? 1/0
set moderation(pubkick) 1

# kel raison pour le kick?
set moderation(pubkickraison) {
   "Exclu pour pub !"
   "Si tu veux faire de la pub c'est pas l'endroit"
   "Le salon a une tete de panneau publicitaire ?!"
}

# bannir pour pub? 1/0
set moderation(pubban) 1

# bannir combien de temps? (en minute)
set moderation(pubbantime) 10

#================================================================================#
# Configuration Mots Interdits.
#--------------------------------------------------------------------------------#
# prevenir 1 fois avant kick pour les badword? 1/0
set moderation(badaverto) 1

# si on previent kel est le message a envoyer?
set moderation(badavertomsg) "4Attention! surveillez votre langage! La prochaine fois vous serez Expulsé!"

# bannir pour badword? 1/0
set moderation(badban) 1

# bannir combien de temps? (en minute)
set moderation(badbantime) 2

# kicker pour badword? 1/0
set moderation(badkick) 1

# kel raison pour le kick?
set moderation(badkickraison) {
   "Exclu 10 minutes !"
   "Pas de ca ici stp"
   "Aux chiottes la vulgarité !"
}

#================================================================================#
# Configuration Répititions.
#--------------------------------------------------------------------------------#
# combien de repetion maxi?
set moderation(repeatmax) 3

# raisons de kick random pour les repetions
set moderation(repeatkickraison) {
   "pas besoin de répéter"
   "on ne répète pas"
   "tu nous dérange en répétant"
}

# bannir pour repetition? 1/0
set moderation(repeatban) 1

# combien de temps? (en minute)
set moderation(repeatbantime) 2

#================================================================================#
# Configuration Majuscule.
#--------------------------------------------------------------------------------#
# Max de Caps ?
set moderation(majmax) 20

# prevenir la personne en notice ? 1/0
set moderation(majaverto) 1

# quel message?
set moderation(majavertomsg) "4Attention! Merci de ne pas ecrire en MAJUSCULE"

# kicker les CAPS ? 1/0
set moderation(majkick) 0

# quel raison pour le kick?
set moderation(majkickraison) {
   "Majuscule"
   "Pas la penne de crier on à compris!"
   "Stop Majuscule!!"
}

#================================================================================#
# Configuration Flood.
#--------------------------------------------------------------------------------#
# kicker les longs mots? 1/0
set moderation(motkick) 1

# taille maxi d'un mot? 1/0
set moderation(motmax) 200

# raison du kick ?
set moderation(motkickraison) {
   "Flood"
   "Evite le flood"
   "Pas de flood stp"
}

#================================================================================#
# Configuration Répitition mot en une phrase.
#--------------------------------------------------------------------------------#
# Nombre max de fois où un mot est répeté dans une seul et unique phrase.
set moderation(cptmotmax) 4

# kicker pour mot répété plusieur fois dans une seul et unique phrase? 1/0
set moderation(cptmotick) 2

# kel raison pour le kick?
set moderation(cptmotkickraison) "Exclu pour répétition en une seul phrase !"
set moderation(cptmotkickraison) {
   "Exclu pour répétition en une seul phrase !"
   "Evite de répéter $moderation(cptmotmax) fois le meme mot dans une seul phrase stp"
}

# bannir pour mot répété plusieur fois dans une seul et unique phrase? 1/0
set moderation(cptmotban) 0

# bannir combien de temps? (en minute)
set moderation(cptmotbantime) 10

#================================================================================#
# Bind.
#--------------------------------------------------------------------------------#
bind dcc $moderation(flag) moderation moderation
bind dcc $moderation(flag) antipub dcc_antipub
bind dcc $moderation(flag) modchan listchan
bind dcc $moderation(flag) -modchan effacerchan
bind dcc $moderation(flag) +modchan ajouterchan
bind dcc $moderation(flag) listemot listmot
bind dcc $moderation(flag) effacermot effacermot
bind dcc $moderation(flag) ajoutermot ajoutermot

bind time - "* * * * *" effacetemp

bind pubm - * chanpub
bind pubm - * pubcheck

bind ctcp - action pubcheckactionsound
bind ctcp - sound pubcheckactionsound

bind raw - notice pubchecknotice

#================================================================================#
# Processus.
#--------------------------------------------------------------------------------#
proc moderation {hand idx args} {
   global moderation
   putdcc $idx "      Commande Chan      "
   putdcc $idx ""
   putdcc $idx "ce script comprend un anti mots-interdit, un anti répétition mot"
   putdcc $idx "un anti repetition phrase, un anti caps, un anti pub 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 "\002.listemot\002   14(liste les mots)"
   putdcc $idx "\002.effacermot\002   <mot> 14(efface un mot)"
   putdcc $idx "\002.ajoutermot\002   <mot> 14(ajoute un mot)"
   putdcc $idx ""
   putdcc $idx "commandes pour les canaux detection Pub"
   putdcc $idx "\002.antipub\002   14listchan (liste des Channels Antipub)"
   putdcc $idx "\002.antipub\002   14<salon> off (efface un canal a surveiller)"
   putdcc $idx "\002.antipub\002   14<salon> on (ajoute un canal a surveiller)"
   putdcc $idx ""
   putdcc $idx "commandes pour les canaux detection Flood, Majuscule & Badword"
   putdcc $idx "\002.modchan\002   14(liste les canaux)"
   putdcc $idx "\002.-modchan\002   14<salon> (efface un canal surveillé)"
   putdcc $idx "\002.+modchan\002   14<salon> (ajoute un canal a surveiller)"
   putdcc $idx ""
   putdcc $idx "Gebulon 7- 14anthony.larmier@wanadoo.fr"
   putdcc $idx ""
   return 1
}

proc kickraison {} {
   global moderation
   return [lindex $moderation(repeatkickraison) [rand [llength $moderation(repeatkickraison)]]]
}

set bwc ""
foreach c [channels] {
   if {[file exists "moderation.[string tolower $c].list"]} {
      set f [open moderation.[string tolower $c].list r]
      set bwl([string tolower $c]) "[string tolower [gets $f]]"
      close $f
      lappend bwc [string tolower $c]
   }
}

proc checkchall {cha} {
   global bwc
   foreach c $bwc {
      if {$c == "$cha"} {return 1; break}
   }
   return 0
}

proc pubchecknotice {from keyword arg} {
   set from [split $from !]
   if {![validchan $from]} { return 0 }
   pubcheck [lindex $from 0] [lindex $from 1] * [lindex $arg 0] [lrange $arg 1 end]
}
proc pubcheckactionsound {nick userhost hand dest keyword text} {
   if {[string match &* $dest] || [string match #* $dest]} {
      pubcheck $nick $userhost $hand $dest $text
   }
}

proc pubcheck {nick userhost handle channel text} {
   global bwn bwl bwc rpt moderation
   if {[isop $nick $channel]} { return 0 }
   if {[matchattr $handle $moderation(flagexept) $channel]} { return 0 }
   if {[checkchall [string tolower $channel]]} {
      set hostban [lindex [split $userhost @] 1]
      if {[info exists cptmot]} {
         unset cptmot
      }
      foreach {w} $text {
         if {[info exists cptmot($w)]} {
            set cptmot($w) [expr $cptmot($w) + 1]
         }
         if {![info exists cptmot($w)]} {
            set cptmot($w) 1
         }
         if {$cptmot($w) > $moderation(cptmotmax)} {
            if {$moderation(cptmotban)=="1"} {newchanban $channel *!*@$hostban moderation "$moderation(cptmotkickraison)" $moderation(cptmotbantime)}
            if {$moderation(cptmotick)=="1"} {
               putserv "KICK $channel $nick :$moderation(cptmotkickraison)"
               return 0
            }
         }
      }
      set templist [join [split [string tolower $text] "!&\"'(-_)=~\{\[|`\\^@\]\}\$%µ?,;:/§"]]
      foreach wdt $bwl([string tolower $channel]) {
         if {[lsearch -exact "$templist" $wdt] != -1} {
            if {$moderation(badaverto)} {
               if {![info exists bwn([string tolower $userhost])]} {
                  putserv "NOTICE $nick :$moderation(badavertomsg)"
                  set bwn([string tolower $userhost]) [expr [clock seconds] + 1800]
               } else {
                  if {$moderation(badban)=="1"} {newchanban $channel *!*@$hostban moderation "$moderation(badkickraison)" $moderation(badbantime)}
                  if {$moderation(badkick)=="1"} {putserv "KICK $channel $nick :$moderation(badkickraison)"}
               }
               return 1
            } else {
               if {$moderation(badban)=="1"} {newchanban $channel *!*@$hostban moderation "$moderation(badkickraison)" $moderation(badbantime)}
               if {$moderation(badkick)=="1"} {putserv "KICK $channel $nick :$moderation(badkickraison)"}
               return 1
            }
         }
      }
      regsub -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] > $moderation(repeatmax)} {
               putserv "KICK $channel $nick :[kickraison]"
               if {$moderation(repeatban)=="1"} {newchanban $channel *!*@$hostban moderation "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"}
      set upper 0
      set space 0
      foreach i [split $text {}] {
         if [string match \[A-Z\] $i] {incr upper}
         if {$i == " "} {incr space}
      }
      if {$upper > $moderation(majmax)} {
          if {$moderation(majaverto)=="1"} {putserv "NOTICE $nick :$moderation(majavertomsg)"}
         if {$moderation(majkick)=="1"} {putserv "KICK $channel $nick :$moderation(majkickraison)"}
      }
      if {$space == 0 && [string length $text] > $moderation(motmax)} {
         if {$moderation(motkick)=="1"} {putserv "KICK $channel $nick :$moderation(motkickraison)"}
      }
   }
}

proc zerotime {} {
   global rpt
   foreach nick [array names rpt] {
      if {[lindex $rpt($nick) 0] < [clock seconds]} {unset rpt($nick)}
   }
   utimer 5 zerotime
}

foreach t [utimers] {
   if {[lindex $t 1] == "zerotime"} {killutimer [lindex $t 2]}
}
zerotime

proc effacetemp {min hour day month year} {
   global bwn rpt moderation
   foreach nt [array names bwn] {
      if {$bwn($nt) < [clock seconds]} {unset bwn($nt)}
   }
   set limite_actuelle 0
   foreach chan [channels] {
      if {[checkchall [string tolower $chan]]} {
         if {[string match *l* [lindex [getchanmode $chan] 0]]} {
            if {[string match *k* [lindex [getchanmode $chan] 0]]} {
               set limite_actuelle [lindex [getchanmode $chan] 2]
            } else {
               set limite_actuelle [lindex [getchanmode $chan] 1]
            }
         }
         if {![info exists moderation($chan,stop)]} {
            set moderation($chan,stop) 0
         }
         set moderation($chan,total) [llength [chanlist $chan]]
         if {![info exists moderation($chan,total,old)]} {
            set moderation($chan,total,old) $moderation($chan,total)
         }
         if {![info exists moderation($chan,danger)]} {
            set moderation($chan,danger) 1
         }
         if {$moderation($chan,total) == [expr $moderation($chan,total,old) + $moderation(plus)]} {
            if {![info exists moderation($chan,danger,moment)]} {
               set moderation($chan,danger,moment) "$hour:$min"
            }
            if {([lindex [split $moderation($chan,danger,moment) :] 0] == $hour) && ([expr [lindex [split $moderation($chan,danger,moment) :] 1] + 1] == $min)} {
               set moderation($chan,danger) [expr $moderation($chan,danger) + 1]
            }
            
         }
         if {$moderation($chan,danger) == 2} {
            set moderation($chan,stop) 4
            set moderation($chan,danger) 1
         } else {
            if {$moderation($chan,stop) > 0} {
               set moderation($chan,stop) [expr $moderation($chan,stop) - 1]
            } else {
               if {$moderation($chan,danger) < 2} {
                  if {$limite_actuelle != [expr $moderation($chan,total) + $moderation(plus)]} {
                     pushmode $chan +l [expr $moderation($chan,total) + $moderation(plus)]
                     set moderation($chan,total,old) $moderation($chan,total)
                  }
               }
            }
         }
      }
   }
}

proc ajoutermot {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 moderation.$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}
}

proc effacermot {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 moderation.$chan.list r]
      gets $f tmpl
      close $f
      set newlist ""
      foreach t $tmpl {
         if {$t != "$word"} {lappend newlist $t}
      }
      set f [open moderation.$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}
}

proc listmot {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
}

proc ajouterchan {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 moderation.$tchan.list w]
      close $f
      set bwl($tchan) ""

      set f [open moderation.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}
}

proc effacerchan {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 moderation.chan r]
      set tmpl [gets $f]
      close $f
      set newlist ""
      foreach t $tmpl {
         if {$t != "$tchan"} {lappend newlist $t}
      }
      set f [open moderation.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}
}

proc listchan {hand idx args} {
   global bwc
   putdcc $idx "Liste des canaux: $bwc"
   return 1
}

set dir ""
set pubfile "chans.pub"

proc dcc_antipub {hand idx arg} {
   global dir pubfile
   set cmd [lindex $arg 0]
   set cmd2 [lindex $arg 1]

   if {$cmd == "help" } {
      putdcc $idx " Cette commande permet d'activer l'antipub sur un chan."
      return 0
   }
   
   if {$cmd == "listchan"} {
      putcmdlog "#$hand# antipub listchan"
      putidx $idx "Liste des chans où l'antipub est actif:"
      if {[file exists ${dir}${pubfile}]} {
         set read [open ${dir}${pubfile} r]
         while {![eof $read]} {
            set data [string tolower [gets $read]]
            if {[eof $read]} {break}
            if {$data != ""} {
               putidx $idx "$data"
            }
         }
         close $read
      }
      return 0
   }

   if { $cmd == "" } {
      putdcc $idx "\002Usage:\002 .antipub #chan on/off ou .antipub listchan, tapez .antipub help pour obtenir de l'aide sur cette commande"
      return 0
   }

   if {![validchan $cmd]} {
      putdcc $idx "Je ne suis pas sur $cmd.\r"
      return 0
   }

   if {![matchattr $hand n|n $cmd]} {
      putdcc $idx "Cette commande n'est accessible qu'aux owners globaux ou sur $cmd."
      return 0
   }

   if {$cmd2 == "on"} {
      putcmdlog "#$hand# antipub $cmd on"
      if {[trouvchan $cmd $pubfile]} {
         putidx $idx "L'antipub est deja actif sur le chan $cmd !"
         return 0
      }
      set temp [addedchan $cmd $pubfile]
      putidx $idx "L'antipub est maintenant actif sur le chan $cmd !"
      return 0
   }

   if {$cmd2 == "off"} {
      putcmdlog "#$hand# antipub $cmd off"
      if {![file exists ${dir}${pubfile}]} {
         putidx $idx "Vous devez d'abord utiliser .antipub #chan on !"
         return 0
      }
      if {![trouvchan $cmd $pubfile]} {
         putidx $idx "L'antipub sur $cmd n'est pas actif !"
         return 0
      }
      set temp [rmchannel $cmd $pubfile]
      putidx $idx "L'antipub sur $cmd n'est plus actif."
      return 0
   }     
}

proc chanpub {nick userhost hand chan arg} {
   global okipub badpub check_recidive botnick pubfile moderation
   if {![trouvchan $chan $pubfile] || ![botisop $chan] } { return 0 }
   if {[isop $nick $chan]} { return 0 }
   if {[matchattr $hand $moderation(flagexept) $chan]} { return 0 }
   if {[string match *$chan* $arg]} { return 0 }
   set hostban [lindex [split $userhost @] 1]
   
   foreach okip $moderation(puboklist) {
      if {[string match *$okip* $arg]} {
         return 0
      }
   }
   foreach badp $moderation(pubnolist) {
      if {[string match *$badp* $arg]} {
         if {[info exists moderation($userhost)]} {
            if {$moderation($userhost)>=1} {
                  
               if {[unixtime]>[expr $moderation($userhost.TIME)+$moderation(pubtime)]} {
                  putserv "NOTICE $nick :4Attention! Evitez vos Publicités! La prochaine fois vous serez Expulsé!"   
                  set moderation($userhost) 1
                  set moderation($userhost.TIME) [unixtime]   
                  return 0
               }
               if {$moderation(pubban)=="1"} { newchanban $chan *!*@$hostban moderation "$moderation(pubkickraison)" $moderation(pubbantime) }
               if {$moderation(pubkick)=="1"} { putserv "KICK $chan $nick :$moderation(pubkickraison)" }
               unset moderation($userhost)
               unset moderation($userhost.TIME)
               return 0
               
            } else {
               if {$moderation(pubaverto)=="1"} {
                  putserv "NOTICE $nick : $moderation(pubavertomsg)"
               }
               incr moderation($userhost)
               set moderation($userhost.TIME) [unixtime]
               return 0   
            }
         } else {
            if {$moderation(pubaverto)=="1"} {
               putserv "NOTICE $nick : $moderation(pubavertomsg)"
            }
            set moderation($userhost) 1
            set moderation($userhost.TIME) [unixtime]
            return 0
         }
      }
   }
   return 0
}

proc addedchan {channel typefile} {
   global privfile dir pubfile
   set chan [string tolower $channel]
   if {![file exists ${dir}${typefile}]} {
      set create [open ${dir}${typefile} w]
      puts $create $chan
      close $create
      return 0
   }
   if {[file exists ${dir}${typefile}]} {
      set addfile [open ${dir}${typefile} a]
      puts $addfile $chan
      close $addfile
      return 0
   }
   return 0
}

proc trouvchan {channel typefile} {
   global privfile dir pubfile
   set chan [string tolower $channel]
   if {[file exists ${dir}${typefile}]} {
      set read [open ${dir}${typefile} r]
      while {![eof $read]} {
         set data [string tolower [gets $read]]
         if {[eof $read]} {break}
         if {$chan == $data && $data != ""} {
            close $read
            return 1
         }
      }
      close $read
   }
   return 0
}

proc rmchannel {channel typefile} {
   global privfile dir pubfile
   set chan [string tolower $channel]
   if {![file exists ${dir}${typefile}]} {
      return 0
   }
   if {[file exists ${dir}${typefile}]} {
      set read [open ${dir}${typefile} r]
      while {![eof $read]} {
         set data [string tolower [gets $read]]
         if {[eof $read]} {break}
         if {$chan != $data && $data !=""} {
            set addfile [open ${dir}${typefile}.new a]
            puts $addfile $data
            close $addfile
         }
      }
      close $read
      if {![file exists ${dir}${typefile}.new]} {
         set addfile [open ${dir}${typefile}.new a]
         puts $addfile ""
         close $addfile
      }
      set removefile [file delete -force ${dir}${typefile}]
      set copynew [file copy -force ${dir}${typefile}.new ${dir}${typefile}]
      set removeold [file delete -force ${dir}${typefile}.new]
   }
   return 0
}


bind msg - help msg:help
proc msg:help {nick uhost handle arg} {
global botnick
putserv "PRIVMSG $nick /MSG commands for $botnick :"
putserv "PRIVMSG $nick OP VOICE KICK INVITE INFO PASS"
putserv "PRIVMSG $nick Se oper : /msg $botnick op <PASS> <SALON>"
putserv "PRIVMSG $nick Se voicer : /msg $botnick voice <PASS> <SALON>"
putserv "PRIVMSG $nick S'inviter : /msg $botnick invite <PASS> <SALON>"
putserv "PRIVMSG $nick Kicker quelqu'un : /msg $botnick kick <SALON> <PSEUDO> <RAISON>"
putserv "PRIVMSG $nick Mettre une info : /msg $botnick info #soho <INFOLINE>"
putserv "PRIVMSG $nick Changer son password : /msg $botnick PASS <PASSWORD> <NEW_PASSWORD>"
}
bind msg - kick msg:kick
proc msg:kick {nick uhost chan arg} {
set chan [lindex $arg 0]
if [isop $nick $chan] {
putserv "kick [lindex $arg 0] [lindex $arg 1] :[lrange $arg 2 end]"
}
}
bind dcc m xkill xkill:dcc
proc xkill:dcc {nick idx arg} {
  putserv "KILL [lindex $arg 0] :[lrange $arg 1 end]"
}
bind dcc m xmode xmode:dcc
proc xmode:dcc {hand idx arg} {
  putspeed "MODE [lindex $arg 0] [lrange $arg 1 end]"
}
Dylan
Dylan
Administrateur

Messages : 221
Date d'inscription : 23/11/2009
Age : 29
Localisation : Chez moi ...

https://scripting.forumactif.com

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum