Well you can always move your function to a file and just run that file. Example would be:ilikelatex wrote: ↑Sun Mar 24, 2019 10:53 am I have also a short question is it possible to call a specific function when you run a file or do i have to handle it in the file itself with flags?
Code: Select all
@Call(Custom\AV_Scripts\AV_Mistress.txt, promise) -> run("Custom" + java.io.File.separator + "AV_Scripts" + java.io.File.separator + "AV_Mistress.js"); //, promise())
AV_Mistress.js
Code: Select all
Possibly other code...
function promise() {
//Code of promise
....
}
AV_Mistress_Promise.js
Code: Select all
{
//Code of promise
....
}
Code: Select all
run('.../AV_Mistress_Promise.js');
Have your AV_Mistress.js file. Just put in different functions and all stuff as usual. Run the file once at the startup of the personality like:
Code: Select all
run('.../AV_Mistress.js');
Code: Select all
promise();
An example can be found in my TAJ Spicy version:
https://github.com/GodDragoner/Spicy-TA ... Toys.js#L2 Here I am running all my toys's files, in this line the chastity cage toy file. The Toys.js file is run once at the startup of the personality right here: https://github.com/GodDragoner/Spicy-TA ... ain.js#L44
Now the chastity cage file looks like this: https://github.com/GodDragoner/Spicy-TA ... ityCage.js Notice the differenct functions. In this case the lockChastityCage one.
Once the file was run once (in this case no code is executed and just the functions are loaded, because there is no code outside the functions at any point in the file) I can use the methods wherever I want to. For example here: https://github.com/GodDragoner/Spicy-TA ... End.js#L28