Communauté Eggdrop
[Résolu] Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : [Résolu] Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd (/showthread.php?tid=1647)



Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - Alucard`68 - 13/01/2017

Bonjour à tous,

Voila j'ai récupérer (je ne sais plus ou est la source par contre) un code de /plainte pseudo raison
J'ai juste modifier les messages et le salon sinon le code en lui même je n'ai pas toucher
Voici le code
TCL
########
#  Plainte  #
########
 
set log "#services"
 
bind pub - "!aide" pub:aide
bind join - "*" join:
 
proc pub:aide { nick uhost handle chan arg } {
  puthelp "NOTICE $nick :\0036Voici les commandes d'aide à la gestion des plaintes."
  puthelp "NOTICE $nick :\0034!ok \00312pour prendre en charge la plainte."
  puthelp "NOTICE $nick :\0034!rej \00312pour rejeter la plainte."
  puthelp "NOTICE $nick :\0034!abus \00312pour pour envoyer une avertissement d'abus au plaignant."
}
 
proc join: { nick uhost hand chan } {
  if {$chan == "#plaintes"} {
     putserv "PRIVMSG $nick \00312Bienvenue\0034 $nick ,\00312 pour l'aide a la gestion des plaintes tape \002\0034!aide \002\00312(uniquement sur le salon #Plaintes"
     return 0
  }
}
 
bind msg -|- plainte msg_plainte
proc msg_plainte {nick host 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 plainte($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 :\00312Rejet 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"
     }
  }
}
 
putlog "Plainte has been loaded"


l'allias du unrealircd (le unreal à bien été rehash)
Code :
###################
## Alias Plainte ##
###################

alias plainte {
   format "^[^#]" {
       target "Plainte";
       type "normal";
       parameters "%n plainte %0-";
   };
   type command;
};

Quand je tape la commande /plainte pseudo raison
celle-ci ne fonctionne pas
Je n'ai aucun message en pl (il as été rehash et restart et je n'ai que se tcl sur se bot)
voici le message que j'ai quand je fait la commande
Code :
[15:27:39] [RAW ]: plainte LokYnesS si sa marche pas c'est de ta faute :D
[15:27:39] [erreur] Plainte n'est plus connecté à irc.mon-serveur.fr
et j'ai aussi le message suivant qui lui apparais dans la fenêtre de connexion du script
Code :
[15:25:47] Traitement de la requête DCC CHAT venant de Plaintes [Services@Plaintes.mon-serveur.fr] (DCC CHAT chat 1578579718 6674)
Je suis sur que je doit pas être loin de toucher au but mais j'avoue que sans message d'erreur en pl je ne vois absolument pas d'ou vient le problème.

Bien à vous.

Bye.


RE: Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - CrazyCat - 13/01/2017

Ton eggdrop s'appelle Plaintes (au pluriel) et ton alias unreal a Plainte (au singulier) dans target.


RE: Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - Alucard`68 - 13/01/2017

Merci CrazyCat pour cette réponse j'ai donc fait la modification
Effectivement j'ai plus les même message qu'avant.
Par contre je reçois les plaintes en pl avec le bot et rien sur le salon.
Quand je tape la commande j'ai se message qui s'affiche sur la fenetre
Code :
[17:40:15] [RAW ]: plainte Bob tu sert a rien comme bot
Et en pl je reçois la plainte
Code :
[17:40:16] <Plaintes> [17:40:15] [AngeDesOmbres!Services@TechAdmin.EnjOy-TchaT.fr] AngeDesOmbres plainte Bob tu sert a rien comme bot
Se qui me laisse pensé que l'alias est fonctionnel mais que le tcl ne se déclanche pas...

Bien à toi.

Bye.


RE: Commande /plainte pseudo raison gérer par un eggdrop avec un alias Unrealircd - Alucard`68 - 01/02/2017

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.