controllables.Chatterbox

class controllables.Chatterbox(port: Optional[int] = None)

Reference to a chatterbox part.

The following example assumes a chatterbox is assigned to port 0 of the microcontroller

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.choose()
hello(method: CommandMethod = 0)

Sends out hello command. Defaults to targeted method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.hello()
followme(method: CommandMethod = 0)

Sends out follow me command. Defaults to targeted method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.followme()
stop(method: CommandMethod = 0)

Sends out stop command. Defaults to targeted method

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.stop()
backup(method: CommandMethod = 1)

Sends out back up command. Defaults to area method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.backup()
geton(method: CommandMethod = 0)

Sends out get on command. Defaults to targeted method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.geton()
getoff(method: CommandMethod = 1)

Sends out get off command. Defaults to area method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.getoff()
sorry(method: CommandMethod = 0)

Sends out sorry command. Defaults to targeted method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.sorry()
insult(method: CommandMethod = 0)

Sends out insult command. Defaults to targeted method.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.insult()
choose()

Sends out choose command.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.choose()
property area_range: float

The diameter of the sphere used in area commands in meters (ranging 1-8).

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.area_range = 5
chatterbox.backup()
from controllables import Chatterbox

chatterbox = Chatterbox(0)
print(f'area range: {chatterbox.area_range:0.1f}')
property targeted_range: float

The length of the cone used in target commands in meters (ranging 1-8).

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.targeted_range = 5
chatterbox.followme()
from controllables import Chatterbox

chatterbox = Chatterbox(0)
print(f'target range: {chatterbox.targeted_range:0.1f}')
property voice: VoiceSet

The voice used by the chatterbox.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.voice = Chatterbox.VoiceSet.DODO
chatterbox.followme()
cooldown() float

Returns the time interval in seconds between emissions.

# Example shows how to send out a continuous chat signal
from controllables import Chatterbox
from time import sleep

chatterbox = Chatterbox(0)
while True:
    chatterbox.followme()
    sleep(chatterbox.cooldown())
cooldown_left() float

Returns the time until the next command will be emitted.

# Example shows how to send out a continuous chat signal
from controllables import Chatterbox

chatterbox = Chatterbox(0)
while True:
    while not chatterbox.cooldown_left:
        pass
    chatterbox.followme()
class VoiceSet(value)

An enum representing the various voice options for the chatterbox.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.voice = Chatterbox.VoiceSet.Sid
AA7 = 0

AA7 voice.

DODO = 1

DODO voice.

Sid = 2

Sid voice.

VoxBot = 3

Vox Bot voice.

Ada = 4

Ada voice.

class CommandMethod(value)

An enum representing the various method options for the chatterbox.

from controllables import Chatterbox

chatterbox = Chatterbox(0)
chatterbox.backup(Chatterbox.CommandMethod.Targeted)
Targeted = 0

Command sent out in a cone.

Area = 1

Command sent out in a sphere.

name() str

Returns the user editable name of the controllable as found in the properties tab of the game.

The following example assumes that any controllable or sensor is assigned to port 0 and prints out its name.

from ports import PortReference

print(PortReference(0).name())