Subj : umm...
To   : Hax0r
From : Digital Man
Date : Mon Jul 16 2001 12:03 pm

RE: umm...
BY: Hax0r to Digital Man on Mon Jul 16 2001 07:22 pm

> RE: umm...
> BY: Digital Man to Hax0r on Sun Jul 15 2001 10:27 pm
>
>  > I don't think the screen line has anything to do with it, but more likely
>  > timing. Have you tried doing a small mswait before getting your random nu
>  > Or perhaps getting a few random numbers first (as Evan suggested).
>
> i tried getting several random numbers in a row -- 5 to be precise, and all
> were zero.  the baja code is fairly simple -- its pasted below.  I just took
> my stock ANSWER.ASC file and replaced the logo/graphic/etc with this:
>
> (at)EXEC:ANSWER(at)
>
> then, ANSWER.BIN does this...
>
> # ANSWER.SRC/ANSWER.BIN
> # random logon screen for synchronet
>
> cls
> int x
>
> # seed x with a random number between the fixed range
>
> random x 3
>
> compare x 0
>     if_equal
>         pause_reset
>         printfile "%zANSWER1.ANS"
>     end_if
>
> compare x 1
>     if_equal
>         pause_reset
>         printfile "%zANSWER2.ANS"
>     end_if
>
> compare x 2
>     if_equal
>         pause_reset
>         printfile "%zANSWER3.ANS"
>     end_if

There's definitely a problem with random numbers currently in v3.00 and it will
be fixed before the release of v3.10.

In the mean-time, I'd suggest you use the current time to generate a
pseudo-random number. Example:

# display answer0-3.ans
int t
str fname
time t          # get time (in seconds)
and t 3         # just use lower 2 bits
sprintf fname "%%zANSWER.%ld" t
printfile fname # display file

-Rob

---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net