bind raw - 302 raw_getuserhost
proc raw_getuserhost {from keyword arg} {
	regexp {^(.+?)\*?=.(.+)$} [lindex $arg 1] - nick uhost
	invite2 $nick $uhost
	putserv "privmsg #tcltest2 : IN RAW_GETUSREHOST userhost: $fullhost"
}

proc invTimeout {nick} {
	putserv "PRIVMSG ::invState($nick,chan) :Userhost lookup for $nick failed."
	array unset ::invState $nick,*
}

proc pub:invite {nick uhost hand chan args} {
	if {![auth:check $hand]} {
		notice $nick "Authentication is required to use public commands. Please authenticate yourself"
		return 0
	}
	if {[llength [split $args]] < 1} {
		notice $nick "Usage: invite <nick> "
		return 0
	}
	set args [lindex $args 0]
	set who [join [lindex $args 0]]
	set ::invState($who,chan) $chan
	set ::invState($who,timer) [utimer 60 "invTimeout $who"]
	putserv "USERHOST $who"
	putserv "PRIVMSG $chan :Looking up userhost for $who"
}

proc invite2 {nick uhost} {
	catch {killtimer $::invState($nick,timer)}
	set chan $::invState($nick,chan)
	array unset ::invState $nick,*
	
	set key [lindex [getchanmode $chan] 1]
	putserv "PRIVMSG $chan : FROM INSIDE PUB:INVITE HOST IS : $userhost"
	putserv "PRIVMSG $chan :\[invite\] invited $who to $chan"
	adduser $nick "*!*${uhost}"
	chattr $nick +f|+fv $chan
	putserv "INVITE $nick $chan"
	putserv "PRIVMSG $nick : You are invited to $chan temporarily the key to the channel is $key"
	putserv "PRIVMSG $chan :\[invite\] $nick is allowed to stay in $chan temporarily."
}