This is what I am using. It works except for the delay part.
menu menubar {
-
~ Random Welcome ~
.$iif($group(#randomwelcome) == on,$style(2),$style(0)) On: .enable #randomwelcome | echo -a 0,12 ~ Random Welcome On ~ $+ 0,94 Enabled
.$iif($group(#randomwelcome) == off,$style(2),$style(0)) Off: .disable #randomwelcome | echo -a 0,12 ~ Random Welcome Off ~ $+ 0,4 Disabled
-
}
#randomwelcome off
on *:join:#:{
.timerdelay 0 5 {
%welkom = $gettok($read(wmsg.txt, w,* $+ $$ial($nick $+ *,1).addr $+ *),2-,32)
if (%welkom == $null) {
%welkom = $greettime $nick
Welcome
(H) (?) Please
}
%random = $rand(1,6)
if %random = 1 { /msg $chan S Comic\bSans\bMS;0 Welcome to the room $nick }
if %random = 2 { /msg $chan S \rComic\bSans\bMS;0 Great to c u again $nick Welcome }
if %random = 3 { /msg $chan S eEras\bDemi\bITC;0 ---- How u Doing $nick ---- }
if %random = 4 { /msg $chan S Lucida\bHandwriting;0 $nick Do you have a Profile (P)?? }
if %random = 5 { /msg $chan S Arial\bUnicode\bMS;0 ---- Welcome $nick
---- }
if %random = 6 { /msg $chan S Comic\bSans\bMS;0 Hi $nick What is your a/s/l }
}
alias -l greettime {
if ($asctime(H) <= 5) return Hello
elseif ($asctime(H) <= 11) return Hello
elseif ($asctime(H) <= 17) return Hello
else return Hello
}
}
#randomwelcome end