#--------------------------------------------------------------------- # undernetident.tcl # Tcl script for IRC bot eggdrop # # Undernet allows hosthiding i.e. users may be visible under: # nick!ident@username.users.undernet.org where "username" is obtained # after registrating with undernet. When using the default ident # command, eggdrop adds hosts as: *!ident@*.undernet.org. # Subsequently, any user that can "make" the ident, will be # recognised by the bot. # This ident script first checks the host and when it is an # "username.user.undernet.org" host, the hostmask added after # successfull identing is: *!ident@username.user.undernet.org. # # v0: 17-Oct-2002 #--------------------------------------------------------------------- package require eggdrop 1.6 package require Tcl 8.0 # new bind, destroys previous bind, if it existed. bind msg - ident undernetident proc undernetident { nick uhost hand text } { # uhost is an username.users.undernet.org hostname? set uhostlist [split $uhost "@"] set host [lindex $uhostlist 1] set host [string tolower $host] if {![string match "*.users.undernet.org" $host]} { # not an username.users.undernet.org host. # apply regular identing. *msg:ident $nick $uhost $hand $text return 0 } # It is an username.users.undernet.org host. # handle is already known? Disallow further adding. if {[validuser $hand]} { puthelp "NOTICE $nick :I recognize you there." return 0 } # scan out password and nickname set scancount [scan $text "%s %s" password nickname] # text is empty? if { $scancount <= 0 } { return 0 } # only a password supplied? if { $scancount == 1 } { set handle $nick } # a nickname is supplied too. if { $scancount == 2 } { set handle $nickname } # check handle/password combination. if {![passwdok $handle $password]} { return 0 } # handle/password combination is ok, add the host to eggdrop. append nuhost * ! $uhost setuser $handle HOSTS $nuhost putlog "UndernetIdent: added $nuhost to $handle" return 0 } putlog "UndernetIdent version 0 loaded."