If lag is breaking your macro ...

Then craft by hand, without macros.