They are controlled by changing the center of gravity, think Magneto of the xmen :)
The scripts are for off the shelf (xiaomi/segway) ninebot one c/e/p models,
Here is a more down to earth video I shot myself, very interesting machines I believe.
Thanks again for espruino, I really enjoy it. :)