The Luacontroller is an advanced programmable component.
You can simply code it in the language Mesecons uses itself: Lua!
All the code runs in a sandbox, so it's completely safe (but I won't guarantee that for absolute certainty!).
<a href="http://mesecons.net/luacontroller/">Documentation is available here!</a>