The valuechange
event fires when the value of a dataref changes. Detecting changed dataref values and acting on them is generally more efficient than setting a new value every frame, as many Lua plugins do.
The event uses the ValueChangeEvent
object.
> dataref = "laminar/c172/fuel/fuel_tank_selector"
Dataref
> "valuechange",
undefined
Fuel tank selector changed from 1 to 2
Fuel tank selector changed from 2 to 1
I'm not aware of any other framework implementing similar functionality for X-Plane.