SexScripts : Script halts on particular code - https://ss.deviatenow.com:443/viewtopic.php?f=6&t=1004 Page 1 of 1

Script halts on particular code

modnar [ Thu Nov 05, 2020 1:06 pm ]

There is an issue where if you try and getRandom from something set by lets say Math.round the code will halt and not even output an error.
Was running a script, and kept wondering why it was halting for no reason, no error or anything.

Code:
show('Testing Started');

def myVariableA = (2 * 1800 / 3600);
showButton('I got here #1');

def myVariableB = Math.round(2 * 1800 / 3600);
showButton('I got here #2');

def myVariableC = getRandom(1);
showButton('I got here #3')

def normalIntClass = 1;

show(myVariableA + " myVariableA:" + myVariableA.getClass() + " myVariableB:" + myVariableB.getClass() + " myVariableC:" + myVariableC.getClass() + " normalIntClass:" + normalIntClass.getClass());
showButton('Showing myVariableA');

//This will work
def myVariableD = getRandom(myVariableA.intValue());
showButton('I got here #4')

//This will fail
def myVariableE = getRandom(myVariableA);
showButton('I got here #5')

//Halts above with no error etc.
def myVariableF = getRandom(myVariableB);
showButton('I got here #6')


Re: Script halts on particular code

SomeGuy22006 [ Fri Nov 06, 2020 11:40 am ]

Thank you for highlighting this.

I had seen the same problem of one of my scripts halting without error at an unknown point. I thought it might be some memory problem my computer had when showing buttons, but couldn't find a work-around.

Forcing my getRandom inputs to be integers seems to have solved it.

Re: Script halts on particular code

ispank [ Sat Nov 07, 2020 12:13 am ]

Same here. I always type cast to int before passing to getRandom.

Re: Script halts on particular code

doti [ Wed Nov 11, 2020 12:01 am ]

Indeed, strange bug. Corrected in the next releases.

Page 1 of 1 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011