proc pub:connect {event} {
global servhost botlogin botpass vhost
global qauthed ;# this makes qauthed global and usable in other procs
putquick "PRIVMSG $servhost :AUTH $botlogin $botpass"
set qauthed 1
if {$vhost} {
putquick "MODE $::botnick +x"
}
}
proc example {} {
global qauthed
# you can get the value of $qauthed here
}