Version 48 of FF

Updated 2008-01-17 09:57:55 by FF

FF a.k.a. Federico Ferri

About me:

I am an Italian guy, student in Computer Science Engineering, programmer, newcomer tcl addict, [...]. I like to play piano.

You can find me on IRC, I identify as federico__ on Freenode. When posting to the wiki (from home) my IP is 83.1xx.x.x (netname is IT-TELE2-ADSL)


My projects:

My snippets:

Since I keep re-coding and re-coding, and asking on #tcl things I (once) know how to do... I'll begin putting here my code snippets, in the hope they will be useful again to me (ah, and to others of course! ;P)

Random stuff:

  • XChat Plugins -- I use XChat and occasionally I write plugins -- (how to: simply put pluginname.tcl into $HOME/.xchat2/ and restart xchat or type /reload)

KeepNick.tcl: recovers your nick and re-identifies you after server disconnection. you can now have a list of linked nicknames and freely switch from one to another:

 set ::nicks_to_keep {FEDE31C0 federico__}
 set ::nickserv_pw  "xxxxxxxxxxxxxx"

 timer -repeat 30 {
         if {[lsearch -exact $::nicks_to_keep [me]] == -1} {
                 set nick_to_keep [lindex $::nicks_to_keep 0]
                 /msg NickServ RECOVER $::nick_to_keep $::nickserv_pw
                 /msg NickServ RELEASE $::nick_to_keep $::nickserv_pw
                 /nick $::nick_to_keep
                 /msg NickServ IDENTIFY $::nickserv_pw
                 print "keepnick.tcl: recovered your nickname"
         }
 }

ChatMap.tcl: list all channels people are in, in addition to current channel

 set chatmap_chanlist [list]
 set chatmap_whoisf 0
 set chatmap_timerid -1

 on 319 channel_list {
        if {$::chatmap_whoisf} {
                if {[timerexists $::chatmap_timerid]} {
                        killtimer $::chatmap_timerid
                }
                set ::chatmap_timerid [timer 5 {
                        set ::chatmap_whoisf 0; process_chans_end
                }]
                process_chans [lindex [split $_rest :] 1]
        }
 }

 proc process_chans_begin {ul} {
        set ::chatmap_chanlist [list]
        set ::chatmap_whoisf 1
        foreach u $ul {/whois $u}
 }

 proc process_chans {l} {
        foreach chan $l {
                if {[lsearch -exact $::chatmap_chanlist $chan] == -1} {
                        lappend ::chatmap_chanlist $chan
                }
        }
 }

 proc process_chans_end {} {
        print "channels found: $::chatmap_chanlist"
 }

 alias channelspy {
        set fields [lindex [users] 0]
        foreach record [users] {
                if {$record == $fields} {continue}
                lassign $record {*}$fields
                lappend r $nick
        }
        process_chans_begin $r
        complete
 }

Quote:

There are never any bugs you haven't found yet.


I thought, when I first saw the title of this page, it was going to be about Marvel's "Fantastic Four"... sigh. Wonder if Reed Richards embeds Tcl into his devices to beat Doom, etc.

escargo - Wouldn't an extension of a different existing language be more likely, namely Fantastic Forth?


Category Person