Skip to content

Instantly share code, notes, and snippets.

@calebcauthon
Last active August 26, 2022 15:21
Show Gist options
  • Save calebcauthon/39fef771dde7bf294ea56074216d6167 to your computer and use it in GitHub Desktop.
Save calebcauthon/39fef771dde7bf294ea56074216d6167 to your computer and use it in GitHub Desktop.
{
"eventId": "1",
"status": "Ended",
"data": {
"EventType": "ValueChange",
"Value": "730"
}
}
events = {}
scene = basics.build_empty_scene_object()
scene.on("bootup").showtext("lets get started. set engine to idle ")
scene.on("valuechange", basics.build_equals_condition("identification", "knob")).saveas("knobvalue")
scene.on("valuechange", basics.build_simple_condition(
"__knobvalue__", knobmap["engine"]["from"], basics.less_than
)).showtext(f"too small! engine is only __knobvalue__rpm. needs to get up to {knobmap['engine']['from']}rpm")
scene.on("valuechange", basics.build_simple_condition(
"knobvalue", knobmap["engine"]["to"], basics.greater_than
)).showtext(f"too big! engine is only __knobvalue__rpm. needs to get down to {knobmap['engine']['to']}rpm")
scene.on("valuechange", basics.build_multiple_condition([
["knobvalue", knobmap["engine"]["from"], basics.greater_than],
["knobvalue", knobmap["engine"]["to"], basics.less_than]
])).showText("Good job!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment