[Résolu] Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd
#4
alors voila j'ai repensé le code et celui-ci est fonctionnel
tcl
set log "#services"
 
bind msg -|- plainte msg_plainte
proc msg_plainte {nick uhost hand arg} {
  global boulet plaignant plainte
  set plaignant "$nick"
  set boulet [lindex $arg 0]
  set boulraison [lrange $arg 1 end]
  if {[info exists plainte]} {
    foreach pla [array names plainte] {
      if {[expr {$plainte($pla)+(5*60)}] < [unixtime]} {
        unset plainte($pla)
        }
    }
}
 
foreach plai [array names plainte] {
  if {[string match -nocase $plai $host]} {
    putfast "NOTICE $nick :\00312Vous venez déjà de faire une plainte ! Merci de ne pas abuser du système."
    return 0
  }
}
 
if {$boulet=="" || $boulraison==""} {
  putfast "NOTICE $nick :\00312Vous devez spécifier sur qui vous faites une plainte et la raison : \0034/plainte pseudo raison"
  return 0
}
 
set plaintes($host) [expr {[unixtime]}]
  putfast "NOTICE $nick :\00312Votre plainte a été envoyé au service modération !"
  putfast "PRIVMSG #plaintes :\0036Plainte\00312 de\0037 $nick \00312contre\0034 $boulet \00312pour la raison :\0036 $boulraison"
  putfast "PRIVMSG $::log :\0036Plainte\00312 de \0037$nick \00312contre \0034$boulet"
    bind pub -|- !ok pub_ok
    bind pub -|- !repond pub_rep
    bind pub -|- !rep pub_rep
    bind pub -|- !reponds pub_rep
    bind pub -|- !rejet pub_rej
    bind pub -|- !rej pub_rej
    bind pub -|- !abus pub_abus
}
 
proc pub_ok {nick host hand chan arg} {
  global plaignant
  if {[info exists plaignant]} {
    if {[string tolower $chan] == "#plaintes"} {
      putfast "NOTICE $plaignant :\00312Plainte prise en compte par \0034$nick"
      putfast "PRIVMSG #plaintes :\00312Confirmation envoyé à \0037$plaignant"
      putfast "PRIVMSG $::log :\0036Plainte :\00312 Acceptée par \0034$nick"
      }
   }
}
 
proc pub_rep {nick host hand chan arg} {
  global plaignant
  set reponse [lrange $arg 0 end]
  if {[info exists plaignant]} {
    if {[string tolower $chan] == "#plaintes"} {
      putfast "NOTICE $plaignant :\00312Plainte prise en compte par \0034$nick"
      putfast "PRIVMSG #plaintes :\00312Confirmation envoyé à \0037$plaignant"
      putfast "PRIVMSG $::log :\0036Plainte :\00312 Acceptée par \0034$nick"
      }
   }
}
 
proc pub_rej {nick host hand chan arg} {
  global plaignant
  set reponse [lrange $arg 0 end]
  if {[info exists plaignant]} {	
    if {[string tolower $chan] == "#plaintes"} {
      if {$reponse==""} {
        set reponse "No précision"
    }
    putfast "NOTICE $plaignant :\00312Plainte rejeté par \0034$nick \0036(Raison : $reponse)"
    putfast "NOTICE $nick :Rejet envoyé à $plaignant"
    putfast "PRIVMSG #plaintes :\00312Plainte rejeté par \0034$nick"
    putfast "PRIVMSG $::log :\0036Plainte :\00312 Rejet par\0034$nick"
    }
  }
}
 
proc pub_abus {nick host hand chan arg} {
  global plaignant
  if {[info exists plaignant]} {
    if {[string tolower $chan] == "#plaintes"} {
      putfast "NOTICE $plaignant :\00312Eviter d'abuser du systeme de plainte sans raison, sous peine de sanction"
      putfast "PRIVMSG #plaintes :\00312Rejet/Abus envoyé à \0037$plaignant"
      }
   }
}



Encore merci pour ton aide.

Bye.
Répondre Avertir


Messages dans ce sujet
RE: Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - par Alucard`68 - 01/02/2017, 03:39

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté