After several months delay, I find myself up against a wall and having to learn IRCD's, Eggbot in general and TCL so I can have custom actions done for a company I work for.
With all that, I have gotten to the point of writing my first TCL for Egg and it works well. Now I want to add on to the tcl I have now.
It consists of one bind (!URG) and a procedure to process that bind and do something with the text (send PRVMSG to all in channel). Simple, yet effective for what I need. Now what I want to do is to take the text of that message and write it out to a file, formated in HTML.
I feel I can do that, but in the interests of being modular, I would like to write it in another tcl file or procedure and call it from the urgmsg proc I created.
So to sum it up. When the urgmsg proc is fired by the bind !URG, I want to take the text that follows !URG and write it to a file in HTML format.
So can I create this 2nd proc and call it from with in the first?
Proc name {args} {
if {condition} {
do this
} else {
do this
call proc {args}
}
}
The "call proc {args}" was made up by me. Not sure if thats the format or not.
Could you, or someone provide a sample?
To be clear, I would like to pass the argument $args to the second proc for processing further.
Calling your own procedure is exactly like calling any of tcl's builtin ones (puts, open, close, etc). Check out http://dev.scriptics.com for detailed help with tcl syntax.