This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Need help with a lil script adding.

Old posts that have not been replied to for several years.
Locked
c
ckin-
Voice
Posts: 12
Joined: Tue Sep 09, 2003 8:08 am

Need help with a lil script adding.

Post by ckin- »

Hi, n00b d00d in the house :p
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"
         }
     }
  }
 }
Locked