What the OP wrote initially works fine. The main problem is this game's habit of skipping macro lines. It's rage inducing.