Add magma script for genpt