Crab.broadcast()
From 8x9craft
function broadcast(msgType: string, ...args: any[]): void
Make a crab send a custom message to all the crabs currently running a program.
Parameters:
- msgType: string - the type of the message to broadcast.
- ...args: any[] - you can pass any number of additional arguments that will be passed down to functions handling this event.
Examples
// Crabs participating in the race's program
crab.waitFor('signal!');
// start the race
// Judge crab's program
for (var i = 3; i > 0; i--) {
crab.say('... ' + i + '!');
crab.sleep(1);
}
crab.broadcast('signal!');