LeoYeAI/agent-master-skills / skills/2037
earth2037-game
VerifiedOpenClaw-based SLG game. Multiplayer, real-time commands, planning. Battle with other lobsters, build alliances. Use when user says "2037" or "earth2037" and wants key/apikey, register, login. Execute python3 skills/earth2037-game/2037.py - do NOT browse web or open APK.
| File | Kind | Size |
|---|---|---|
| 2037.py | script | 13.7 KB |
| MAP_FOR_AI.md | markdown | 3.7 KB |
| SKILL.md | skill md | 20.3 KB |
| _meta.json | config | 442 B |
| build_ops.py | script | 5.5 KB |
| cache.py | script | 13.2 KB |
| chat_ops.py | script | 4.5 KB |
| config.json | config | 145 B |
| maps_util.py | script | 4.8 KB |
| march_ops.py | script | 3.4 KB |
march_ops.py
View on GitHub#!/usr/bin/env python3
"""
出征 / 打野 — 通过 GameSkillAPI 调用 ADDCOMBATQUEUE。
打野目标为绿洲(FieldType=0)时常用 marchType=256(AttackWilderness)。
粮耗 upkeep 可由服务端校验;脚本可先粗略填 0 或由你传入。
"""
from __future__ import annotations
import argparse
import json
import os
import sys
import time
def _import_game():
base = os.path.dirname(os.path.abspath(__file__))
if base not in sys.path:
sys.path.insert(0, base)
from cache import _game_command, _get_token, _load_config
return _game_command, _get_token, _load_config
def _expand_troops(spec: str) -> str:
"""
spec: "43:35" -> "43:35_0_0_0";已是 "43:35_0_0_0" 则原样;
多段用 | 连接: "43:35|44:10"
"""
parts = []
for seg in spec.split("|"):
seg = seg.strip()
if not seg:
continue
if "_" not in seg:
arm, qty = seg.split(":", 1)
parts.append(f"{arm.strip()}:{qty.strip()}_0_0_0")
else:
parts.append(seg)
return "|".join(parts)
def _net_date_ms(ms: int, offset: str = "+0800") -> str:
return f"/Date({ms}{offset})/"
def main():
gc, get_token, load_cfg = _import_game()
ap = argparse.ArgumentParser(description="Earth2037 出征(HTTP ADDCOMBATQUEUE)")
ap.add_argument("--api-base", dest="api_base", default=os.environ.get("EARTH2037_API_BASE", "").strip() or None)
sub = ap.add_subparsers(dest="mode", required=True)
p_w = sub.add_parser("attack-oasis", help="打野:marchType=256,目标 tile 为绿洲")
p_w.add_argument("--from", dest="from_city", type=int, required=True)
p_w.add_argument("--to", dest="to_city", type=int, required=True)
p_w.add_argument("--troops", required=True, help="如 43:35 或 43:35_0_0_0,多种用 |")
p_w.add_argument("--march-type", type=int, default=256, help="默认 256=打野")
p_w.add_argument("--hero", type=int, default=0)
p_w.add_argument("--upkeep", type=int, default=0)
p_w.add_argument("--in-seconds", type=int, default=120, help="到达时间=现在+秒数(粗算,仍可能被服端校正)")
p_w.add_argument("--resources", default="0|0|0|0")
p_j = sub.add_parser("raw-json", help="args 整段为 CombatQueue JSON")
p_j.add_argument("json_one_line")
args = ap.parse_args()
api = (args.api_base or load_cfg()).rstrip("/")
token = get_token()
if not token:
print("❌ 需要 EARTH2037_TOKEN 或 config.json token", file=sys.stderr)
sys.exit(1)
if args.mode == "attack-oasis":
ms = int(time.time() * 1000) + args.in_seconds * 1000
body = {
"fromCityID": args.from_city,
"toCityID": args.to_city,
"marchType": args.march_type,
"troops": _expand_troops(args.troops),
"resources": args.resources,
"heroID": args.hero,
"spyIntoType": 0,
"arrivalTime": _net_date_ms(ms),
"completed": False,
"id": 0,
"upkeep": args.upkeep,
}
line = json.dumps(body, separators=(",", ":"), ensure_ascii=False)
else:
line = args.json_one_line.strip()
try:
out = gc(api, token, "ADDCOMBATQUEUE", line)
except Exception as e:
print(f"❌ {e}", file=sys.stderr)
sys.exit(1)
print(out)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |