TouchOSC's scripting API is based on the Lua 5.1 language and virtual machine with custom additions and modifications.
Scripts can be added to all controls in a document and at the document root level. Each control's script will be executed in its own Lua context.