Add trials option to gen_scripts.c