[Demande] bind pubm SQL
#17
Vous avez pourtant tous les éléments...

Dans la procédure d'initialisation du script:
tcl
mysqlsel $::mysqlink "SELECT mot, salon FROM box"
::mysql::map $::mysqlink { mot salon } {
   lappend ::badwords([string tolower $salon]) $mot
}



Et le script "actif":
tcl
bind pubm - * verifmot
proc verifmot {nick uhost handle chan text} {
   set chan [string tolower $chan]
   set words [split [string tolower $text]]
   set matches [lintersect $words $::badwords($chan)]
   if {[llength $matches]>0 } {
      putserv "PRIVMSG $chan :Badword(s) detected: [join $matches]"
   }
   return 0
}
 
proc lintersect {list1 list2} {
   foreach element $list1 {
      if { ($element in $list2) } { lappend intersect $element }
   }
   return $intersect
}


Répondre


Messages dans ce sujet
bind pubm SQL - par aliasangelius - 30/03/2017, 12:03
RE: bind pubm SQL - par CrazyCat - 30/03/2017, 12:55
RE: bind pubm SQL - par aliasangelius - 30/03/2017, 13:27
RE: bind pubm SQL - par CrazyCat - 30/03/2017, 13:36
RE: bind pubm SQL - par aliasangelius - 30/03/2017, 13:41
RE: bind pubm SQL - par CrazyCat - 30/03/2017, 14:01
RE: bind pubm SQL - par aliasangelius - 30/03/2017, 14:12
RE: bind pubm SQL - par CrazyCat - 31/03/2017, 08:54
RE: bind pubm SQL - par aliasangelius - 31/03/2017, 09:59
RE: bind pubm SQL - par Strategy - 31/03/2017, 15:28
RE: bind pubm SQL - par DiXiT - 01/04/2017, 17:28
RE: bind pubm SQL - par Strategy - 01/04/2017, 19:26
RE: bind pubm SQL - par DiXiT - 01/04/2017, 21:00
RE: bind pubm SQL - par Strategy - 01/04/2017, 22:54
RE: bind pubm SQL - par CrazyCat - 01/04/2017, 23:32
RE: bind pubm SQL - par DiXiT - 01/04/2017, 23:52
RE: bind pubm SQL - par CrazyCat - 02/04/2017, 00:14
RE: bind pubm SQL - par DiXiT - 02/04/2017, 00:55

Atteindre :


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