When you changed the rotor arm and replaced the distributor cap, are you sure you didn’t disturb the two plugs by the side of the distributor. These are for the knock and TDC sensor (I think). If these are unplugged or loose it might be the cause of your problems. Failing that, get it down to a garage who can read the fault codes stored in your ECU.