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.

refer a channel in tcl script

Old posts that have not been replied to for several years.
Locked
User avatar
stere0
Halfop
Posts: 47
Joined: Sun Sep 23, 2001 8:00 pm
Location: Brazil

Post by stere0 »

Can i refer a channel in a tcl script without put your name? Like assuming the name set in the .conf file?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Sure, it will be a variable just like any other. If you call the variable "the_channel", then in the config file put:

set the_channel #sheep

And in your script, do this:
proc someproc {} {
global the_channel

putserv "PRIVMSG $the_channel :sheep rule!"
}
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

Not exactly sure if this is what you want, but the 'channels' command returns the list of channels the bot has defined. To do something on each of these channels you would use something like

Code: Select all

foreach chan [channels] {
  puthelp "PRIVMSG $chan :Hello there!"
}
<font size=-1>[ This Message was edited by: slennox on 2001-09-25 17:10 ]</font>
Locked