A few years back I posted a LUA script I had modified for increasing the speed with which a rotary encoder can change something like a heading bug in X-Plane. While you can assign a rotary encoder — either one you place in your sim or maybe one of the dials on a Saitek FIP — to change a heading bug by having it send a keyboard stroke to the simulator, that process moves the bug very very slowly, and this old script speeded that up.
Last week I noticed that the script I used to change my OBS via a rotary encoder was no longer working in FlyWithLua. In trying to find the source of the error I found new posts in this post at the .ORG in which Adamo posted a link to a .ZIP file which has improved scripts for a variety of different bugs you might want to sent via an encoder: Heading, Airspeed, Altitude, VClimb/Descent, OBS, etc. They work GREAT, and are worth downloading if you want this functionality in your sim. The link to the .ZIP file is about half-way down the thread.