Constructing quantum many-body scar Hamiltonians from Floquet automata