Draknon wrote:
...
Code: Select all
on 1:TEXT:!cocoa:#:/describe # goes tho the TARDIS and mixes up a nice hot mug of cocoa with mini marshmallows and comes out and takes it to $nick and sits it on the table by $nick $+ .
...
I'm very rusty at mIRC scripting. But I think what that does, is creates a public command in a channel. Such that if nick types:
!cocoa
then the bot responds in the channel with some text.
If so, then what you need is a
bind pub
I suggest you bookmark this, and whenever you are playing with tcl for eggdrop, just keep it open in a tab for quick reference :
http://docs.eggheads.org/mainDocs/tcl-commands.html
Go there now, and text search and find:
bind pub
and read about that bind.
It is not complicated, but you'll need to get used to the way things are written in tcl-commands.doc (you also already have everything shown on that web page, in a file, under your bot's dir, in a sub-dir named doc/
and the filename is tcl-commands.doc . You can use whichever suits you, for reference. )
That's showing you how to compose a bind / proc matching pair.
Thus:
Code: Select all
bind pub - "!cocoa" foo
proc foo {nick uhost handle chan text} {
putserv "privmsg $chan :Whatever you want to have bot say to $nick goes here. "
}
I named the proc that is called by the bind - "foo".
You can name it whatever you wish, just so long as it is a unique name.
A bind pub (see tcl-commands.doc for every bind) passes 5 variables, in a pre-defined order, into the called proc. You can name the variables almost anything you want, and use them, within THIS proc.
I hope this helps.
I suggest that if you are trying to learn tcl basics like this, that you create a temporary channel, just for testing. Put your bot in it. That way, with only yourself and your bot there, you can hack away at it, filling that channel with garbage, without bothering anyone else, and without them bothering you.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !