Got problem when echoing a bot on the same server on another channel.
I can succesfully load the tcl when starting eggdrop, but when the on the moment that the bot says something , that supposed to be echoied in mychannel, I get the following error in the partyline & the text isn't echoied.
Tcl error [gotechoTN]: missing close-bracket
I have already searched to fix it but didn't found it yet, maybe someone can help me out ?
<-totalNFO 1.0 by GoMp->
#<http://www.g0mp.org/>
#-
#This is a script that will make your bot join the NFOrce-channel
#and echo everything the bot nforce says to a specified chan,
#meaning all the latest releases will be displayed to your chan...
#Note: Only tested on EFnet
#-
#Variable defining
set tnchan "#mychannel"; #the channels the bot will echo to
#<- end ->
set tnvers "1.0"
set tnnick "NFOrce"
proc tnlog {msg} { putlog "\002.:totalNFO:.\002 $msg" }
proc gotechoTN {nick uhost hand chan arg} {
global tnchan tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
foreach msg [split $tnchan { puthelp "PRIVMSG $tnchan :$arg" }
tnlog "$arg"
}
}
proc offechoTN {nick uhost hand chan arg} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has quit IRC..."
}
}
proc onechoTN {nick uhost hand chan} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has joined #NFOrce again. Logging re-started..."
}
}
proc nickchoTN {nick uhost hand chan newnick} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has changed nick from $nick to ${newnick}: echoing will only work on someone with nick 'NFOrce'..."
}
}
bind pubm - * gotechoTN
bind sign - * offechoTN
bind join - * onechoTN
bind nick - * nickchoTN
set tnmatch 0
set tnchans [channels]
foreach tnchan $tnchans { if {[string tolower [join $tnchan]] == "#nforce"} { set tnmatch 1 }}
if {!$tnmatch} {
tnlog "#nforce was not found in the channel list: adding #nforce to the channel list..."
channel add "#nforce"
}
putlog "\002:-: totalNFO v${tnvers}\002 by GoMp < http://www.g0mp.org/gomp/ > loaded... \002:-:\002"
#<-totalNFO 1.0 by GoMp->
#<http://www.g0mp.org/>
#-
#This is a script that will make your bot join the NFOrce-channel
#and echo everything the bot nforce says to a specified chan,
#meaning all the latest releases will be displayed to your chan...
#Note: Only tested on EFnet
#-
#Variable defining
set tnchan "#chan1 #chan2"
#the channels the bot will echo to
#<- end ->
set tnvers "1.0"
set tnnick "SOURCENICK"
proc tnlog {msg} { putlog "\002.:totalNFO:.\002 $msg" }
proc gotechoTN {nick uhost hand chan arg} {
global tnchan tnnick
if {([string match -nocase $tnnick $nick]) && ([string match -nocase #nforce $chan])} {
foreach tarchan [split $tnchan] {puthelp "PRIVMSG $tarchan :$arg"}
tnlog "$arg" }
}
proc offechoTN {nick uhost hand chan arg} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has quit IRC..."
}
}
proc onechoTN {nick uhost hand chan} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has joined #NFOrce again. Logging re-started..."
}
}
proc nickchoTN {nick uhost hand chan newnick} {
global tnnick
if {[string tolower $nick] == [string tolower $tnnick]} {
tnlog "the NFOrce bot has changed nick from $nick to ${newnick}: echoing will only work on someone with nick 'NFOrce'.
}
}
bind pubm - * gotechoTN
bind sign - * offechoTN
bind join - * onechoTN
bind nick - * nickchoTN
putlog "\002:-: totalNFO v${tnvers}\002 by GoMp < http://www.g0mp.org/gomp/ > loaded... \002:-:\002"
Please, please, look at what I changed so you will know how to avoid the problems that I addressed for the future. I had to take out the channel check at the end, because the bot does not load the channels until after the config, thus why it could never find the channel #nforce upon startup. Maybe someone else can chime in and offer more pointers here.
Known issues:
No channel check.
When the "tnnick" bot changes nicks, it echos the nick change message about ten times to the partyline.
I didn't have time to test it further, but at least now it works. Excuse the sloppy code too, I had to wrap this up and yank all my debugs in a hurry.
No problem. To filter things out, consider using string match to check for the content you want or do not want to echo.. If you have any problems with code that you write for this, drop me a PM or a post in this thread and I'll help you out with it.