We propose ASEA, a modular architecture for event-based control of complex robots. ASEBA runs scripts inside virtual machines on self-contained sensor and actuator nodes. This distributes processing with no loss of versatility and provides several benefits. The closeness to the hardware allows fast reactivity to environmental stimuli. The exploitation of peripheral processing power to filter raw data offloads any central computer and thus allows the integration of a large number of peripherals. Thanks to scriptable and plug-and-play modules, ASEBA provides instant compilation and real-time monitoring and debugging of the behavior of the robots. Our results show that ASEBA improves the performance of the behavior with respect to other architectures. For instance, doing obstacle avoidance on the marXbot robot consumes two orders of magnitude less bandwidth than using a polling-based architecture. Moreover, latency is reduced by a factor of two to three. Our results also show how ASEBA enables advanced behavior in demanding environments using a complex robot, such as the handbot robot climbing a shelf to retrieve a book.