egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with a lil script adding.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
ckin-
Voice


Joined: 09 Sep 2003
Posts: 12

PostPosted: Thu Sep 18, 2003 9:48 am    Post subject: Need help with a lil script adding. Reply with quote

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 Smile
TIA

Code:
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"
         }
     }
  }
 }
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber