Made my first hscript which only allows parameter output of even numbers and just wanted to share it in case anyone else could use it.
if ((($OV + 1) % 2), $OV, $OV+1)
Used it to control the number of sides on a gear HDA so the spokes would always have a gap between them. Not super useful but a fun challenge for my first hscript and adds a bit of user friendliness.
Can it be optimized? Would it be better to write it in VEX or Python maybe?
Well if you change it to: if(($OV%2), $OV + 1, $OV) that would be one calculation fewer I suppose. I wouldn't worry about efficiency for such simple things; Python is not as quick as Vex but it can allow you to do things Vex can't do (File IO, creation of nodes, starting sub processes, &c.), and only when you are doing things multiple times over would you worry about such things.