generate code via lua scripts