I got this script from a friend so that on a cmd in the chan the bot will pm the text in a txt file, as u can see in the script heh
Thing is I got the bot in more than one chan, so if I do the cmd in any chan it will pm the user who executes the cmd, but I only whant it to respond on that sertain command in just one specific chan.
Prob I have no clue how to add it in the script bellow so it will only respond to that command in lets say channel #blah and not in all the chans the bot is in.
I know I know, I should learn how to code tcl but I suck at any learning [censored], I´ve tried a few set chan cmds etc from looking at other scripts but no luck yet.
Appreciate if anyone could help me out
TIA
Code: Select all
bind pub -|- !txt show_txt
proc show_txt {nick uhost hand chan arg} {
global sections cmdpre dver
if {![file exist /usr/home/blah/eggdrop/scripts/txt]} {
putserv "NOTICE $nick : txtfiles is missing"
return 0
}
set htopic [lindex $arg 0]
if {$htopic == ""} {
set txtfile [open /usr/home/blah/eggdrop/scripts/txt r]
set txtdb [read $txtfile]
close $txtfile
foreach line [split $txtdb "\n"] {
if {$line != ""} {
putserv "PRIVMSG $nick :\00314$line"
}
}
}
}