package rooms // Help describes the whole protocol as JSON: every call with its arguments, // the phases, the plan words, typical gas, and the errors you can hit. Agents // can read it once instead of reading the source. func Help() string { return `{ "realm": "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/rooms/v3", "faucet": "Free testnet GNOT: https://faucet.gno.land (or gno_faucet_fund in the Gno MCP server). About 2 GNOT covers a whole match.", "flow": ["Create or Join", "each round: StateJSON -> PlanPreview (try plans) -> Seal(PlanHash(plan, salt)) with the plan text exactly as you will reveal it -> wait for phase revealing -> Reveal", "LastResult after each round", "the match ends after the last round"], "calls": { "Create(name string, class int, fallback int, rounds int, seconds int, phaseBlocks int) int": "open a room; returns its id. rounds 3-8 (5), seconds 60-300 (120), phaseBlocks 15-1000 (40)", "Join(id int, name string, class int, fallback int)": "take the second place; the match starts", "Seal(id int, hash string)": "send PlanHash(plan, salt). Allowed while sealing, and late while revealing if you haven't sealed. Same hash again is a safe no-op", "Reveal(id int, plan string, salt string, thought string)": "send the plan, the salt and a thought (140 chars). Same reveal again is a safe no-op", "Spar(name string, class int, fallback int, profile string, rounds int, seconds int, phaseBlocks int) int": "a solo room against a bot that plays a learned style (profile from LearnStyle); each round plays as soon as you reveal", "Advance(id int)": "anyone, after the deadline: moves sealing on to revealing (late sealers can still act), or plays the round with bots for whoever didn't reveal" }, "reads": { "Help() string": "this", "StateJSON(id int) string": "phase, round/rounds, blocksLeft, secondsLeft, allowedActions per player, fighters, coins [square,value], power [square,kind]; square = y*15+x", "PlanPreview(id int, side int, plans string) string": "simulate up to 8 plans joined by || for side 0 (A) or 1 (B) over the next round; the rival plays the plan they revealed last round (or their fallback bot if they have none); returns rival model, gain, rivalGain and end positions", "PlanPreviewVs(id int, side int, plans string, rival string) string": "PlanPreview with the rival model chosen: last, bot, or a style profile (pass LearnStyle(id, rivalSide) as it is)", "Debrief(id int, side int) string": "replay a room and explain how side 0 (A) or 1 (B) did, round by round, with advice", "LearnStyle(id int, side int) string": "turn a side's play in a room into a bot profile, to spar against with Spar", "LastResult(id int) string": "last round: each side's plan, thought, gold before/after, end position, whether its bot played", "InputsJSON(id int) string": "all inputs and thoughts so far; replays the match exactly", "PlanHash(plan string, salt string) string": "hex sha256 of plan|salt", "Compile(text string, max int) string": "optional: turn a plan of keystroke words only (run, wait, buttons) into keys: input characters. Smart plans (goto, collect, guard, ...) are never compiled: seal and reveal their text", "Open() string": "rooms waiting for a player", "RoomCount() int": "rooms ever created" }, "phases": ["waiting", "sealing", "revealing", "done"], "classes": {"0": "hunter (long shot: knocks 1 gold loose and dazes, up to 5 squares)", "1": "brawler (haymaker: knocks 2 loose, stuns)", "2": "coward (jetpack dash with a shield)", "3": "trickster (feint: parry, or knock 1 loose)", "4": "reader (coin magnet: pulls 2 coins within 4, recharges in 3s)"}, "fighting": "a landed hit knocks the victim's coins onto the floor nearby (usually closest to the hitter); attacking into a block costs you a coin that goes to the blocker; 3 hits in a row within 2s each stun the rival; while one side leads by 15+, hits on the leader knock out double and new coins land in the trailer's half", "fallback": {"0": "easy bot", "1": "normal bot", "2": "hard bot", "3": "your bot saved in mybots"}, "board": "15x15 squares; 1000 units per square; x grows east, y grows south; side A starts NW, side B SE; 10 ticks per second", "plan": { "format": "plain text steps separated by ; or new lines, at most 500 characters; or keys: followed by one input character per tick", "words": ["run ", "wait ", "attack", "block", "special", "dodge", "goto , [ticks]", "collect ", "chase ", "flee ", "if near : ", "auto ", "guard on", "guard off"], "notes": "ticks are 1 to 300; squares x,y are 0-14; distances take up to two decimals (melee reach is 1.45); goto slides round tables and ends on arrival; collect heads for the nearest gold; auto lets the Normal house bot play; guard on makes every later step block by itself when the rival is within 1.5 squares and can swing, until guard off; a bad step is refused with an error naming it" }, "gas": {"Create": "about 8M", "Join": "about 17M", "Seal": "about 8M", "Reveal": "about 10M", "Reveal or Advance that plays the round": "180M to 320M in live matches; it depends on both plans", "tip": "use gas-wanted 500000000 for Reveal and Advance (unused gas is not charged); a tx that runs out of gas does nothing"}, "errors": { "room #N is revealing, not revealing (seal first; see allowedActions)": "check allowedActions in StateJSON before each call", "seal a plan before revealing it": "Seal comes first, even late", "this plan and salt don't match your seal": "reveal exactly the plan and salt you hashed", "too early: N blocks left": "the deadline hasn't passed; wait or act", "you already sealed a different plan this round": "one plan per round" } }` }