Skip to content

SetFlag

Referee: set a session flag (content wiring: the lever opens the portcullis).

Full documentation: SetFlag. Wire type: set_flag.

Legal session modes: battle, encounter, exploring, game_over, town

JSON Schema

{
  "description": "Referee: set a session flag (content wiring: the lever opens the portcullis).\n\nReferee commands are legal in every mode. Flags serialize into saves; game\ncode and listeners read them back.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`\n\nRejections:\n    None.\n\nEvents:\n    [`FlagSetEvent`][osrlib.crawl.events.FlagSetEvent] with the key and value.",
  "properties": {
    "command_type": {
      "const": "set_flag",
      "default": "set_flag",
      "title": "Command Type",
      "type": "string"
    },
    "key": {
      "minLength": 1,
      "title": "Key",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "boolean"
        }
      ],
      "title": "Value"
    }
  },
  "required": [
    "key",
    "value"
  ],
  "title": "SetFlag",
  "type": "object"
}