1. Preface. Tcl is easy yet powerful scripting language. climm provides Tcl support both for evaluating Tcl constructions from climm command line and writing Tcl "hooks" to handle different events (incoming messages, status changes, etc). This short HOWTO provides an introduction to writing Tcl scripts for climm. I assume the reader has basic knowledge of Tcl itself - just like I have. ;) Why this HOWTO? When trying to implement a simple hook I discovered that the documentation for this climm functionality is rather sparse and then I had to study climm sources to get my task done. As not everybody can read C source code freely (well, at least I cannot) I decided to try to cover the theme. Hope my efforts will help somebody. Ah, and of course comments and additions are welcome. Reach me at jeff < at > macloue.com. 2. Prerequisites - compiling climm with Tcl support. If your system contains a usable Tcl 8.4 installation climm build system will detect it and use automatically. However you can disable Tcl support with --disable-tcl switch - this may give your build a small performance boost. 3. Basics. When climm is compiled with Tcl support it creates an internal Tcl interpreter upon startup. The user can use this interpreter to execute tcl code by using one of the following commands at climm promt: tcl Executes inline Tcl in climm Tcl interpreter. Arbitrary Tcl commands can be used, for example: climm> tcl puts [expr 1+2] 3 climm> Unlike tclsh climm doesn't automatically echo the result of evaluation so the following command prints nothing: climm> tcl expr 1+2 climm> So remember to "puts" the result of your calculations! tclscript Executes as a Tcl script in scope of climm Tcl interpreter. Supposing that the following script is stored in $HOME/.climm/hello.tcl: puts "Hello, world" the following command will provide: climm> tclscript .climm/hello.tcl Hello, world climm> You can also execute Tcl script upon climm startup by adding option "tclscript" to "[General]" section of your climmrc file. In this case script path can be given relative to climm base directory (usually $HOME/.climm). 4. Tcl extensions provided by climm. As most application do, climm provides some extensions to common Tcl syntax. The extension command is "climm" and you can get a short usage description by "climm help" ("tcl climm help" or even "tcl help" from the climm prompt). I will describe "climm" subcommands in slightly more depth below, following Tcl man pages syntax. climm exec Executes as if it is given at climm command prompt. So, the following code: climm exec "msg Commander Good day, commander!" will send message "Good day, commander!" to Commander contact. climm nick Finds contact name for . For example, this code: climm nick 48130434 will return my nickname in your contact list (or empty string if I'm not there). The following commands deal with hooks that can be installed into climm. I will describe them later. climm receive