Kolky.nl

games & code related blog

TCL Scripts

May 24, 2009 by Kolky

Lately I've been working on some TCL scripting. It's a really cool language to work with, as it doesn't look like any other language I've worked with before. See for an example below:

proc openurl {args} {
        set text [lindex $args 0]

        # check if we're missing http://
        if {![string equal -nocase [string range $text 0 6] "http://"]} {
                set text "http://$text"
        }

        # start connection
        http::config -useragent "Mozilla/5.0"
        set conn [http::geturl $text]
        set data [http::data $conn]

        # cleanup
        http::cleanup $conn

        return $data
}

More so it is also not an easy language and especially hard to debug or test! However after working with a personal Eggdrop server and several different scripts I think I've managed quite alot of the language. Hopefully soon I will update my website with some of the scripts I created.

Comments

No comments

Add Comment