This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

math.random Problem ?!
#1
Hi,
i have a funny effect when i use the math.random function.
 math.random(1,100) works in a resident script.
 math.random(1,100) in an event-based script always gives 80
i'm currently testing it on a WiserforKNX 2.3.0 but has the same on a Logic machine as well
thanks 

Thomas
Reply
#2
Add math.randomseed(os.time()) before math.random()
Reply
#3
(26.04.2019, 14:15)admin Wrote: Add math.randomseed(os.time()) before math.random()

thank you, it works 


Thomas
Reply


Forum Jump: