CORE Functions

CORE functions are those functions that are to be used regardless of the selected platform. Basically they are functions for all platforms.

async TimeDifference(actual_real_time: int, previous_real_time: int, itinerator: int, resumed: bool)

Get the difference between two injects. It will make the bot sleep and inform the Game Masters.

actual_real_time

The actual inject’s time.

Type:

int

Required:

True

previous_real_time

The previous inject’s time.

Type:

int

Required:

True

itinerator

The inject’s number. Used when resumed is True.

Type:

int

Default:

None

Required:

False

resumed
Type:

bool

Default:

None

Required:

False

async NotifyGameMasters(type_info: str)

Notify the Game Masters of the different states of the bot, through messages.

type_info
Type:

str

Required:

True

async ProcessIncidents(ctx, function_type: str = None, itinerator: int = 0)

Process the incidents from the MSEL file.

ctx
Type:

object|array

Required:

True

function_type

Depending the command sent (Start/Resume).

Type:

str

Required:

True

itinerator

Inject number retrieved from the Game Master, used when function_type equals "resume".

Type:

int

Default:

None

Required:

False

IncidentsFetcher(self)

Retrieves the incidents from the desired source, chosen in the config file.

async start(MSEL: str, platform, gui=False)

Start the framework. This function takes care of starting the platform bot and also the GUI.

MSEL

The location of the MSEL.

Type:

str

Required:

True

platform

The platform selected for the exercise.

Type:

str

Required:

True

gui

A boolean to determine if we should start the visual interface.

Type:

bool

Required:

False

async check_status(reset: bool = False) bool | str

Monitors the framework’s status. It can reset flags, handle framework breaks, and wait until the framework is ready to proceed. Its purpose is to ensure smooth operation and synchronization within the framework.

reset

Reset flag to indicate whether to reset the process_wait and process_quit flags.

Type:

bool

Default:

False

Required:

False

Returns:

Returns a boolean indicating the status of the framework or ‘break’ if process_quit is True.