Hello.
I would like to randomize the state of a switch w/ a pad.
I'd be very grateful for any help I can get.
All the best
Daniel M Karlsson
How do I randomize the state of a Switch?
-
- Newbie
- Posts: 2
- Joined: 08 Feb 2013 05:06
How do I randomize the state of a Switch?
- Attachments
-
- RandSwitchState.jzml
- Randomize switch state
- (7.54 KiB) Downloaded 63 times
Re: How do I randomize the state of a Switch?
The x value for a switch can only be 0 or 1. rand() gives you a number between 0 and 1 that is not likely exactly 0 or 1. You can fix this in your script by rounding the random value:
Code: Select all
UltraSoloSwitch.x=round(rand());
-
- Newbie
- Posts: 2
- Joined: 08 Feb 2013 05:06
Re: How do I randomize the state of a Switch?
Right. Integers and floats.
Works like a charm now.
Thank you very much for your help brianc.
Works like a charm now.
Thank you very much for your help brianc.