We simulate crystallisation of hard spheres with short-ranged attractive potentials as a model self-assembling system. Using measurements of correlation and response functions, we develop a method whereby the interaction parameters between the particles are automatically tuned during the assembly process, in order to obtain high-quality crystals and avoid kinetic traps. The method we use is independent of the details of the interaction potential and of the structure of the final crystal-we propose that it can be applied to a wide range of self-assembling systems.