Read the kungfu novel
Ro-Tcl
Aici Gasesti Tot Felul De Tcl`uri
Acum este: 13/10/2026 13:24

whois.tcl

 
Raspunde la subiect    Pagina de start a forumului Ro-Tcl -> TCL Scripts
Subiectul anterior :: Subiectul urmator  

Autor Mesaj
MeBoy
Junior
Junior


Data inscrierii: 30/Iun/2008
Mesaje: 5

MesajTrimis: 01/07/2008 14:27    Titlul subiectului: whois.tcl Raspunde cu citat (quote)

Cod:
        # Config:
        # What is the minimum access someone needs to perform a whois with the bot?
        # o = global op, m = global master, n = global owner
        # |o = channel op, |m = channel master, |n = channel owner
        set whois(acc) "o"
        # End of Config

        bind pub $whois(acc) "!who" whois:nick

        proc whois:nick { nickname hostname handle channel arguments } {
        global whois
      set target [lindex [split $arguments] 0]
        if {$target == ""} {
        putquick "PRIVMSG $channel :Please choose a target first."
        return 0
        }
                putquick "WHOIS $target $target"
      set ::whoischannel $channel
        set ::whoistarget $target
        bind RAW - 401 whois:nosuch
        bind RAW - 311 whois:info
        bind RAW - 319 whois:channels
        bind RAW - 301 whois:away
        bind RAW - 313 whois:ircop
        bind RAW - 330 whois:auth
        bind RAW - 317 whois:idle
        }

        proc whois:putmsg { channel arguments } {
                putquick "PRIVMSG $channel :$arguments"
        }

        proc whois:info { from keyword arguments } {
                set channel $::whoischannel
                set nickname [lindex [split $arguments] 1]
                set ident [lindex [split $arguments] 2]
                set host [lindex [split $arguments] 3]
                set realname [string range [join [lrange $arguments 5 end]] 1 end]
                whois:putmsg $channel "$nickname - $ident@$host * $realname"
                unbind RAW - 311 whois:info
        }

        proc whois:ircop { from keyword arguments } {
                set channel $::whoischannel
                set target $::whoistarget
                whois:putmsg $channel "$target is an IRC Operator"
                unbind RAW - 313 whois:ircop
        }

        proc whois:away { from keyword arguments } {
                set channel $::whoischannel
                set target $::whoistarget
                set awaymessage [string range [join [lrange $arguments 2 end]] 1 end]
                whois:putmsg $channel "$target is away: $awaymessage"
                unbind RAW - 301 whois:away
        }

        proc whois:channels { from keyword arguments } {
                set channel $::whoischannel
                set channels [string range [join [lrange $arguments 2 end]] 1 end]
                set target $::whoistarget
                whois:putmsg $channel "$target on $channels"
                unbind RAW - 319 whois:channels
        }

        proc whois:auth { from keyword arguments } {
                set channel $::whoischannel
                set target $::whoistarget
                set authname [lindex [split $arguments] 2]
                whois:putmsg $channel "$target is authed as $authname"
                unbind RAW - 330 whois:auth
        }

        proc whois:nosuch { from keyword arguments } {
                set channel $::whoischannel
                set target $::whoistarget
                whois:putmsg $channel """
                unbind RAW - 401 whois:nosuch
        }

        proc whois:idle { from keyword arguments } {
                set channel $::whoischannel
                set target $::whoistarget
                set idletime [lindex [split $arguments] 2]
                set signon [lindex [split $arguments] 3]
                whois:putmsg $channel "$target has been idle for [duration $idletime]. signon time [ctime $signon]"
                unbind RAW - 317 whois:idle
        }


In caz de erori dati un reply Smile
_________________
#U&U Reprezentative
Sus
Vezi profilul utilizatorului Trimite mesaj privat

Afiseaza mesajele pentru a le previzualiza:   
Raspunde la subiect    Pagina de start a forumului Ro-Tcl -> TCL Scripts Ora este GMT + 2 ore
Pagina 1 din 1

 
Mergi direct la:  
Nu puteti crea un subiect nou in acest forum
Nu puteti raspunde in subiectele acestui forum
Nu puteti modifica mesajele proprii din acest forum
Nu puteti sterge mesajele proprii din acest forum
Nu puteti vota in chestionarele din acest forum

Powered by phpBB © 2001, 2002 phpBB Group.
Theme Designed By Arthur Forum
Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro