ok i was searching and trying to compile me a little script, and i cant get it to work, but here is what i want, i want it to check a channel and if a certain word is said in that channel, i want the whole line that the word was in to be sent to another channel.. here is what i ended up with:
strikelight wrote:That would be because string match never returns -1...
oops lsearch returns -1... my fault.
to change use it for multiple words you should work with lists.
set words {"word1" "word2" "word3"}
and then:
foreach word $words {
if string match *$word* $text
}
this should give you the idea.
Useful script you got there! But is it possible to change the "mainchan" part so it instead checks all the channels the bot is in, and not just one channel? I'm kind of new to tcl, so i'm very thankful if somebody could tell me how to do this.
set relaychan "#relay"
set word "keywordhere"
bind pubm - "*" relay_pubm
proc relay_pubm {nick host handle channel text} {
if {[string match -nocase "*$::word*" $text] != -1} {
putserv "PRIVMSG $::relaychan :($channel) $nick: $text"
}
}
Heh... oy... again with the same bug as previously mentioned...
string match will NEVER EVER IN A MILLION YEARS return -1, thus making the comparison ALWAYS TRUE... heh....
Useful script you got there! But is it possible to change the "mainchan" part so it instead checks all the channels the bot is in, and not just one channel? I'm kind of new to tcl, so i'm very thankful if somebody could tell me how to do this.
Useful script you got there! But is it possible to change the "mainchan" part so it instead checks all the channels the bot is in, and not just one channel? I'm kind of new to tcl, so i'm very thankful if somebody could tell me how to do this.
Then maybe you should read an entire thread before replying.... Just a thought.
edit: naaah *donk* loaded this script for testing and now i just wondered why my scripts were producing one error after another...
/me slaps himself and goes to bed...
Thanks guys! But one more thing
Is it possible to "blacklist" one channel, so the bot does not check just that channel, but all the other channels the bot is in?