mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
buttonboxrewardses
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const DOCK_COMMAND_BASE64 = Buffer.from([143]).toString('base64');
|
||||
|
||||
module.exports = {
|
||||
id: 'dockPanic',
|
||||
name: 'All Dock',
|
||||
goal: 30,
|
||||
async run(ctx) {
|
||||
const rovers = ctx.listOnlineRovers();
|
||||
rovers.forEach((rover) => {
|
||||
try {
|
||||
ctx.issueCommand(String(rover.id), { type: 'raw', raw: DOCK_COMMAND_BASE64 });
|
||||
} catch (err) {
|
||||
ctx.logger.warn('dockPanic failed', { roverId: rover.id, error: err.message });
|
||||
}
|
||||
});
|
||||
ctx.sendAlert({
|
||||
color: '#ff9800',
|
||||
title: 'All Dock',
|
||||
message: `Issued seek-dock to ${rovers.length} rover(s).`,
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user