Install
openclaw skills install hk-bus-etaFast, reliable Hong Kong bus ETA lookup (KMB/CTB/LWB) with fuzzy stop matching, bilingual output (zh-HK/en), and multi-route parallel queries. Built for “nex...
openclaw skills install hk-bus-etaRecommended to install and run the following command to initialize the database (takes about 1-2 minutes):
cd {skill_dir}/scripts
python3 sync_bus_stops.py
This will download bus stop data from DATA.GOV.HK and build a local SQLite database for fast queries. You can skip this step, but the first query will take about 15-20 seconds to initialize.
{skill_dir}= 技能安裝目錄,例如~/.openclaw/workspace/skills/hk-bus-eta
tc: 尾班車已過或未有班次資料en: Service hours have passed / No route information foundpython3 scripts/eta.py {ROUTE} {STOP_NAME} {LANG}python3 scripts/sync_bus_stops.pyhttps://data.etabus.gov.hk/*https://rt.data.gov.hk/*scripts/bus_stops.dbscripts/kmb_stops.jsonscripts/ctb_stops.jsonscripts/__pycache__/lang 參數(tc 或 en),直接輸出對應語言。en 參數:當用戶用英文或非中文語言查詢時,使用 python3 eta.py {ROUTE} {STOP} en。tc 參數:當用戶用中文查詢時,使用 python3 eta.py {ROUTE} {STOP} tc(或省略)。route+stop+lang 組合(例如機場、紅隧、尚德)建議使用短 TTL 快取(約 15–30 秒),連續查詢可直接回應。python3 scripts/eta.py {ROUTE} {STOP_NAME} {LANG}
{ROUTE}: 巴士路線號碼 (e.g., A29, 98D, 118){STOP_NAME}: 站名關鍵字 (e.g., 機場, Airport, 寶琳){LANG}: 語言 - tc (中文) 或 en (英文),預設 enpython3 scripts/eta.py A29 寶琳站 -> 查詢 A29 喺寶琳站嘅下一班車(中文)python3 scripts/eta.py A29 Airport en -> Query A29 at Airport (English)python3 scripts/eta.py 1A 尖沙咀 -> 查詢 1A 喺尖沙咀區內站點當用戶同時查詢多條路線(如「A29同E22A」),必須使用括號包住parallel execution:
cd {skill_dir}/scripts && (python3 eta.py A29 機場 tc & python3 eta.py E22A 機場 tc & wait)
英文查詢時:
cd {skill_dir}/scripts && (python3 eta.py A29 Airport en & python3 eta.py E22A Airport en & wait)
這樣可以 parallel fetch 所有路線嘅 ETA,約 2-3 秒 完成。
python3 scripts/sync_bus_stops.py 更新本地資料庫。[終點站],提醒用家只供落客。HH:mm (min remaining) [OP]. [終點站] / [Terminus].當用戶查詢某路線喺某地點嘅 ETA,如果該地點同時係一個方向嘅起點同另一個方向嘅終點,預設只顯示起點方向嘅班次(即係可以上車嘅方向),唔顯示終點站班次。
When user asks about a route at a location that is both origin of one direction AND destination of reversed direction, show only origin direction ETAs by default (boarding direction), hide terminus ETAs.
只有喺以下情況先顯示終點站班次 / Show terminus ETAs only when:
範例 / Examples:
如果 route+stop 查詢結果為空(無任何 ETA 行),不要向用戶解釋內部原因,直接回覆:
tc: 尾班車已過或未有班次資料en: Service hours have passed / No route information found當同時查詢多條路線,而其中某條無結果時,必須在 fallback 前加上 route label,避免重複訊息無法分辨:
tc 範例:296D:尾班車已過或未有班次資料en 範例:296D: Service hours have passed / No route information found適用情況包括:
⚡ Performance
🧠 Query robustness
🔐 Safety hardening (ClawHub scan friendly)
🧯 No-result fallback (fixed message)
tc: 尾班車已過或未有班次資料en: Service hours have passed / No route information found296D:尾班車已過或未有班次資料)🌐 Language