## pub cmd auth -- start 
proc auth_pub {nick uhost hand rest} { 
global x botnick 
set pw [lindex $rest 0] 
if {$pw == ""} { 

# putserv "PRIVMSG $channel :$j Usage: .login <password>" 
# $channel isn't defined, also you don't want the bot to say that in the
# channel, you want it said to $nick
# Also can't see what $j is...that could be a problem.

putserv "PRIVMSG $nick :$j Usage: .login <password>" 
return 0 
} 
if {[matchattr $hand Q] == 1} { 
# $channel changed to $nick (below)
putserv "PRIVMSG $nick :$j u got r007" 
return 0 
} 
set ch [passwdok $hand ""] 
if {$ch == 1} {
# Don't know what $p is, see $j comment above.
puthelp "NOTICE $nick :$p No password set. Type /msg $botnick PASS <password>" 
return 0 
} 
if {[passwdok $hand $pw] == 1} { 
chattr $hand +Q 
putcmdlog "$x #$hand# auth ..." 
# $channel to $nick below
putserv "PRIVMSG $nick :$p u l0gg3d in" 
} 
if {[passwdok $hand $pw] == 0} { 
putcmdlog "$x #$hand# auth FAILED" 
# $channel to $nick below
putserv "PRIVMSG $nick :$p f4il3d" 
} 
}