|"so can i use the power supply from the compaq in the emachines?"|
No! Absolutely not! The Compaq is ancient. You know what that means, right? Old, outdated, antique, etc? It's completely different than your modern eMachines system & the parts are NOT compatible!
You don't even know if the power supply is the problem, do you? What have you done to troubleshoot so far?