The scheduler module provides a robust event management system for ComputerCraft applications.
It includes utilities for handling events, managing timeouts, and running event loops.
⚠️ IMPORTANT: Many functions in this module (osEvents, asyncSleep, setTimeout, timeouts on events, etc.) require an active event loop
to function. You have two main ways to use this module:
// Now you can use these with the global 'on' function on("turtle_dig", (success, block) => { if (success) { print(`Successfully mined ${block}`); } });
// And dispatch them awaitdispatch("turtle_dig", true, "minecraft:diamond_ore");
The scheduler module provides a robust event management system for ComputerCraft applications. It includes utilities for handling events, managing timeouts, and running event loops.
⚠️ IMPORTANT: Many functions in this module (osEvents, asyncSleep, setTimeout, timeouts on events, etc.) require an active event loop to function. You have two main ways to use this module:
Key Features:
Common Use Cases:
OS Event Management:
Custom Event Systems:
Mixed Usage:
Example: OS Event Loop Usage
Example: Extending OS Events
Example: Custom Event System