Switchboard-class: Switchboard objects

Description Usage Arguments Functions Fields

Description

switchboards are chains of if-then statements, which can be very useful when long chains of such statements are needed, such as when programming bots. Using switchboards allows users to divide parts of their chain into different files or modules.

Usage

1
2
3
4
5
6
7
addAction(.self, condition, action, name = NULL, endChain = F, ...)

delAction(.self, idx)

evaluateAll(.self)

makeSwitchboard()

Arguments

condition

A logical statement, to be evaluated when the entire switchboard is evaluated. If true, the associated action is executed. The content of this argument remains unevaluated and is converted to a language object, to be evaluated when the evaluate method is called. However, content that's placed between .() is evaluated when running this function.

action

A piece of code to be run when the associated if statement is evaluated and found to be true. Content placed within .() is evaluated when running this function, the rest remains unevaluated until the evaluateAll method is run.

name

A name for this particular if-then statement. Can be left empty.

endChain

Logical. Should this statement, if true, end the evaluation of any further statements?

idx

Character or numeric. The to-be-deleted if-then statement. You can provide either its name or its number.

Functions

Fields

actions

A list of if-then statements.


Spiritspeak/often documentation built on Feb. 2, 2021, 11:41 a.m.