it's the faq.tcl i just changed all the rest with putnotc $nick so people can't flood the chan and it goes specifically to the nic it's ment for
Code: Select all
proc faq:tell_fact {nick idx handle channel args} {
global faq
if { [lsearch -exact [split [string tolower $faq(channels)]] [string tolower $channel]] < 0 } {
return 0
}
if {$faq(status)==1} {
putnotc $nick "The faq-database is \002closed\002."
return 0
}
if {![file exist $faq(database)]} {
set database [open $faq(database) w]
puts -nonewline $database ""
close $database
}
set tellnick [ lindex [split [join $args]] 0 ]
set fact [ string trim [ string tolower [ join [ lrange [split [join $args]] 1 end ] ] ] ]
if {$tellnick == ""} {
putnotc $nick "Syntax: [string trim $faq(cmdchar)]faq \002nick\002 keyword"
return 0
}
if {$fact == ""} {
putnotc $nick "Syntax: [string trim $faq(cmdchar)]faq nick \002keyword\002"
return 0
}
set database [open $faq(database) r]
set dbline ""
while {![eof $database]} {
gets $database dbline
set dbfact [ string tolower [ lindex [split $dbline [string trim $faq(splitchar)]] 0 ] ]
set dbdefinition [string range $dbline [expr [string length $fact]+1] end]
if {$dbfact==$fact} {
if {[string match -nocase "*$faq(newline)*" $dbdefinition]} {
set out1 [lindex [split $dbdefinition "$faq(newline)"] 0]
set out2 [string range $dbdefinition [expr [string length $out1]+2] end]
putmsg $channel "\002$tellnick\002: ($dbfact) $out1"
putmsg $channel "\002$tellnick\002: ($dbfact) $out2"
} else {
putmsg $channel "\002$tellnick\002: ($dbfact) $dbdefinition"
}
putlog "FAQ: Send keyword \"\002$fact\002\" to $tellnick by $nick ($idx)"
close $database
return 0
}
}
close $database
putnotc $nick "I don't have the keyword \002$fact\002 in my database."
if {[matchattr $handle [string trim $faq(glob_flag)]|[string trim $faq(chan_flag)] $channel]} {
putnotc $nick "You could add \002$fact\002 by using [string trim $faq(cmdchar)]addword \002$fact\002[string trim $faq(splitchar)]Definition goes here."
} else {
putnotc $nick "If you're looking for a TCL-Script try http://www.egghelp.org/cgi-bin/tcl_archive.tcl?strings=$fact"
}
return 0
}