resources/gui_and_objects/trassir_objects/script_object.py
It is possible to generate events in scripts. To do this, use the ready-made ScriptObject class.
The ScriptObject object is a child class of the BaseObject class, which is described in detail in the article Creating objects .
name (str, optional)
guid (str, optional)
parent (str, optional)
folder (str, optional)
associated_channel (str, optional)
fire_event_v2(message, channel="", data="")
Script: %1 event
message (str)
channel (str, optional)
data (str, optional)
from script_object import ScriptObject obj = ScriptObject() obj.fire_event_v2("Hello world")
These events can also be "caught" using the host.activate_on_events method
Let's link the channel to the event:
from script_object import ScriptObject obj = ScriptObject() obj.fire_event_v2("Hello world", channel="uR76TlcA")