I need a little help.. I hope someone will help me with that..
I trying to edit respond.tcl to make him to answer if the word not match but I dont have success yet.. so I need a help
there is the code...
Code: Select all
set mc_resp(somethin) { answer }
set mc_resp(something) { answer }
etc...
set mc_resp(what to put here?) { answer if all word not match }
set mc_re(chan) [string tolower $mc_re(chan)]
bind pubm - * mc:resp
proc mc:resp {nick uhost hand chan args} {
global mc_resp mc_re ; set args [string tolower [lindex $args 0]]
if {[lsearch -exact $mc_re(chan) [string tolower $chan]] == "-1"} {return 0}
foreach search [string tolower [array names mc_resp]] {
if {[string match $search $args]} {
if {[string match *\n* $mc_resp($search)]} {
foreach post [mc:resp:rep $mc_resp($search) $nick $uhost $hand $chan] {
puthelp "PRIVMSG $chan :$post"
} ; break
} {
puthelp "PRIVMSG $chan :[mc:resp:rep $mc_resp($search) $nick $uhost $hand $chan]"
}
}
}
}
proc mc:resp:rep {data nick uhost hand chan} {
global botnick
regsub -all -- %nick $data $nick data ; regsub -all -- %uhost $data $uhost data
regsub -all -- %botnick $data $botnick data
regsub -all -- %hand $data $hand data ; regsub -all -- %chan $data $chan data
regsub -all -- %b $data data ; regsub -all -- %r $data data
regsub -all -- %u $data data ; regsub -all -- %c $data data
return $data
}
P.S.: sorry for my bad english....