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.

easy tcl:)

Old posts that have not been replied to for several years.
Locked
r
roller
Voice
Posts: 11
Joined: Fri Apr 23, 2004 5:55 pm

easy tcl:)

Post by roller »

i think its easy for you..:) when i type !xy then the bot says yx to #chan1 and #chan2 rooms. Thnx!
r
roller
Voice
Posts: 11
Joined: Fri Apr 23, 2004 5:55 pm

Post by roller »

oh, ive got 1 more request, sorry:)

--
!xy then the bot random choose a line from msg.txt and say it to the chan
--

thnx;)
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

next time look true the forum first

Code: Select all

bind pub - !xy xy:pub

proc xy:pub {nick host hand chan arg} {
  set rfile [open filename.txt r]
  while {![eof $rfile]} {
    gets $rfile line
    putserv "PRIVMSG $nick :$line"
  }
  close $rfile
}
this wil read every file and output it to the channel
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

and i think thats ur second request

Code: Select all

bind pub - !xy xy:pub 

proc xy:pub {nick host hand chan arg} { 
  set rfile [open filename.txt r]
  set randline [rand 5]; # [rand <totallines number>] change it 
  while {![eof $rfile]} {
    gets $rfile line 
    if {[info exists i]} {
      incr i
      if {$i == $randline} {
        putserv "PRIVMSG $nick :$line" 
      }
    } else {
      set i 0
      if {$i == $randline} {
        putserv "PRIVMSG $nick :$line" 
      }
    }
  } 
  close $rfile 
}
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

or you can use switch and set the like the contents in ur tcl like 8bal game or something ..
XplaiN but think of me as stupid
Locked