MRC 监控器:实时食堂订单追踪 - Openclaw Skills

作者:互联网

2026-04-13

AI快讯

什么是 MRC 坚控器?

MRC 坚控器是一款专门设计的工具,旨在通过后台追踪订单进度来简化食堂用餐体验。作为 Openclaw Skills 生态系统的一部分,它直接连接到 Firebase Firestore 以坚控特定号码,并提供实时更新。它允许用户在其他地方保持工作效率,而无需排队等候,因为它能识别订单何时从准备阶段进入待取餐状态。

该技能非常高效,利用非阻塞后台进程确保 AI 代理在坚控运行期间保持响应。通过与流行的消息平台集成,它在食堂的数字化后端与用户首选的通信渠道之间建立了无缝桥梁。

下载入口:https://github.com/openclaw/skills/tree/main/skills/wysh3/mrc-monitor

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install mrc-monitor

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 mrc-monitor。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

MRC 坚控器 应用场景

  • 在食堂高峰时段同时追踪多个食品订单号码。
  • 餐饮准备就绪时,在 Discord 或 T@elegrimm 上接收即时推送通知。
  • 对特定订单号进行快速、单次的状态查询。
  • 减少在点餐柜台的物理等待时间和拥挤。
MRC 坚控器 工作原理
  1. AI 代理从用户输入中检测号码和命令(如 mrc、token 或 monitor)。
  2. 代理识别平台和频道 ID,以确保通知被正确路由。
  3. 启动后台 Python 脚本,建立与 Firebase Firestore 数据库的连接。
  4. 脚本每 15 秒轮询一次数据库,专门查看与所提供号码匹配的文档中的 status 字段。
  5. 当状态变为 Ready 时,脚本向用户发送自动通知。
  6. 坚控器会自动从观察列表中删除已完成的号码,并在所有订单处理完毕后关闭。

MRC 坚控器 配置指南

要将此功能集成到您的 Openclaw Skills 套件中,请确保已安装 Python 3 并配置了食堂项目的 Firebase 凭据。该脚本通过以下命令结构作为后台进程执行:

# 手动执行或代理触发的命令
python3 skills/mrc-monitor/scripts/monitor.py   

环境必须能够访问 kanteen-mrc-blr-24cfa Firebase 项目以检索实时数据。

MRC 坚控器 数据架构与分类体系

该技能与特定的 Firebase 模式交互,并生成用于故障排除的本地日志。

组件 详情 描述
Firebase 项目 kanteen-mrc-blr-24cfa MRC 食堂订单的核心数据库。
Firestore 集合 orders 包含每个活动订单的文档。
文档字段 studentId 键名为 student-{token_number}(例如 student-42)。
文档字段 status 字符串值:Preparing、Ready 或 Completed。
本地日志 /logs/monitor_*.log 存储轮询历史、网络重试和退出代码。
name: mrc-monitor
description: Real-time token monitoring for MRC canteen order system. Monitors Firebase Firestore for token status and notifies when orders are ready. Use when user sends commands like "mrc 73", "token 97", or "monitor 42" to monitor one or multiple canteen tokens. Handles multiple tokens simultaneously, sends independent notifications per token, and auto-exits when all tokens are ready.

MRC Canteen Monitor

Monitor MRC canteen order tokens and notify when they're ready for pickup.

Quick Start

When user sends any command containing canteen tokens:

  1. Extract all token numbers from the message
  2. Start the background monitor script
  3. Respond immediately with confirmation

Command Recognition

Users may send tokens with various prefixes:

  • "mrc 73" or "mrc 73 97 42"
  • "token 73" or "token 73 97"
  • "monitor 73"
  • "check 73" (one-time check only)

Starting the Monitor

Extract all numbers from the user message and start the background monitor:

python3 skills/mrc-monitor/scripts/monitor.py     ...

Where:

  • platform: "telegram" or "discord"
  • channel_id: Current channel identifier (platform prefix is optional, e.g., telegram_123 or 123 both work)
  • token1, token2, ...: Token numbers to monitor

Example:

python3 skills/mrc-monitor/scripts/monitor.py telegram telegram_6046286675 73 97 42
# or
python3 skills/mrc-monitor/scripts/monitor.py telegram 6046286675 73 97 42

Background Execution

Start the monitor as a background process so the agent responds immediately:

import subprocess

# channel_id can be with or without platform prefix (both work)
cmd = ['python3', 'skills/mrc-monitor/scripts/monitor.py',
       platform, channel_id] + [str(t) for t in tokens]
subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

Agent Response

After starting the monitor, respond immediately with:

? Monitoring tokens: 73, 97, 42
Checking every 15 seconds.
I'll notify you here when they're ready! ??

One-Time Check

For "check 73" commands, perform a single Firebase query and respond with status without starting a background monitor.

Monitor Behavior

The monitor script:

  • Polls Firebase Firestore every 15 seconds
  • Checks all monitored tokens in each poll
  • Sends "?? Order X is ready!" notification when a token's status is "Ready"
  • Removes notified tokens from the watch list
  • Exits automatically when all tokens are notified
  • Handles errors gracefully with retries
  • Logs all activity to skills/mrc-monitor/logs/monitor_YYYYMMDD_HHMMSS.log

Error Handling

The script automatically handles:

  • Network timeouts (retries up to 5 times)
  • HTTP errors (including rate limits)
  • Unexpected errors (stops after 5 consecutive failures)
  • Signal termination (SIGTERM, SIGINT)

On fatal errors, the script sends a notification before exiting.

Firebase Details

  • Project: kanteen-mrc-blr-24cfa
  • Collection: orders
  • Document fields:
    • studentId (string): "student-{token_number}"
    • status (string): "Preparing", "Ready", "Completed"

相关推荐