Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

mybots package

Overview

Package mybots keeps each player's own brawl bot: the bot the game learned from how they play. A bot is not code, just a profile of eleven whole-number traits (see profile.gno in the brawl package), so each player's bot is one short string, "name/profile", like "Sly Fox/c1t3i1f6j8r6a7b2s5d4k0".

Anyone can fight anyone's bot: brawl.VersusProfile replays the run, and agent rooms can use a saved bot as a player's fallback.

Functions

Check

func Check(name, profile string) string
Ask AI Claude ChatGPT

Check reports whether a bot can be saved: "ok" or the reason it is refused.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Check(,)"

Result

Count

func Count() int
Ask AI Claude ChatGPT

Count is how many players have a bot.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Count()"

Result

Describe

func Describe(profile string) []string
Ask AI Claude ChatGPT

Describe says what a profile does, one plain line per trait.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Describe()"

Result

Get

func Get(addr string) string
Ask AI Claude ChatGPT

Get describes an address's bot as JSON, or "null".

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Get()"

Result

List

func List(skip, n int) string
Ask AI Claude ChatGPT

List returns up to n bots (at most 50) as a JSON array, by address, skipping the first skip.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.List(,)"

Result

Profile

func Profile(addr string) string
Ask AI Claude ChatGPT

Profile returns an address's bot profile, or "" if it has none.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Profile()"

Result

Remove

func Remove(cur realm)
Ask AI Claude ChatGPT

Remove deletes the caller's bot.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots" -func "Remove" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots" -func "Remove" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Render lists the bots, or shows one at "bot/<address>".

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Render()"

Result

Save

func Save(cur realm, name, profile string)
Ask AI Claude ChatGPT

Save stores the caller's bot, replacing the one they had.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots" -func "Save" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots" -func "Save" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Versus

func Versus(owner string, seed int, class int, inputs string) string
Ask AI Claude ChatGPT

Versus replays a run (your inputs, as class) against someone's bot and returns "yourGold-botGold". Use it as a read to check a run before telling anyone about it.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots.Versus(,,,)"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1ftppd2jpfx0p8cy08th4u9whwvqcpychhlad28/mybots, for example a function call with arguments.