Abstract Event class

class Event.Event(level)[source]

Generic Event object all specific Events inherit from.

Parameters:level (Level) – The Level this Event will be used on.
set_session(session)[source]

Sets the Session the event will be triggered in.

Parameters:session (Session) – The session this Event will be triggered in.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Specific Events

Teleportation

class Event.Teleport(level, target_position)[source]

Bases: Event.Event

Teleports to a set location

Parameters:
  • level (Level) – The Level this Event will be used on.
  • target_position (int) – The target of the teleportation.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Random Teleportation

class Event.RandomTeleport(level, list_of_target_zones)[source]

Bases: Event.Event

Teleports to a type of zone that is on the given list randomly.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • list_of_target_zones ([Zone]) – The possible Zones this teleport can land is.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Port On/Off

class Event.PortOn(level, port)[source]

Bases: Event.Event

Turns on a port on the Level’s Gramophone.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • port (int) – Which output to use on the device.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

class Event.PortOff(level, port)[source]

Bases: Event.Event

Turns off a port on the Level’s Gramophone.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • port (str -- 'A', 'B' or 'C') – Which output should be turned off.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Starting/Stopping bursting

class Event.StartBurst(level, port, on_time, pause_time)[source]

Bases: Event.Event

Starts bursting a port on the Level’s gramophone.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • port (int) – Which output to use on the device.
  • on_time (float) – How long should the port by set to high before a pause.
  • pause_time (float) – How long should the pauses be.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

class Event.StopBurst(level, port)[source]

Bases: Event.Event

Stops bursting a port on the Level’s gramophone.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • port (int) – Which output should stop bursting.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Pausing/Unpausing

class Event.Pause(level, pause_position=None)[source]

Bases: Event.Event

Pauses the Level where it is or at a given position.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • pause_position (int or None) – Set to None to pause at current position. None by default.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

class Event.UnPause(level, unpause_position=None)[source]

Bases: Event.Event

Unpauses the Level where it is or at a given position.

Parameters:
  • level (Level) – The Level this Event will be used on.
  • unpause_position (int or None) – Set to None to pause at current position. None by default.
trigger()[source]

Triggers the Event. Prints Event information.

triggerable

Tell whether it makes sense to trigger this event at the moment.

Printing messages

class Event.Print(level, message)[source]

Bases: Event.Event

Prints the given message to the console window.

Parameters:message (str) – The message that will be printed when triggered
triggerable

Tell whether it makes sense to trigger this event at the moment.