UtilsLib

object UtilsLib

A collection of utilities without direct impact on the flow. They can be related to the LED ring, be useful mathematical functions or relate to GoogleSheet extensions.

Examples :

furhat.say(UtilsLib.GoogleSheets.getText("greeting"))
parallel{ goto(UtilsLib.LEDs.PulseLEDState) }
val direction = UtilsLib.getRandomDirection()

Functions

Link copied to clipboard
fun getAllFilesInResources(fileExtension: String = ".json"): MutableList<String>

Go through the resources folder and return all files that are currently there as a MutableList

Link copied to clipboard
fun getListOfLanguages(): List<Language>

Get the list of all languages supported by Furhat

Link copied to clipboard

Randomizes negative/positive meant to be used for setting i.e. if Furhat is looking left/right and up/down

Link copied to clipboard
fun getRandomInRange(startInterval: Double, interval: Double): Double

Return random double in given range

Link copied to clipboard
fun randomNoRepeat(vararg lambdas: () -> Unit)

Create variance between more advanced behaviours. To create variance between A, B, & C: randomNoRepeat({A},{B},{C})

Link copied to clipboard
fun FlowControlRunner.safeGoto(state: State)

Goto state without taking into account accidental double-click on wizard button This method is for live wizarded presentations to be used instead of the standard goto() Avoid effects of accidentally clicking a wizard button several times, which would cause it to transition from the same state to itself.

Properties

Link copied to clipboard

These functions allow the usage of an external source to define texts and intents from Google sheets.

Link copied to clipboard

These functions provide some automatic handling of the LED ring possibilities. They are typically called in parallel states to run during interactions.