TWIN: Implement more scripting functions