Code: Select all
foreach row [sql "SELECT crapword FROM crapwords"] {
incr wordcount 1
append wordlist [lindex $row 0] " "
}
putquick "PRIVMSG $chan :Total Crapwords: $wordcount"
putquick "PRIVMSG $chan : $wordlist "
Code: Select all
foreach row [sql "SELECT crapword FROM crapwords"] {
incr wordcount 1
append wordlist [lindex $row 0] " "
}
putquick "PRIVMSG $chan :Total Crapwords: $wordcount"
putquick "PRIVMSG $chan : $wordlist "
Code: Select all
proc cutlen {str len} {
if {$str == ""} {return $str}
set strlist ""
while {[string length $str] > $len} {
set line ""
foreach word $str {
set line [lappend line $word]
if {[string length $line] >= $len} {
set strlist [lappend strlist $line]
set strpos [expr [string length $line] + 1]
set str [string range $str $strpos end]
break
}
}
}
set strlist [lappend strlist $str]
}
Code: Select all
set cutlines [cutlen $var 75]
foreach cutline $cutlines {
putserv "PRIVMSG ......"
}
Code: Select all
............
foreach row [sql "SELECT crapword FROM crapwords"] {
incr wordcount 1
append wordlist [lindex $row 0] " "
}
putquick "PRIVMSG $chan : Total CrapFilter words: $wordcount"
putlog " Count $wordcount "
set string $wordlist
set cutlines [cutlen $string 75]
foreach cutline $cutlines {
putserv "PRIVMSG $chan :$cutlines "
}
}
}
proc cutlen {str len} {
if {$str == ""} {return $str}
set strlist ""
while {[string length $str] > $len} {
set line ""
foreach word $str {
set line [lappend line $word]
if {[string length $line] >= $len} {
set strlist [lappend strlist $line]
set strpos [expr [string length $line] + 1]
set str [string range $str $strpos end]
break
}
}
}
set strlist [lappend strlist $str]
}
and with 4<gb> .t set cs [cutlen "aaa bb cc d" 2]; foreach c $cs { putlog $c }
<ufo> aaa
<ufo> bb
<ufo> cc
<ufo> d
...<gb> .t set cs [cutlen "aaa bb cc d" 4]; foreach c $cs { putlog $c }
<ufo> [21:31] aaa bb
<ufo> [21:31] cc d
set cutlines [cutlen [split $list] 75]
foreach cutline $cutlines {
putserv "PRIVMSG ......"
}