Crab.broadcast()

From 8x9craft
Jump to: navigation, search
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!');

See also

Navigation menu

Internal error

Jump to: navigation, search
[dbd0b89115d908510e025f59] 2024-03-29 15:02:45: Fatal exception of type "Error"

Navigation menu