简介
Snake Rodeo
原始描述
Autoplay daemon for the Trifle Snake Rodeo game. Connects to a live game server, authenticates via wallet, and votes on snake directions using pluggable AI s...
通过你的 Agent 添加
安装目录:snake-game/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: snake-game
description: Persistent autoplay daemon for the Trifle Snake game with modular strategy system
version: 3.0.0
metadata:
clawdhub:
emoji: "🐍"
requires:
bins: ["node"]
platforms: ["api"]
depends: ["trifle-auth"]
Snake Game Skill
Play the Trifle Snake game automatically with a persistent daemon and modular strategy system.
Installation
Via ClawdHub
clawdhub install trifle-labs/snake-game
Via Git (symlink method)
# Clone the skills repo
git clone https://github.com/trifle-labs/skills.git ~/repos/trifle-skills
# Symlink to your openclaw workspace
ln -s ~/repos/trifle-skills/snake-game ~/.openclaw/workspace/skills/snake-game
# Make executable
chmod +x ~/.openclaw/workspace/skills/snake-game/snake.mjs
Manual Installation
# Copy to your skills directory
cp -r snake-game ~/.openclaw/workspace/skills/
# Make executable
chmod +x ~/.openclaw/workspace/skills/snake-game/snake.mjs
Prerequisites
- Must be authenticated via
trifle-auth skill first
- Node.js 18+ installed
- Balls balance (earned from games, auth bonuses, etc.)
Quick Start
# Start daemon in foreground
node snake.mjs start
# Start daemon in background (detached)
node snake.mjs start --detach
# Check status
node snake.mjs status
# Stop daemon
node snake.mjs stop
Commands
Daemon Control
snake start [--detach] [--strategy NAME] # Start the autoplay daemon
snake stop # Stop the running daemon
snake status # Show daemon status and stats
snake attach [-f] # View daemon logs (-f to follow)
snake pause # Pause voting (daemon keeps running)
snake resume # Resume voting
Configuration
snake config [key] [value] # Get/set configuration values
snake strategies # List available strategies
snake server [live|staging] # Switch game server
snake telegram [chat_id|off] # Configure Telegram logging
Service Management
snake install-service # Install systemd (Linux) or launchd (macOS)
snake uninstall-service # Remove the service
Game Commands (Manual)
snake state # Get current game state
snake vote <dir> <team> [amount] # Submit a vote manually
snake strategy # Analyze current game
snake balance # Check ball balance
Strategies
# Clone the skills repo
git clone https://github.com/trifle-labs/skills.git ~/repos/trifle-skills
# Symlink to your openclaw workspace
ln -s ~/repos/trifle-skills/snake-game ~/.openclaw/workspace/skills/snake-game
# Make executable
chmod +x ~/.openclaw/workspace/skills/snake-game/snake.mjs
# Copy to your skills directory
cp -r snake-game ~/.openclaw/workspace/skills/
# Make executable
chmod +x ~/.openclaw/workspace/skills/snake-game/snake.mjs
Prerequisites
- Must be authenticated via
trifle-auth skill first
- Node.js 18+ installed
- Balls balance (earned from games, auth bonuses, etc.)
Quick Start
# Start daemon in foreground
node snake.mjs start
# Start daemon in background (detached)
node snake.mjs start --detach
# Check status
node snake.mjs status
# Stop daemon
node snake.mjs stop
Commands
Daemon Control
snake start [--detach] [--strategy NAME] # Start the autoplay daemon
snake stop # Stop the running daemon
snake status # Show daemon status and stats
snake attach [-f] # View daemon logs (-f to follow)
snake pause # Pause voting (daemon keeps running)
snake resume # Resume voting
Configuration
snake config [key] [value] # Get/set configuration values
snake strategies # List available strategies
snake server [live|staging] # Switch game server
snake telegram [chat_id|off] # Configure Telegram logging
Service Management
trifle-auth skill first# Start daemon in foreground
node snake.mjs start
# Start daemon in background (detached)
node snake.mjs start --detach
# Check status
node snake.mjs status
# Stop daemon
node snake.mjs stop
Commands
Daemon Control
snake start [--detach] [--strategy NAME] # Start the autoplay daemon
snake stop # Stop the running daemon
snake status # Show daemon status and stats
snake attach [-f] # View daemon logs (-f to follow)
snake pause # Pause voting (daemon keeps running)
snake resume # Resume voting
Configuration
snake config [key] [value] # Get/set configuration values
snake strategies # List available strategies
snake server [live|staging] # Switch game server
snake telegram [chat_id|off] # Configure Telegram logging
snake install-service # Install systemd (Linux) or launchd (macOS)
snake uninstall-service # Remove the service
Game Commands (Manual)
snake state # Get current game state
snake vote <dir> <team> [amount] # Submit a vote manually
snake strategy # Analyze current game
snake balance # Check ball balance
Strategies
snake state # Get current game state
snake vote <dir> <team> [amount] # Submit a vote manually
snake strategy # Analyze current game
snake balance # Check ball balance
The skill includes 5 built-in strategies:
| Strategy | Alias | Description |
|---|---|---|
| expected-value | ev, default | Maximizes expected value. Balanced. |
| aggressive | agg | High bids on leading teams. |
| underdog | und | Backs small pools for bigger payouts. |
| conservative | con | Minimum bids, prioritizes safety. |
| random | rand | Random valid moves. |
Switch Strategy
snake config strategy aggressive
# or
snake start --strategy aggressive
Creating Custom Strategies
snake config strategy aggressive
# or
snake start --strategy aggressive
Extend BaseStrategy from the snake-rodeo-agents library:
import { BaseStrategy } from 'snake-rodeo-agents';
export class MyStrategy extends BaseStrategy {
constructor(options = {}) {
super('my-strategy', 'Description', options);
}
computeVote(parsed, balance, state) {
// Return { direction, team, amount, reason } to vote
// Return { skip: true, reason } to skip
// Return null to abstain
}
}
Configuration
Key
Default
Description
strategy
expected-value
Active strategy
server
live
live or staging
minBalance
5
Min balance to vote
telegramChatId
null
Telegram chat ID
Process Management
Prevent Multiple Instances
| Key | Default | Description |
|---|---|---|
| strategy | expected-value | Active strategy |
| server | live | live or staging |
| minBalance | 5 | Min balance to vote |
| telegramChatId | null | Telegram chat ID |
Prevent Multiple Instances
Uses PID file to prevent duplicates.
Persist with systemd (Linux)
snake install-service
systemctl --user enable snake-daemon
systemctl --user start snake-daemon
Persist with launchd (macOS)
snake install-service
launchctl load ~/Library/LaunchAgents/com.openclaw.snake-daemon.plist
Architecture
snake install-service
systemctl --user enable snake-daemon
systemctl --user start snake-daemon
snake install-service
launchctl load ~/Library/LaunchAgents/com.openclaw.snake-daemon.plist
Architecture
Game logic, strategies, and the standalone agent library live in snake-rodeo-agents (TypeScript). This skill is an OpenClaw wrapper that provides daemon management, config persistence, and Telegram logging.
snake-game/ # OpenClaw skill wrapper
├── snake.mjs # Main CLI
├── lib/
│ ├── config.mjs # OpenClaw config/paths
│ ├── api.mjs # OpenClaw token-based API
│ ├── process.mjs # Daemon management
│ └── telegram.mjs # Telegram logging
├── daemon/
│ └── autoplay.mjs # Daemon game loop
└── node_modules/
└── snake-rodeo-agents/ # Core library (from GitHub)
└── dist/ # Compiled JS + type declarations
├── index.js # Public API exports
├── lib/game-state.js # Hex grid, BFS, flood-fill
├── lib/strategies/ # Strategy modules
├── lib/client.js # Standalone API client
├── lib/auth.js # Wallet SIWE auth
├── lib/simulator.js # Local game simulator
└── bin/play.js # Standalone CLI runner
Upgrading
To pull the latest snake-rodeo-agents library and restart the daemon:
# 1. Stop the running daemon
node snake.mjs stop
# 2. If the daemon is stuck or was started outside the skill:
# Find and kill it manually
ps aux | grep autoplay
kill <PID>
# Or kill all node snake processes:
pkill -f 'snake-game/daemon/autoplay'
# 3. Update the library
cd ~/.openclaw/workspace/skills/snake-game
npm install github:trifle-labs/snake-rodeo-agents
# 4. Restart
node snake.mjs start --detach
If you installed as a system service:
# Linux (systemd)
systemctl --user restart snake-daemon
# macOS (launchd)
launchctl unload ~/Library/LaunchAgents/com.openclaw.snake-daemon.plist
launchctl load ~/Library/LaunchAgents/com.openclaw.snake-daemon.plist
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。