scripting code gen