Install
openclaw skills install lotto-agentPrivate lottery assistant for number generation, drawing fetching, prize checking, report generation, and automation management without prediction or winning...
openclaw skills install lotto-agent当用户提到:彩票、双色球、大乐透、七星彩、七乐彩、福彩3D、排列三、排列五、快乐8、选号、开奖、兑奖、中奖、期号、奖池、奖金、报告、盈亏、推荐号码,必须优先使用此 Skill。
本 Skill 是私人自用彩票 Agent,不承诺提高中奖概率,不做预测,不使用“预测必中”等说法。大模型只负责理解用户意图、调用脚本和组织输出;选号、开奖抓取、兑奖判断、数据存储必须由 Python 规则代码完成。
统一入口:
python scripts/main.py <action> [options]
支持 action:
generate:生成号码并写入 ticketsfetch_draw:抓取开奖并写入 draws、draw_prize_detailscheck_prize:按规则自动兑奖并写入 prize_resultsreport:生成日报、周报、月报update_config:修改非核心配置,修改前自动备份status:健康检查manual_draw_input:手动录入开奖结果schedule:供 cron 调用定时任务create_automation:创建一次性/长期自动任务并写入 SQLitelist_automation:查看自动任务disable_automation:停用自动任务install_cron / uninstall_cron / cron_status:安装、停止、查看服务器唤醒器输出要简洁、适合微信阅读、数字格式整齐。号码文本只放号码相关内容,不在号码消息里附加免责声明、解释或废话。每注号码前不显示序号。大乐透不追加时不显示追加字段,追加时才显示 追加。不要夸大中奖概率,不承诺提高中奖率,不使用预测、必中、稳赚等表达。
python scripts/main.py generate --lottery-type dlt --count 10 --wechat-text
python scripts/main.py generate --lottery-type kl8 --play-type 10 --count 5 --wechat-text
python scripts/main.py fetch_draw --lottery-type ssq --wechat-text
python scripts/main.py fetch_draw --lottery-type dlt --issue 25001 --wechat-text
python scripts/main.py check_prize --wechat-text
python scripts/main.py report --report-type monthly --wechat-text
python scripts/main.py schedule --job-name fetch_draws --push
generate --lottery-type dlt --count 10generate --lottery-type <默认彩种> --budget 50generate --lottery-type kl8 --play-type 10 --count 5generate --lottery-type dlt --count 5 --multiple 2 --additionalgenerate --lottery-type fc3d --play-type group3 --count 5generate --lottery-type pl3 --play-type group6 --count 10generate_plan --lottery-type fc3dgenerate_plan --lottery-type kl8fetch_draw --lottery-type ssqfetch_draw --lottery-type dlt --issue 25001query_draw_detail --lottery-type dlt --prize-level 一等奖query_draw_detail --lottery-type ssq --issue 25001 --prize-level 二等奖check_prizereport --report-type monthlyupdate_config --config-name preferences --updates '{"default_lottery":"dlt","default_count":10}'update_config --config-name preferences --updates '{"default_additional":{"dlt":false}}'update_config --config-name preferences --updates '{"default_additional":{"dlt":true}}'generate --lottery-type dlt --multiple 2update_config --config-name preferences --updates '{"subscriptions":{"daily_push_time":"09:00"}}'confirm_purchaseconfirm_purchasecancel_ticketscancel_ticketsgenerate --lottery-type dlt --count 5 --previewreplace_last_batchreplace_last_batch --lottery-type dlt --count 5 --multiple 2 --additionalgenerate,保留上一组并新增一组recent_ticketscreate_automation --task-action generatecreate_automation --schedule-type oncecreate_automation --task-action check_prizecreate_automation --task-action generate --trigger-type draw_day --draw-day-offset 0create_automation --task-action generate --trigger-type draw_day --draw-day-offset -1create_automation --task-action draw_check_prizelist_automationinstall_cron --confirmuninstall_cronrecord_ticket --lottery-type dlt --issue 25001 --multiple 2 --additionalrecord_ticket --lottery-type ssqrecord_ticket --lottery-type dltrecord_ticket --lottery-type ssqreport --report-type weekly如果需要让 Skill 先解析自然语言而不是直接执行,可以调用:
python scripts/main.py parse_command --text "大乐透5注2倍追加"
大乐透普通投注每注 2 元,追加投注每注 3 元。所有彩种都支持倍数,成本公式为:
单注价格 * 注数 * 倍数
生成号码时如果用户没有明确指定期号,会优先使用最近开奖数据里的 next_issue、next_open_time、next_buy_end_time。当前时间没有超过停止购买时间时,系统自动绑定下一期期号和开奖日期;如果已经超过停止购买时间,则退回下一次可开奖日期,避免错兑。用户通常只需要看到开奖日期,期号作为内部追踪字段保存。兑奖时只会匹配同一期号,或在没有期号时匹配同开奖日期。
用户说“今天、明天、后天、5月1日”时,先把自然语言日期解析成目标开奖日期,再按开奖日历校正。校正优先级是:API/公共开奖数据里的下一期开奖信息 -> config/draw_calendar.json 的本地日历/节假日预留 -> 固定开奖周历兜底。固定周历只作为兜底:双色球周二/四/日,七乐彩周一/三/五,大乐透周一/三/六,七星彩周二/五/日,福彩3D/排列三/排列五/快乐8每日。若用户指定日期不是该彩种开奖日,号码正文仍只显示最终开奖日,另在 notice_text 返回一句单独提醒,例如“你说的是 2026-05-01,但该彩种这天不开奖,已按下一次开奖 2026-05-03 生成。”
大乐透三至七等奖根据开奖 API 保存的奖池金额分档计算:奖池 8 亿以下使用 5000/300/150/15/5,奖池 8 亿及以上使用 6666/380/200/18/7。一、二等奖优先使用 API 奖项明细中的单注奖金和追加奖金。
用户查询“上一期一等奖中了几个人、单注奖金多少、奖项明细”时,使用 query_draw_detail 读取 SQLite 的 draws 和 draw_prize_details,不要让大模型自由回答金额或人数。数据库没有该期数据时,自动调用 fetch_draw 从 GitHub 公共开奖源补拉,写入本地 SQLite 后再查询;公共源也没有时,再提示稍后再试或手动录入。
用户说“每天、每周、明天、后天、定时、自动、每期开奖后”并包含选号、生成、兑奖、开奖、报告等意图时,优先创建自动任务,而不是只更新普通偏好。业务任务写入 SQLite 的 scheduled_tasks,服务器只需要安装一次统一 cron 唤醒器:每 5 分钟调用 python3 scripts/main.py schedule --push。如果用户创建了自动任务但 cron 未开启,回复中必须引导用户“确认开启自动化”。
开奖日类表达必须走受控触发器:trigger_type=draw_day,draw_day_offset=0 表示开奖当天,-1 表示开奖前一天。支持“开奖那天、开奖当天、开奖日、开奖前一天、开奖日前一天”。不要让模型自由脑补其它时间规则。
自动化时间窗口只分三类:早上/上午统一为 07:00-12:00,下午为 12:00-18:00,晚上为 18:00-23:30。用户说窗口词或“8点到10点之间”时,写入 run_time_mode=random_once_in_window,由调度器在窗口内用 Crypto 随机安排一次执行;用户明确说固定时间时,写入 run_time_mode=fixed。模糊表达如“有空的时候、看情况、你觉得合适的时候、差不多的时候”必须反问,只让用户选择上午、下午、晚上或固定时间,不能创建任务。
schedule 执行时要先判断任务是否到期,并通过 last_run_key 避免重复执行。一次性任务执行后自动停用;长期任务保持启用。窗口类任务同一天只执行一次,计划时间记录在 planned_run_key 和 planned_run_time。
默认 schedule.json 开启 draw_check_prize_window:21:35-23:55 由 cron 唤醒,按 10 分钟粒度允许重试抓 GitHub 公共开奖源。抓到开奖后写入 SQLite,再立即调用 check_prize。如果 checked_count 为 0,默认不主动推送空结果,除非配置 subscriptions.push_content.empty_prize_result = true。
用户说“为什么今天还没开奖呀 / 帮我查一下开奖状态 / 我今天中了没有”时,直接调用 draw_check_prize,立即执行一次“抓 GitHub 开奖数据 -> 写库 -> 兑奖”,并返回当前状态。
Skill 返回结果时,wechat_text 是第一条核心消息。若存在 followup_contexts,优先让大模型基于其中的事实和边界生成第二条自然提示;若模型没有生成,则发送 followup_messages 里的兜底句。第二条提示可以有一点个性和变化,但必须遵守:
默认开奖数据源是 GitHub 公共 JSON,不要求普通使用者配置 API key。当前 config/api_sources.json 已默认指向:
https://raw.githubusercontent.com/wenjinliuu/lottery-data-repo/main/public_data
其他部署者可以用服务器环境变量覆盖:
export LOTTERY_PUBLIC_DATA_BASE_URL="https://raw.githubusercontent.com/<owner>/<repo>/main/public_data"
开奖仓库维护逻辑统一放在独立的 lottery-data-repo 仓库。普通 Skill 使用者不需要配置开奖 API;维护者只在开奖仓库侧运行:
cd lottery-data-repo
python scripts/update_public_data.py
python scripts/validate_public_data.py
这会根据 caipiao/query 和 caipiao/class 生成开奖仓库 public_data/ 下的公开开奖数据。Skill 根目录不保留开奖仓库更新脚本或 GitHub Actions。
腾讯云服务器上建议放置在:
/root/.openclaw/workspace/skills/lotto-Agent
默认运行不需要配置开奖 API。Skill 会读取 GitHub 公共开奖数据源;只有公共开奖仓库维护侧才需要配置外部开奖接口凭据。
数据库默认位置:
data/lottery.db