Class TaskScript
java.lang.Object
com.botwithus.bot.api.script.TaskScript
- All Implemented Interfaces:
BotScript
-
Method Summary
Modifier and TypeMethodDescriptionReturns the configurable fields this script exposes.voidonConfigUpdate(ScriptConfig config) Called when the script's configuration is updated (at startup from persisted values, or at runtime from the config UI).intonLoop()Called repeatedly while the script is running.voidonStart(ScriptContext ctx) Called once when the script is started.voidonStop()Called once when the script is stopped, either by returning-1fromBotScript.onLoop()or by an external stop request.
-
Method Details
-
onStart
Description copied from interface:BotScriptCalled once when the script is started. Use this to initialize state and cache references from the context. -
onLoop
public int onLoop()Description copied from interface:BotScriptCalled repeatedly while the script is running. The returned value controls the delay before the next invocation. -
onStop
public void onStop()Description copied from interface:BotScriptCalled once when the script is stopped, either by returning-1fromBotScript.onLoop()or by an external stop request. Use this to clean up resources. -
getConfigFields
Description copied from interface:BotScriptReturns the configurable fields this script exposes. Override this to declare user-editable parameters. The default implementation returns an empty list (no config).- Specified by:
getConfigFieldsin interfaceBotScript- Returns:
- a list of config field descriptors
-
onConfigUpdate
Description copied from interface:BotScriptCalled when the script's configuration is updated (at startup from persisted values, or at runtime from the config UI). The default implementation does nothing.- Specified by:
onConfigUpdatein interfaceBotScript- Parameters:
config- the new configuration snapshot
-