Skip to content
MSN

random oj message with time delay problems

A TG007 community discussion started by sdtorch.

Discussion 2 posts
Page 1 of 1
Open
Topic #88 · 2 published posts · 536 views

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 biggrin.gif Welcome tongue.gif(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 wink.gif ---- }

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

 

usually when i work with timers i like to use aliases.. it's just easier for me to keep them seperated in case i need to change them later..

 

I would turn it into an alias then do

 

.timerwhatever 1 5 aliasname

 

I'm still a bit sleepy but i'm not sure why you are using 0 5 as that's a continuous timer that will keep going every 5 seconds.

 

also you might want to just use a txt file to store your random welcome messages... then you can just use the $read command... cuts down on the coding and you can add more lines to the txt file without having to write extra coding

Edited Mar 10, 2004 5:36 PM by err0r