SexScripts : reading a variable from another file (solved) - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=1048 Page 1 of 1

reading a variable from another file (solved)

submicha1 [ Thu Aug 05, 2021 11:27 pm ]

I'm learning to write using Groovy and I'm trying to make a script where there's an introductory part, which is in another script and there I define several variables. But in the main script I wanted to be able to use them, for example, for conditions of an event to happen or not. I've already looked but couldn't find it, not even by the method of reading a file that says in the manual.

For example, in a script I ask the person's weight and then I define the variable weight = y, where y is the value that was entered, but in the main script I want to put that if the person has a weight > 70, they must do an action x. So I would need to call this variable to my main script.

Re: Is there any way to read the variable from another file?

martlb [ Fri Aug 06, 2021 3:03 pm ]

Put in the script before you use it:
int weight = (loadInteger("OtherScript.y"))

Be sure to have saved the value in the other script:
save("OtherScript.y",y)

Re: Is there any way to read the variable from another file?

submicha1 [ Sat Aug 07, 2021 2:53 am ]

martlb wrote:
Put in the script before you use it:
int weight = (loadInteger("OtherScript.y"))

Be sure to have saved the value in the other script:
save("OtherScript.y",y)



Thank you very much, it worked here :D

Re: reading a variable from another file (solved)

doti [ Wed Aug 25, 2021 5:18 pm ]

Thanks marlb.
For a bigger explanation : variable saved by save and read by loadXXX are save in a common file, data.properties, in the root folder of SexScripts. Every script search in this same file.

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