The SexScripts API is a set of built-in functions that you can use anywhere in your script. That set of functions will let you to have a full control over your script. You can call them from groovy code like any other function. In this section all functions that are available in the API will be described.
exit()
This function will terminate the execution of SexScripts. Use it carefully and only if you have to. If you only want to exit from your script, it's enough with a return null statement.
getBoolean(message)
This function will ask message to the user and wait for him/her to click a yes or a no button. True will be returned if the user clicks yes, and false will be returned if the user clicks no.
getBoolean(message , yesText, noText)
This function does the same as the above but this time the yes and no buttons will have the customized labels yesText and noText respectively instead of the standard yes and no.
getBooleans(message, texts, defaultValues)
This function will show message to the user and ask him/her to select some checkboxes. texts must be a list of strings and will be the labels for the checkboxes. defaultValues must be a list of booleans with the same size as texts and will define the default state of the checkboxes (true means selected and false means unselected). This function will return a list of booleans again with the same size as texts and defaultValues indicating for each ceckbox the state the user's left it (true if selected and false if not selected).
getFile(message)
This function will ask the user to choose a file from a file choosing window captioned message. The full path to the file the user selected will be returned, or null if he/she canceled.
getFloat(message, defaultValue)
This function will show message to the user and ask him to input a numeric value, possibly with decimals. defaultValue is the default value shown in the user's input. The number the user introduces will be returned.
getInteger(message, defaultValue)
This function will show message to the user and ask him to input a numeric value. defaultValue is the default value shown in the user's input. The number the user introduces will be returned.
getSelectedValue(message, texts)
This function will show message to the user and ask him/her to select a value among texts. texts must be a list of strings. Returns the index of the value the user chooses in texts.
getString(message, defaultValue)
This function will show message to the user and ask him to input a string value. defaultValue is the default value shown in the user's input. The text the user introduces will be returned.
getTime()
This function returns the number of seconds that have elapsed from 01/01/1970 to the current moment.
getRandom(max)
This function returns an integer value randomly chosen between 0 and max-1, both included (max has to be at least 1)
loadBoolean(key)
Returns a boolean stored in the SexScripts data registry file associated with some key. key must be a string indicating that key. If key is not found in the data registry, null will be returned instead. If you use a data value in your script, its key should be something like “nameOfYourScript.nameOfTheValue”. You can also access keys “intro.female”, “intro.women” and “intro.men” to know if the user is female (if not then is male), if is attracted to women, or if is attracted to men, respectively. You can also use this function to check if an item is in the slave toy or clothes list, accessing the keys “toys.nameOfTheToy” and “clothes.nameOfTheClothes” respectively. For example, the keys “toys.dildo” and “clothes.thong” exist.
loadFirstTrue(key1, key2, key3, …)
Returns the key of the first boolean stored in the data registry found true. Returns null if no key is true. See the above function to know how key works.
loadFloat(key)
This function works like loadBoolean, but instead of loading a boolean it will be loading a real number.
loadInteger(key)
This function works like loadBoolean, but instead of loading a boolean it will be loading an integer number.
loadString(key)
This function works like loadBoolean, but instead of loading a boolean it will be loading a string.
openCdTrays()
This function will open all CD trays the user have on his/her computer.
playBackgroundSound(soundFile)
This function will play the sound file located at the path soundFile without waiting for it to end its playing. This path must be relative to the sounds/ folder in SexScripts. The sound file to play must be either a .wav or a .mp3 file.
playSound(soundFile)
This function will play the sound file located at the path soundFile, and wait for it to end its playing. This path must be relative to the sounds/ folder in SexScripts. The sound file to play must be either a .wav or a .mp3 file.
save(key, value)
Saves value in the SexScripts data registry file, associated with the key key.
setImage(imageFile)
This function will set the image located at the path imageFile as the current image shown. This path must be relative to the images/ folder in SexScripts. The image file to show must be a .jpg ,a .gif, or a .png file. If imageFile is null, then the current shown image will be hidden and no image will be shown at all.
setInfos(version, title, summary, author, status, color, language, tags)
This function will set your script's global information. You must call it only once as the first statement of your script if you're writing your script entirely in groovy without using ssScriptMaker. If You use ssScriptMaker, do not call this function at all, because ssScriptMaker will do it for you. version must be an integer number indicating the minimum required version of the SexScripts api to be able to run your script. The version of the api explained in this document is 3. title, summary, author, status and language must be strings describing their respective fields, click here to know more about them. color must be an integer coding the background color of your script, in rgb format. Finally, tags must be a list of strings indicating all the tags of your scrpt.
show(message)
This function will set message as the current text message shown by SexScripts. If message is null or an empty string “”, then the current shown message will be hidden and no message will be shown at all.
showButton(label)
This function will show a button to the user labeled label, and will wait for the user to press it. This function will return the number of seconds that it has been waiting for the user to press the button.
showButton(label, timeout)
This functions works like the above, but if timeout seconds elapse during the waiting, stop waiting, hide the button and continue. If this last case occurs, timeout will be returned.
showPopup(message)
This function will launch a pop-up window with the text message in it and an Ok button, and will wait until the user presses the Ok button or closes the pop-up window. This function will return the number of seconds that it has been waiting for the user to press the Ok button or to close the window.
useEmailAddress(address)
This function will try to start the email manager in the user's system ready to send a new email to address.
useFile(path)
This function will try to open the file located at path in the user's system (with the application the user's system has associated that file based on its extension). path must be relative to the SexScripts folder.
useUrl(url)
This function will try to open url with the user's default browser in the user's system.
wait(seconds)
This function will wait seconds seconds. seconds must be a real number.
waitWithGauge(seconds)
This function works like the above, but it will show a filling gauge bar during the wait.