is it just my setup, or does the baja random function seem to be somehow related to screen length/position/buffer (one of them anyways -- not 100% sure which one it is, but i'm leaning toward "total lines output")
... i found that changing ANSWER.ASC to do a @exec:<mybajamodulehere>@, wher
whats the scoop?
is it just my setup, or does the baja random function seem to be somehow related to screen length/position/buffer (one of them anyways -- not 100% sure which one it is, but i'm leaning toward "total lines output")
... i found that changing ANSWER.ASC to do a @EXEC:<mybajamodulehere>@, wher
whats the scoop?
I don't know, that's odd. What if the module runs later? What's the number being generated?
I don't know, that's odd. What if the module runs later? What's the numbe being generated?
basically i'm having it generate a random number so i can display a random ANSWER screen. it so happens that the random number generated (if no text i on the screen) is *always* zero. If i do a "cls" in the baja module (thus o screen operation), the random number generated is always 1. its just pretty strange. if i run the module after logon (and a lot of screen activity has occured), i always do get a random number...
any ideas?
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 numb Or perhaps getting a few random numbers first (as Evan suggested).
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 be fixed before the release of v3.10.
# 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
There's definitely a problem with random numbers currently in v3.00 and i be fixed before the release of v3.10.
heh.. glad that it just wasn't something i was doing -- has this been a know thing?
i've used the random function before and it seemed to work ok...
# display answer0-3.ansint 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
thats a lot more elegant than my solution anyways... thanks for the tip!
Sysop: | Tandy |
---|---|
Location: | New York, USA |
Users: | 15 |
Nodes: | 13 (0 / 13) |
Uptime: | 65:05:48 |
Calls: | 335 |
Messages: | 113,199 |