{
  "abi": 1,
  "version": "0.2.22",
  "functions": [
    {
      "name": "after",
      "group": "events",
      "since": "0.1.5",
      "doc": "Runs `fn` once, `seconds` of game time later.",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": false
        }
      ],
      "returns": "integer id",
      "multi": false,
      "permission": null
    },
    {
      "name": "audio.play",
      "group": "audio",
      "since": "0.2.22",
      "doc": "Plays a WAV file of the plugin's folder. `opts`: `volume` (1), `pitch` (1), `loop`, `range` (metres heard at full volume, 5), and either `x, y, z` (a sound at a map point) or `on_bus = true` (it moves with the player's bus); none: heard alike everywhere. The game's volume setting applies. A plugin plays 32 at most.",
      "params": [
        {
          "name": "file",
          "type": "string",
          "optional": false
        },
        {
          "name": "opts",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "integer id or nil, reason",
      "multi": true,
      "permission": "audio"
    },
    {
      "name": "audio.playing",
      "group": "audio",
      "since": "0.2.22",
      "doc": "Whether a sound of the plugin's still plays.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "audio.set",
      "group": "audio",
      "since": "0.2.22",
      "doc": "Changes a sound of the plugin's: `volume`, `pitch`, `range`, `x, y, z` / `on_bus`.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "opts",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "audio"
    },
    {
      "name": "audio.stop",
      "group": "audio",
      "since": "0.2.22",
      "doc": "Stops a sound of the plugin's.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "audio"
    },
    {
      "name": "audio.stop_all",
      "group": "audio",
      "since": "0.2.22",
      "doc": "Stops every sound of the plugin's.",
      "params": [],
      "returns": "nil",
      "multi": false,
      "permission": "audio"
    },
    {
      "name": "audio.volume",
      "group": "audio",
      "since": "0.2.22",
      "doc": "The game's volume setting, 0 to 1.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "body_frame",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's body now, as the last simulation step left it: its origin (map metres) and its model's axes in the world - right, forward and up, each a unit vector - with the heading, the climb and the lean on the springs in them. A point of the model at (mx, my, mz) is at origin + mx·right + my·forward + mz·up. `section` 1, 2, ... is a section coupled behind (an articulated bus's rear one). Nothing on foot.",
      "params": [
        {
          "name": "section",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "x, y, z, rx, ry, rz, fx, fy, fz, ux, uy, uz",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.acceleration",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Its acceleration in its own frame, m/s² without gravity: to the right, forwards, up.",
      "params": [],
      "returns": "across, along, up",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.action",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "A key action of the vehicles (`[vehicles]` of keyboard.cfg: `horn`, `parking_brake_toggle`, `kw_scheinwerfer_toggle`, `blinker_left_set`, `ticket_give`, ...): pressed and let go, or held (`down` true) and let go (`false`). `true` when the bus knows it.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "down",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.controls",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "What the bus drives with now: the pedals (0 to 1) and the steering (-1 left to 1 right), from the keys, the mouse or a controller.",
      "params": [],
      "returns": "throttle, brake, clutch, steering",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.damage",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "`{crashes, last_impact_kj, repair_minutes}`: the bus's crashes, the energy of the last one and how long a repair would take (`nil`: nothing to repair).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.destination",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The destination the bus shows and its index in `destinations` (nothing when none).",
      "params": [],
      "returns": "name, index",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.destinations",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The destinations of the bus's depot file: `{index, code, name, all_exit}` (`index` from 1, for `set_destination`).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.dirt",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "How dirty the bus is, 0 (clean) to 1.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.door",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether door leaf `n` (from 1) is open.",
      "params": [
        {
          "name": "n",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.door_count",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The doorways the door keys work, front to back.",
      "params": [],
      "returns": "integer",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.doors",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Each door leaf's position, front to back: 0 shut, 1 open (the scripts' `door_0`, `door_1`, ...).",
      "params": [],
      "returns": "list of numbers",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.doors_open",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether any door is open (by the passengers' door flags where the bus has them).",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.electrics",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the bus's electrics are on (the main switch).",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.engine",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The engine: whether it runs, its rpm (where the bus shows one) and whether the electrics are on.",
      "params": [],
      "returns": "running, rpm, electrics",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.engine_running",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the engine runs.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.file",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's `.bus` file, relative to the game folder.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.fuel",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The fuel in the tank, litres (the scripts' `engine_tank_content`).",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.gear",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The gear engaged (-1 reverse, 0 neutral), where the bus shows one.",
      "params": [],
      "returns": "integer or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.get_strings",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The same for string variables.",
      "params": [
        {
          "name": "names",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.get_vars",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Many script variables at once: a table name -> value of the names given, or of every variable of the bus without a list.",
      "params": [
        {
          "name": "names",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.handbrake",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the parking brake is on.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.headlights",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The headlights: 0 off, 1 side lights, 2 dipped, 3 high beam.",
      "params": [],
      "returns": "integer or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.horn",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the horn sounds.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.indicator",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The indicators: `\"off\"`, `\"left\"`, `\"right\"` or `\"hazard\"`.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.interior_light",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The passenger room's light, 0 (off) to 1.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.km_today",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Kilometres driven this session (as the personnel file counts them).",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.kneeling",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the bus kneels.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.mass",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's mass in kg.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.number",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's fleet number.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.odometer",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's odometer in km.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.orientation",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Heading (degrees clockwise from north), pitch (nose up positive) and bank (right side down positive).",
      "params": [],
      "returns": "heading, pitch, bank",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.passengers",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The people aboard the bus: all, sitting, standing.",
      "params": [],
      "returns": "total, seated, standing",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.play_sound",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Plays the bus's own sound of this event (a trigger name of its sound files, `ev_...`).",
      "params": [
        {
          "name": "event",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.retarder",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The retarder's step, where the bus has one.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.rpm",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The engine's revolutions per minute.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.sales",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Tickets sold this session and the money taken (the game knows no currency).",
      "params": [],
      "returns": "tickets, money",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.set_destination",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Shows destination `index` (from 1, as `destinations` lists them).",
      "params": [
        {
          "name": "index",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.set_indicator",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Sets the indicators: `\"off\"`, `\"left\"`, `\"right\"` or `\"hazard\"`.",
      "params": [
        {
          "name": "state",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.set_interior_light",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Switches the passenger room's light on or off.",
      "params": [
        {
          "name": "on",
          "type": "bool",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.set_line",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Types a line (route) into the bus's IBIS, as the player would.",
      "params": [
        {
          "name": "line",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.set_vars",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Sets many script variables at once (a table name -> number); how many the bus has.",
      "params": [
        {
          "name": "values",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "integer",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.shift",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Puts a manual gearbox's lever in a gear (-1 reverse, 0 neutral).",
      "params": [
        {
          "name": "gear",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.sound_horn",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Holds the horn (`true`) or lets it go.",
      "params": [
        {
          "name": "down",
          "type": "bool",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.start_up",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Starts the bus up the way Shift+U does (the battery, the electrics, the engine) - or shuts a running bus down; what the game says it does.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.state",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Everything a dashboard shows, in one table: `speed` (km/h, signed), `gear`, `engine` (running), `rpm`, `electrics`, `doors_open`, `indicator`, `headlights`, `dirt`, `passengers`, `odometer`, `km_today`, `throttle`, `brake`, `clutch`, `steering`, `fuel`, `handbrake`, `horn`, `stop_request` (a key is `nil` where the bus does not have it).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.steering_angle",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The front wheels' angle and the most they turn, degrees (right positive).",
      "params": [],
      "returns": "angle, max",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.stop_brake",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether the stop brake (the door brake) holds the bus.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.stop_requested",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Whether a passenger has asked to stop.",
      "params": [],
      "returns": "boolean or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.ticket_request",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The ticket the passenger at the cash desk asks for (nothing when nobody asks).",
      "params": [],
      "returns": "name, price",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.tickets",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The tickets the map sells: `{name, price, day_ticket}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.toggle_door",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Presses the key of doorway `n` (from 1; 0 or none: all doors), as the player would.",
      "params": [
        {
          "name": "n",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.toggle_handbrake",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Puts the parking brake on or off, as its key does.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "bus.track",
      "group": "vehicle",
      "since": "0.3.55",
      "doc": "Where the player's rail vehicle (tram, metro, train) is on its track, as distances along it rather than x and y: `{lane, s, lane_length, forward, travelled}` - the track (an index into the map's lanes), the metres from its start and its length, whether the vehicle faces the track's direction, and the net metres it has moved along the tracks since it was put on them (they go down, below zero too, while it backs up). `nil` for a road vehicle. A plugin can work out block sections, distances to a signal or a stop, or a train protection system from it.",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.trailers",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Parts coupled behind the bus (an articulated bus's rear counts).",
      "params": [],
      "returns": "integer or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.triggers",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The names of the bus's script triggers (for `trigger`, `press`).",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.velocity",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "The bus's speed in km/h, negative backwards.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "bus.velocity_vector",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Its velocity in the world, m/s (x east, y north, z up).",
      "params": [],
      "returns": "x, y, z",
      "multi": true,
      "permission": null
    },
    {
      "name": "bus.wheels",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Each wheel: `{axle, side, rpm, radius, suspension, driven}` (`side` 0 left, 1 right; `suspension` the spring's travel).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "cable.clear",
      "group": "scene",
      "since": "0.2.22",
      "doc": "Takes every cable of the plugin away; how many went. They go by themselves when the plugin stops.",
      "params": [],
      "returns": "integer",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "cable.remove",
      "group": "scene",
      "since": "0.2.22",
      "doc": "Takes the cable `id` away; `true` when there was one.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "cable.set",
      "group": "scene",
      "since": "0.2.22",
      "doc": "Lays the cable `id` or moves it: a thin round tube through `points` (a flat list `{x1, y1, z1, x2, ...}` or a list of `{x, y, z}`, metres), lit and shaded as the scene. `options`: `radius` (m, default 0.006), `color` (`{r, g, b}` or `{r, g, b, a}`, 0 to 1, default dark grey) and `frame`: `\"world\"` (the map's coordinates, z up; the default) or `\"bus\"` (the player's bus's model frame: x right, y forward, z up, so a rope tied to the bus moves with it as drawn). Set it again whenever it moves; `false` (and the cable stays as it was) when the plugin would have more than 4096 cables, or more than 65536 points in all its cables together.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        },
        {
          "name": "points",
          "type": "table",
          "optional": false
        },
        {
          "name": "options",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "camera.fov",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Its vertical field of view, degrees.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "camera.get",
      "group": "camera",
      "since": "0.2.22",
      "doc": "The camera: `{view, x, y, z, yaw, pitch, roll, fov, in_cab, zoom, look_yaw, look_pitch, width, height}` - map metres, degrees (yaw clockwise from north, pitch up positive), the vertical field of view, the picture's pixels.",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "camera.in_cab",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Whether the camera is in the player's own bus (driver or passenger view).",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "camera.look",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Turns the head (driver, passenger view) or swings the outside camera round the bus: degrees from straight ahead.",
      "params": [
        {
          "name": "yaw",
          "type": "number",
          "optional": false
        },
        {
          "name": "pitch",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "camera"
    },
    {
      "name": "camera.orientation",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Where it looks, degrees.",
      "params": [],
      "returns": "yaw, pitch, roll",
      "multi": true,
      "permission": null
    },
    {
      "name": "camera.position",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Where the camera is (map metres).",
      "params": [],
      "returns": "x, y, z",
      "multi": true,
      "permission": null
    },
    {
      "name": "camera.project",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Where a map point is seen on the screen, in the panels' pixels (as `ui.screen` measures them); nothing when it is behind the camera. For labels over buses, stops, people.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "screen_x, screen_y",
      "multi": true,
      "permission": null
    },
    {
      "name": "camera.set_free",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Puts the free camera at a map point looking along `yaw` and `pitch` (degrees); the view becomes `\"free\"` (the player moves it on from there).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": false
        },
        {
          "name": "yaw",
          "type": "number",
          "optional": true
        },
        {
          "name": "pitch",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "camera"
    },
    {
      "name": "camera.set_view",
      "group": "camera",
      "since": "0.2.22",
      "doc": "Switches the view: `\"driver\"`, `\"pax\"`, `\"outside\"`, `\"map\"` (the free camera above the bus), `\"ego\"` (walking), or a `view_*` action of keyboard.cfg.",
      "params": [
        {
          "name": "view",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "camera"
    },
    {
      "name": "camera.set_zoom",
      "group": "camera",
      "since": "0.2.22",
      "doc": "The zoom of the view now (its field of view times this, 0.2 to 3).",
      "params": [
        {
          "name": "zoom",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "camera"
    },
    {
      "name": "camera.view",
      "group": "camera",
      "since": "0.2.22",
      "doc": "The view: `\"driver\"`, `\"pax\"`, `\"outside\"`, `\"free\"` or `\"foot\"`.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "cancel",
      "group": "events",
      "since": "0.1.5",
      "doc": "Stops a timer, a watch or a hotkey; `true` when there was one.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "clock",
      "group": "time",
      "since": "0.1.10",
      "doc": "The game's time of day as `\"HH:MM:SS\"`.",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "command",
      "group": "game",
      "since": "0.1.10",
      "doc": "Does what a line of the game menu does: `refuel`, `wash`, `repair`, `shot`, `save`, `load`, `weather`, `later`, `earlier`, `info`, `timetable`, `reset`, `couple`, `uncouple`; `true` when the game knows it (it runs after the frame).",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "debug",
      "group": "game",
      "since": "0.2.22",
      "doc": "A line of the log's debug level (shown with `RUST_LOG=debug`).",
      "params": [
        {
          "name": "...",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "distance",
      "group": "vehicle",
      "since": "0.1.10",
      "doc": "Metres from the bus to a map point, or `nil` on foot.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.active",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Whether the player drives a duty (a line and tour of the timetable).",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.at_stop",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Whether the bus stands at the next stop (within 25 m of it).",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.delay",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Seconds the bus is late (early negative), worked out between the stops as the game's timetable does.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.finish",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Gives the duty up (the bus drives on without a timetable); `true` when there was one.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "duty.get",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The duty now: `line`, `tour`, `trip` (its number in the duty, from 1), `trips`, `trip_name`, `terminus`, `departure`, `arrival`, `stops`, `next_stop` and `previous_stop` (each a stop: `{number, name, id, arrival, departure, stops, x, y, z}`), `at_stop`, `trip_done`, `delay` (seconds, late positive).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.next_stop",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The next stop of the trip (as `duty.stops` gives them).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.set_auto_ibis",
      "group": "duty",
      "since": "0.3.41",
      "doc": "Whether the game types the duty into the bus's IBIS by itself - line, route, destination and the stop, at Shift+U and `--autostart` and again as each trip begins (on as a bus is taken). Off, the driver types them, or the plugin with `duty.type_ibis`. For the bus the player drives now, and while the plugin runs: when it stops or is switched off the game types the IBIS again, unless another plugin still leaves it to the driver. Off lasts for that bus only: after a change of vehicle (the `vehicle` event) the game types the new one's IBIS again, so a plugin that leaves it to the driver calls `duty.set_auto_ibis(false)` again there. `true` when there is a bus.",
      "params": [
        {
          "name": "on",
          "type": "bool",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "duty.set_closed_stops",
      "group": "duty",
      "since": "0.3.36",
      "doc": "Closes stops of the duty's route for today - a diversion, roadworks: a list of their names (on every trip of the duty), and the way round them (`via`). The navigator strikes them through and shows `via` for the next one; the bus does not call there, and the duty goes on past them without counting them missed (no `stops_skipped`). Each call replaces the list (64 names at most), an empty one opens them all again; a duty taken anew (`duty.start`) starts with none. `duty.stops` marks them `closed`. `true` when there is a duty.",
      "params": [
        {
          "name": "stops",
          "type": "table",
          "optional": false
        },
        {
          "name": "via",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "duty.skip_stop",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Skips the next stop (the duty goes on to the one after); the name of the stop skipped.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "duty.skip_to",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Makes stop `stop` (from 1) of the trip the next one, forwards or back.",
      "params": [
        {
          "name": "stop",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "duty.start",
      "group": "duty",
      "since": "0.2.22",
      "doc": "Takes a duty, as the game menu's \"Line and tour\" does: a line and tour of `timetable.lines`, its trip (from 1 in the order they leave; default the first) and the stop to start at (from 1 among those the trip calls at; default the first). The bus stays where it is.",
      "params": [
        {
          "name": "line",
          "type": "string",
          "optional": false
        },
        {
          "name": "tour",
          "type": "string",
          "optional": false
        },
        {
          "name": "trip",
          "type": "integer",
          "optional": true
        },
        {
          "name": "stop",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "world_write"
    },
    {
      "name": "duty.stops",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The stops of the trip now: `{number, name, id, arrival, departure, stops, closed, passed, x, y, z}` (`stops` false: the bus passes it; `closed`: closed today, `duty.set_closed_stops`; `x, y, z` where the stop's place is known; `id` the map's object id).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.tour",
      "group": "duty",
      "since": "0.3.40",
      "doc": "The complete source tour of the selected duty, even when only one trip was selected. Same structure as `timetable.tour`; times align with the active duty's service day, with `time_offset` seconds applied to all trips and stops.",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.trip_stops",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The stops of a trip of the duty (from 1), as `duty.stops` gives them.",
      "params": [
        {
          "name": "trip",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "list of tables or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.trips",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The trips of the duty: `{number, name, line, terminus, departure, arrival, stops}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "duty.type_ibis",
      "group": "duty",
      "since": "0.3.41",
      "doc": "Types the trip under way into the bus's IBIS now - line, route, destination and the stop the bus is at - as Shift+U does (`bus.set_line` types the line only); with `duty.set_auto_ibis` on, the next trips follow by themselves. `true` when there is a duty and a bus.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "emit",
      "group": "events",
      "since": "0.1.5",
      "doc": "Sends an event to this plugin's own handlers at once (handy between the modules of a bigger plugin); an error of a handler is this call's.",
      "params": [
        {
          "name": "event",
          "type": "string",
          "optional": false
        },
        {
          "name": "...",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "error",
      "group": "game",
      "since": "0.2.22",
      "doc": "The same as an error line (the plugin goes on).",
      "params": [
        {
          "name": "...",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "every",
      "group": "events",
      "since": "0.1.5",
      "doc": "Runs `fn` every `seconds` of game time.",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": false
        }
      ],
      "returns": "integer id",
      "multi": false,
      "permission": null
    },
    {
      "name": "files.append",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Adds to the end of a file of the data folder (a log, a CSV of trips).",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        },
        {
          "name": "data",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "storage"
    },
    {
      "name": "files.delete",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Removes a file or an empty folder of the data folder.",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "files.dir",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Where the data folder is on this computer (to tell the player; the plugin reaches it with relative paths only).",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "files.exists",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Whether the data folder has this file or folder.",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "files.list",
      "group": "storage",
      "since": "0.2.22",
      "doc": "The entries of the data folder (or a folder in it): `{name, dir, size}`.",
      "params": [
        {
          "name": "dir",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "list of tables, or nil and the reason",
      "multi": true,
      "permission": "storage"
    },
    {
      "name": "files.mkdir",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Makes a folder (and those above it) in the data folder.",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "files.read",
      "group": "storage",
      "since": "0.2.22",
      "doc": "A file of the plugin's data folder (`path` relative to it; `..` and absolute paths are refused).",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "text, or nil and the reason",
      "multi": true,
      "permission": "storage"
    },
    {
      "name": "files.write",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Writes a file of the data folder (its folders are made); at most 16 MB at once and 256 MB in all.",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        },
        {
          "name": "data",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "storage"
    },
    {
      "name": "fmt.clock",
      "group": "util",
      "since": "0.2.22",
      "doc": "Seconds since midnight as `\"HH:MM\"` (`\"HH:MM:SS\"` with `true`); past midnight wraps.",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": false
        },
        {
          "name": "with_seconds",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.delay",
      "group": "util",
      "since": "0.2.22",
      "doc": "A delay as a timetable display shows it: `\"+2:30\"` late, `\"-0:45\"` early, `\"0:00\"`.",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.distance",
      "group": "util",
      "since": "0.2.22",
      "doc": "A distance as `\"350 m\"` or `\"2.4 km\"`.",
      "params": [
        {
          "name": "metres",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.duration",
      "group": "util",
      "since": "0.2.22",
      "doc": "A length of time as people read it: `\"45 s\"`, `\"3 min 05 s\"`, `\"1 h 20 min\"` (negative with a minus).",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.money",
      "group": "util",
      "since": "0.2.22",
      "doc": "An amount with two decimals and a currency symbol after it (`\"12.50 €\"`; the game knows no currency of its own).",
      "params": [
        {
          "name": "amount",
          "type": "number",
          "optional": false
        },
        {
          "name": "symbol",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.number",
      "group": "util",
      "since": "0.2.22",
      "doc": "A number with `decimals` (0) and a thousands `separator` (`\",\"`, `\" \"`; none by default).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "decimals",
          "type": "integer",
          "optional": true
        },
        {
          "name": "separator",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.pad",
      "group": "util",
      "since": "0.2.22",
      "doc": "A text made `width` characters long with spaces (on the left with `right` = true, to line numbers up), or cut to it.",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        },
        {
          "name": "width",
          "type": "integer",
          "optional": false
        },
        {
          "name": "right",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.speed",
      "group": "util",
      "since": "0.2.22",
      "doc": "A speed as `\"42 km/h\"`, or in `\"mph\"` or `\"m/s\"`.",
      "params": [
        {
          "name": "kmh",
          "type": "number",
          "optional": false
        },
        {
          "name": "unit",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.split",
      "group": "util",
      "since": "0.2.22",
      "doc": "A text cut at every `separator` (`\",\"` by default; plainly, no patterns).",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        },
        {
          "name": "separator",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "fmt.trim",
      "group": "util",
      "since": "0.2.22",
      "doc": "A text without the spaces at its ends.",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.action",
      "group": "game",
      "since": "0.2.22",
      "doc": "A game action of keyboard.cfg's `[game]` (`sim_pause`, `view_set_map`, `view_toggle_informationdisplay`, `view_set_schedule`, ...), as its key does; `true` when the game knows it.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "game.api",
      "group": "game",
      "since": "0.2.22",
      "doc": "The version of the plugin interface (`api_abi` of an `.oop`; raised only when something is taken away or changes).",
      "params": [],
      "returns": "integer",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.fps",
      "group": "game",
      "since": "0.2.22",
      "doc": "Frames a second now.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.has",
      "group": "game",
      "since": "0.2.22",
      "doc": "Whether this game has an API function (`\"weather.set\"`): for a plugin that should also run in an older openOMSI.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.menu_open",
      "group": "game",
      "since": "0.2.22",
      "doc": "Whether the game menu is open.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.notify",
      "group": "game",
      "since": "0.2.22",
      "doc": "A notification of the game's own (the cards the server's messages use): `kind` `\"info\"`, `\"warning\"` or `\"alert\"`.",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        },
        {
          "name": "kind",
          "type": "string",
          "optional": true
        },
        {
          "name": "seconds",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "game.platform",
      "group": "game",
      "since": "0.2.22",
      "doc": "The system the game runs on: `\"windows\"`, `\"macos\"`, `\"linux\"`, `\"android\"`.",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.queries",
      "group": "data",
      "since": "0.3.40",
      "doc": "Read-only game data getters: `{name, args = {{name, type}, ...}, result}`. Names and zero-based indices follow the M.V. getter names, but plugins read the game data directly without executing scripts. `rgba` means four results in the range 0–255.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.query",
      "group": "data",
      "since": "0.3.40",
      "doc": "Read a getter listed by `game.queries` from the player's vehicle's HOF, timetable, passengers, tickets, radio, fonts or textures. Arguments are an ordered list (empty by default). No script callback is invoked. `STReadPixel` returns RGBA without changing the bus's drawing colour. Supply a loaded scripted map object's id as `object` to read its data, including `GetArrBus*` on departure boards, without needing a player vehicle. Object ids can be found through `map.objects_near`. Without `object`, reads use the player's vehicle. Unknown names, mutating operations and invalid arguments raise an error; no vehicle returns nil and a reason.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "args",
          "type": "table",
          "optional": true
        },
        {
          "name": "object",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "value(s), or nil and reason",
      "multi": true,
      "permission": null
    },
    {
      "name": "game.screenshot",
      "group": "game",
      "since": "0.2.22",
      "doc": "Takes a screenshot with the next frame, as the camera key does; the file it goes to (the `screenshot` event says when it is there).",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "game.settings",
      "group": "game",
      "since": "0.2.22",
      "doc": "The settings a plugin may read: `graphics` (`\"vanilla\"`, `\"vanilla_plus\"`, `\"enhanced\"`), `language` (the cockpit's, `\"ENG\"`), `ui_language`, `ui_scale`, `volume`, `fov`, `render_scale`, `max_fps`, `fullscreen`, `vsync`, `msaa`, `shadows`, `time_speed`, `units` (`\"metric\"`: speeds are km/h everywhere), ...",
      "params": [],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.stats",
      "group": "game",
      "since": "0.2.22",
      "doc": "This session's counts, as the personnel file has them: `km`, `stops_served`, `stops_skipped`, `crashes`, `heavy_crashes`, `pedestrians`, `tickets`, `cash`, `passengers`, ...",
      "params": [],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "game.version",
      "group": "game",
      "since": "0.2.22",
      "doc": "The game's version (`\"0.2.22\"`).",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "has_vehicle",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "`true` while the player drives a vehicle.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "hof.busstop",
      "group": "hof",
      "since": "0.3.40",
      "doc": "The first bus stop whose `identifier` exactly matches the supplied HOF stop identifier. Returns `{index, identifier, strings}`; `index` is zero-based for `GetBusstopString` and `strings[1]` is getter field 0. Returns nil without a vehicle, HOF or match.",
      "params": [
        {
          "name": "identifier",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "hof.get",
      "group": "hof",
      "since": "0.3.40",
      "doc": "A snapshot of every parsed field of the player's loaded HOF: `path`, `name`, `service_trip`, `global_strings`, `string_count_terminus`, `string_count_busstop`, `termini`, `bus_stops`, `info_trips`, `info_busstop_lists`, `info_busstops`. Records include their zero-based `index`; Lua arrays (including strings) start at 1. Returns nil without a vehicle or HOF. No filesystem access or scripts are involved; retain the snapshot until the vehicle or HOF changes.",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "hof.terminus",
      "group": "hof",
      "since": "0.3.40",
      "doc": "The first terminus whose internal `identifier` exactly matches the supplied timetable terminus, using the same case-sensitive comparison as `GetTTTerminusIndex`. Returns `{index, code, identifier, terminus_stop, all_exit, strings}`; `index` is zero-based for `GetTerminusString`, `strings[1]` is getter field 0, and `terminus_stop` is nil when absent. Returns nil without a vehicle, HOF or match; does not change the duty or destination.",
      "params": [
        {
          "name": "identifier",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "info",
      "group": "game",
      "since": "0.1.10",
      "doc": "What the game is doing: `map`, `clock` (seconds since midnight), `day`, `year`, `view`, `paused`, `on_foot`, `multiplayer`, `traffic`, `speed`, `delay`, `map_path`, `version`; with a bus also `tile_x`, `tile_y`, `tile_pos_x`, `tile_pos_y`, `heading`, `vehicle_manufacturer`, `vehicle_model`, `destination`, `passengers`; `crashes`, `heavy_crashes`, `pedestrians_hit`; `situation`; on a duty also `line`, `tour`, `trip`, `trips`, `trip_name`, `terminus`, `stops`, `trip_done`, `next_stop`, `next_stop_number`, `next_stop_arrival`, `next_stop_departure`, `next_stop_id`, `at_stop`, `previous_stop`, `previous_stop_id`, `next_stop_distance`, `next_stop_distance_nav`, `previous_stop_distance` (see the plugin docs for each).",
      "params": [],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "info_value",
      "group": "game",
      "since": "0.2.22",
      "doc": "One value of `info()` without building the whole table: cheaper for a plugin that reads one or two every frame.",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "any",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.bindings",
      "group": "input",
      "since": "0.2.22",
      "doc": "The key bindings: `{action, key}` of the game's keys, or the vehicles' with `true` (`key` as the game writes it: `\"Ctrl+D\"`).",
      "params": [
        {
          "name": "vehicles",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.controllers",
      "group": "input",
      "since": "0.2.22",
      "doc": "The steering wheels, pedals, joysticks and gamepads: `{name, gamepad, axes, buttons}` (`axes` each axis's value; `buttons` how many it has - the `controller_button` event tells presses).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.hotkey",
      "group": "input",
      "since": "0.2.22",
      "doc": "Runs `fn(key)` when a key combination is pressed: `\"F10\"`, `\"Ctrl+KeyH\"`, `\"Shift+Alt+Digit1\"` (modifiers exact: `\"KeyH\"` is not `Ctrl+KeyH`). The keys still reach the bus. `cancel(id)` removes it.",
      "params": [
        {
          "name": "keys",
          "type": "string",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": false
        }
      ],
      "returns": "integer id",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.key_down",
      "group": "input",
      "since": "0.2.22",
      "doc": "Whether a key is held now (winit's names, as the `key` event: `\"KeyW\"`, `\"ShiftLeft\"`, `\"F5\"`).",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.keys_down",
      "group": "input",
      "since": "0.2.22",
      "doc": "Every key held now.",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "input.mouse",
      "group": "input",
      "since": "0.2.22",
      "doc": "The mouse: where it is in the panels' pixels and its buttons held.",
      "params": [],
      "returns": "x, y, left, right, middle",
      "multi": true,
      "permission": null
    },
    {
      "name": "json.decode",
      "group": "util",
      "since": "0.2.22",
      "doc": "Reads JSON text: objects and arrays become tables, `null` nil.",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "value, or nil and the reason",
      "multi": true,
      "permission": null
    },
    {
      "name": "json.encode",
      "group": "util",
      "since": "0.2.22",
      "doc": "A value as JSON text (a list as an array, a table with keys as an object; `pretty`: indented).",
      "params": [
        {
          "name": "value",
          "type": "any",
          "optional": false
        },
        {
          "name": "pretty",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "lan.active",
      "group": "lan",
      "since": "0.2.22",
      "doc": "Whether this game is in a LAN session.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "lan.chat",
      "group": "lan",
      "since": "0.2.22",
      "doc": "Says a line in the session's chat, as the player would (every player sees it; at most one a second).",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "lan"
    },
    {
      "name": "lan.me",
      "group": "lan",
      "since": "0.2.22",
      "doc": "This player in the session: its id (the host is 1), its name, whether it hosts.",
      "params": [],
      "returns": "id, name, host",
      "multi": true,
      "permission": null
    },
    {
      "name": "lan.players",
      "group": "lan",
      "since": "0.2.22",
      "doc": "The other players of the session: `{id, name, host, bus, line, tour, x, y, z, heading, speed, on_foot, passengers}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "lan.send",
      "group": "lan",
      "since": "0.2.22",
      "doc": "Sends a short text (at most 120 characters, no `|`) to the same plugin on another player's game (`to` its id; 0: every other player); it hears `lan_message(from, text)`. A player sends at most about ten a second; a game without the plugin ignores them.",
      "params": [
        {
          "name": "to",
          "type": "integer",
          "optional": false
        },
        {
          "name": "text",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "lan"
    },
    {
      "name": "log",
      "group": "game",
      "since": "0.1.5",
      "doc": "A line in `game.log`, tagged `[lua <name>]` (`print` does the same).",
      "params": [
        {
          "name": "...",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.entrypoints",
      "group": "map",
      "since": "0.2.22",
      "doc": "The map's start points: `{index, name, x, y, z, heading}` (`index` from 1; the place where the game has read its tile).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.ground",
      "group": "map",
      "since": "0.2.22",
      "doc": "The height of the ground (the road where there is one, else the terrain) at a map point, where its tile is loaded.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.info",
      "group": "map",
      "since": "0.2.22",
      "doc": "`{name, friendly_name, path, left_hand_traffic, tile_size}`: the map's names, its global.cfg and the side it drives on.",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.lane",
      "group": "map",
      "since": "0.2.22",
      "doc": "The traffic lane nearest to a map point: `{index, distance, speed_limit, name, traffic_light}`.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.name",
      "group": "map",
      "since": "0.2.22",
      "doc": "The map's name (its folder's).",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.object",
      "group": "map",
      "since": "0.2.22",
      "doc": "Where a map object is, by its id (a stop's id of the timetable, say); nothing when the game has not read its tile.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "x, y, z, heading",
      "multi": true,
      "permission": null
    },
    {
      "name": "map.objects_near",
      "group": "map",
      "since": "0.2.22",
      "doc": "The map objects within `radius` m (default 50, at most 2000 of them, nearest first): `{id, x, y, z, heading, distance}`.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "radius",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.place_on_road",
      "group": "map",
      "since": "0.2.22",
      "doc": "Puts the player's bus on the street nearest to a map point (within 300 m), along it.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "map.speed_limit",
      "group": "map",
      "since": "0.2.22",
      "doc": "The speed limit (km/h) of the lane the player's bus drives on (`nil` off the lanes).",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.stops",
      "group": "map",
      "since": "0.2.22",
      "doc": "The bus stops of the tiles loaded (around the camera): `{id, name, x, y, z, heading}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.teleport",
      "group": "map",
      "since": "0.2.22",
      "doc": "Moves the player's bus to a map point (z none: onto the highest ground there) facing `heading` (default north), as the game menu's move does; the `service` event says `teleport`.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": true
        },
        {
          "name": "heading",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "map.teleport_to",
      "group": "map",
      "since": "0.2.22",
      "doc": "Moves the player's bus to start point `index` (from 1, as `map.entrypoints` lists them).",
      "params": [
        {
          "name": "index",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "map.terrain",
      "group": "map",
      "since": "0.2.22",
      "doc": "The terrain's height alone at a map point.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.tile",
      "group": "map",
      "since": "0.2.22",
      "doc": "The tile the player's bus is on (nothing on foot).",
      "params": [],
      "returns": "tile_x, tile_y",
      "multi": true,
      "permission": null
    },
    {
      "name": "map.tile_at",
      "group": "map",
      "since": "0.2.22",
      "doc": "The tile of a map point and the metres in it (x east, y north).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "tile_x, tile_y, local_x, local_y",
      "multi": true,
      "permission": null
    },
    {
      "name": "map.tiles",
      "group": "map",
      "since": "0.2.22",
      "doc": "The map's tiles: `{x, y, file, loaded}` (numbered as global.cfg's `[map]` list).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "map.to_world",
      "group": "map",
      "since": "0.2.22",
      "doc": "A place given by its tile and the metres in it, in map coordinates.",
      "params": [
        {
          "name": "tile_x",
          "type": "integer",
          "optional": false
        },
        {
          "name": "tile_y",
          "type": "integer",
          "optional": false
        },
        {
          "name": "local_x",
          "type": "number",
          "optional": false
        },
        {
          "name": "local_y",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "x, y",
      "multi": true,
      "permission": null
    },
    {
      "name": "mesh_point",
      "group": "vehicle",
      "since": "0.2.22",
      "doc": "Where a point of one of the bus's meshes is now, in map metres: `mesh` names the mesh's file (`\"sht_bashmak.o3d\"`, or a part of its path), `x, y, z` is the point in the model's frame (x right, y forward, z up) as the mesh stands at rest; its animations and the body's lean move it. `section` (0, the default) looks in a section coupled behind instead (1, 2, ...: an articulated bus's rear part), its point in that section's model frame. For a plugin that lines a part of the bus up with something outside it. Nothing when the bus or the section has no such mesh, or `mesh` is empty.",
      "params": [
        {
          "name": "mesh",
          "type": "string",
          "optional": false
        },
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": false
        },
        {
          "name": "section",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "x, y, z",
      "multi": true,
      "permission": null
    },
    {
      "name": "message",
      "group": "ui",
      "since": "0.1.5",
      "doc": "A line of text on the screen (5 seconds when not given).",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        },
        {
          "name": "seconds",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "object.info",
      "group": "object",
      "since": "0.2.22",
      "doc": "`{id, type, x, y, z, heading, active, distance}` of an object: its type (the `.sco` file's name), where it stands (map coordinates), the way it faces (compass degrees), whether it is in the script's range and how far the listener is from it (m).",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.list",
      "group": "object",
      "since": "0.2.22",
      "doc": "The ids of the objects this script drives that are loaded now (those within its range are active).",
      "params": [],
      "returns": "list of numbers",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.meshes",
      "group": "object",
      "since": "0.2.22",
      "doc": "The mesh files of an object, in the order the scripts number them from 1.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.set_mesh",
      "group": "object",
      "since": "0.2.22",
      "doc": "Moves, turns and scales one mesh of an object over what its animations do. `mesh` is its number from 1 or its file name; `transform` is `{x, y, z, rx, ry, rz, sx, sy, sz, px, py, pz}`: a move in metres, a turn about the x, y and z axes in degrees (z up, positive counter-clockwise seen from above), a scale, all about the point (px, py, pz) of the mesh, every key optional. Without a table the mesh is as the model has it. Objects with a script are redrawn every frame; moving a mesh costs nothing more.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "mesh",
          "type": "string",
          "optional": false
        },
        {
          "name": "transform",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.set_str",
      "group": "object",
      "since": "0.2.22",
      "doc": "Sets a string variable of an object (a display's text, a texture's name).",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.set_var",
      "group": "object",
      "since": "0.2.22",
      "doc": "Sets a script variable of an object, which its `[newanim]` animations, `[visible]` conditions, materials, lamps and sounds read; false when it has none of that name.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.set_vars",
      "group": "object",
      "since": "0.2.22",
      "doc": "Sets many variables of an object at once (a table name -> number); how many it has.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "values",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "integer",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.set_visible",
      "group": "object",
      "since": "0.2.22",
      "doc": "Shows or hides one mesh of an object whatever its `[visible]` conditions say; without `visible` the conditions decide again.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "mesh",
          "type": "string",
          "optional": false
        },
        {
          "name": "visible",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.str",
      "group": "object",
      "since": "0.2.22",
      "doc": "A string variable of an object.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.trigger",
      "group": "object",
      "since": "0.2.22",
      "doc": "Runs a `{trigger:name}` of the object's own `.osc` script; false when it has none.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "object.var",
      "group": "object",
      "since": "0.2.22",
      "doc": "A script variable of an object (those its `[varnamelist]` declares, and the builtin ones: `Switch`, `InUse`, `NightlightA` ...); `nil` when it has none of that name.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "off",
      "group": "events",
      "since": "0.1.5",
      "doc": "Removes a handler added with `on`.",
      "params": [
        {
          "name": "event",
          "type": "string",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": false
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "on",
      "group": "events",
      "since": "0.1.5",
      "doc": "Adds a handler of an event (see the events); several may hear one event, in the order they were added.",
      "params": [
        {
          "name": "event",
          "type": "string",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": false
        }
      ],
      "returns": "the function",
      "multi": false,
      "permission": null
    },
    {
      "name": "other_body_frame",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "`body_frame` of one of `others`: its body now, origin and axes.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "section",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "x, y, z, rx, ry, rz, fx, fy, fz, ux, uy, uz",
      "multi": true,
      "permission": null
    },
    {
      "name": "other_mesh_point",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "`mesh_point` of one of `others`: where a point of one of its meshes (or, with `section`, of one of its coupled sections') is now.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "mesh",
          "type": "string",
          "optional": false
        },
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": false
        },
        {
          "name": "section",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "x, y, z",
      "multi": true,
      "permission": null
    },
    {
      "name": "other_var",
      "group": "traffic",
      "since": "0.2.21",
      "doc": "A script variable of one of `others`, or `nil`.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "others",
      "group": "traffic",
      "since": "0.2.21",
      "doc": "The other vehicles within `radius` m of the bus (default 300): each `{id, kind, name, x, y, z, heading}`, `kind` being `\"ai\"` (the traffic) or `\"player\"` (another player's bus in a LAN game); empty on foot.",
      "params": [
        {
          "name": "radius",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "people.counts",
      "group": "people",
      "since": "0.2.22",
      "doc": "The people of the map near the camera: walking, waiting at stops, riding a bus.",
      "params": [],
      "returns": "walking, waiting, riding",
      "multi": true,
      "permission": null
    },
    {
      "name": "people.density",
      "group": "people",
      "since": "0.2.22",
      "doc": "The people setting: 0 to 3, 1 the map's own amount.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "people.get",
      "group": "people",
      "since": "0.3",
      "doc": "One person by id, as `people.list` gives them, and more: `stop_name` (the timetable's name of the stop they wait or waited at), `ticket` (the name of the ticket they ask for), `ticket_kind` (`\"none\"`, `\"stamp\"`, `\"buy\"`), `ticket_index` (the ticket pack's, from 1; 0 none), `ticket_price`, `ticket_voice`, `ticket_by` (the plugin that changed it), `ticket_asked` (asked for at the cash desk already), `tag` (`people.set_ticket`'s), `age`, `model` (the `.hum` file), `voice` (its voice folder). `people.list` gives the same fields.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "people.list",
      "group": "people",
      "since": "0.2.22",
      "doc": "The people (within `radius` m of the player's bus, when given): `{id, x, y, z, state, aboard, ai_bus, stop, destination, ticket, complaint}`. `state`: `\"strolling\"`, `\"idle\"`, `\"standing\"`, `\"waiting\"`, `\"to_bus\"`, `\"boarding\"`, `\"riding\"`, `\"seated\"`, `\"leaving\"`, `\"to_stop\"`; `aboard` in the player's bus; `complaint` 0 to 3 (3: they leave); and the fields `people.get` describes.",
      "params": [
        {
          "name": "radius",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "people.set_density",
      "group": "people",
      "since": "0.2.22",
      "doc": "Changes the people setting (0 to 3).",
      "params": [
        {
          "name": "value",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "traffic_write"
    },
    {
      "name": "people.set_ticket",
      "group": "people",
      "since": "0.3",
      "doc": "Changes the ticket of a passenger boarding the player's bus (the `passenger_ticket` event names them): `{kind, ticket, name, price, payment, voice, tag}`, each optional. `kind` (`\"none\"`: a pass, `\"stamp\"`, `\"buy\"`) can only be changed until they are in the bus; `ticket` selects another ticket from the pack (starting at 1, with its name and price; a buyer must have a ticket: 0 is refused, and a buyer created without `ticket` gets the pack's ticket for their age). `name` and `price` set the ticket name and ticket price, respectively, until the passenger has asked at the cash desk. `payment` specifies the amount of money handed over for a ticket purchase; it does not change the ticket price and is raised to at least the ticket price. It must be set before the passenger reaches the cash desk. If the currency's denominations cannot represent the requested amount exactly, the amount handed over may be higher. `voice` selects a line from the passenger's voice folder to use instead of `Ticket_<n>_<k>` (`\"Zone_4\"` selects `Zone_4.wav`; if the file is missing, the usual line is used; `\"\"` also falls back to the usual line), until the passenger has asked at the cash desk. `tag` is plugin-defined text kept with the person (`people.get`), and can be set at any time. Returns `false` and the reason when nothing changed.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "ticket",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "traffic_write"
    },
    {
      "name": "people.stops",
      "group": "people",
      "since": "0.2.22",
      "doc": "The stops near the camera where people wait: `{id, name, x, y, z, waiting}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "people.waiting",
      "group": "people",
      "since": "0.2.22",
      "doc": "How many people wait at a stop (its map object id).",
      "params": [
        {
          "name": "stop",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "integer",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.broadcast",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Sends a message to every other plugin loaded.",
      "params": [
        {
          "name": "topic",
          "type": "string",
          "optional": false
        },
        {
          "name": "data",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.disable",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Switches the plugin off until its file changes or the game starts again (its `stop` comes).",
      "params": [
        {
          "name": "reason",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.errors",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "How many errors the plugin had (at 10 it is switched off).",
      "params": [],
      "returns": "integer",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.files",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "The files of the plugin's own folder (or a folder in it): `{name, dir, size}`.",
      "params": [
        {
          "name": "dir",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.list",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "The names of the plugins loaded, this one too.",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.name",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "The plugin's name: its file's, or its folder's for a `main.lua`.",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.permissions",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "The permissions the plugin has (native process access additionally requires player opt-in).",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.read",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "A file of the plugin's own folder (a table of stops, a translation): read only, relative to the folder.",
      "params": [
        {
          "name": "path",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "text, or nil and the reason",
      "multi": true,
      "permission": null
    },
    {
      "name": "plugin.send",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Sends a message to another plugin (by its name): it hears `message(from, topic, data)` in its next frame. The data is numbers, texts, booleans or tables of them.",
      "params": [
        {
          "name": "to",
          "type": "string",
          "optional": false
        },
        {
          "name": "topic",
          "type": "string",
          "optional": false
        },
        {
          "name": "data",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.set_setting",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Changes a setting (held to its range; saved); `true` when it took the value.",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "any",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.setting",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "A setting's value (`nil`: no such setting).",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "any",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.settings",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Declares the plugin's settings: a list of `{key, type, label, default}` with `type` `\"bool\"`, `\"number\"` (`min`, `max`, `step`), `\"text\"` or `\"choice\"` (`choices`, a list of texts). The values the player chose before come back (as a table key -> value); the game makes a settings panel of them (`plugin.show_settings`), saves them in the data folder and sends `setting(key, value)` when one changes.",
      "params": [
        {
          "name": "settings",
          "type": "table",
          "optional": false
        },
        {
          "name": "title",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "plugin.show_settings",
      "group": "plugin",
      "since": "0.2.22",
      "doc": "Shows the plugin's settings panel (or hides it with `false`); it can be dragged and closed while the panels have the mouse (`ui.focus`). `false` when the plugin declared no settings.",
      "params": [
        {
          "name": "on",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "position",
      "group": "vehicle",
      "since": "0.1.10",
      "doc": "Where the bus is: map metres (x east, y north, z up) and its heading in degrees clockwise from north; nothing on foot.",
      "params": [],
      "returns": "x, y, z, heading",
      "multi": true,
      "permission": null
    },
    {
      "name": "press",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "Holds a key of the bus down: fires the trigger `name` (let it go with `release`).",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "process.exit_code",
      "group": "process",
      "since": "unreleased",
      "doc": "Nonblocking exit code lookup (queued verification also counts as running): `nil, \"running\"` while running; `code, \"exited\"` after normal exit. A nonzero code is retained. Signal termination returns `nil, \"exited\"`; inspect `process.status` for details. Preparation failure returns `nil, \"failed\", reason`. An unknown handle returns `nil` and a reason.",
      "params": [
        {
          "name": "handle",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "code or nil, state or reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "process.forget",
      "group": "process",
      "since": "unreleased",
      "doc": "Release a completed or failed process handle and its retained result. A running process cannot be forgotten. On Windows, closing its job also terminates any remaining descendants.",
      "params": [
        {
          "name": "handle",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "true, or nil and reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "process.kill",
      "group": "process",
      "since": "unreleased",
      "doc": "Cancel a queued start or request termination of a plugin-owned direct child without waiting. Poll `process.status` for completion; Windows also terminates the job descendants, Unix targets only the direct child.",
      "params": [
        {
          "name": "handle",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "true, or nil and reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "process.start",
      "group": "process",
      "since": "unreleased",
      "doc": "Queue a native helper without waiting; return a reserved handle immediately. The interactive game asks the player with Allow once, Always allow or Deny unless the exact content was already approved. Embedded hosts without a permission broker remain default-deny. Verification and OS process creation run on two shared workers with at most 32 globally queued starts. The 32-handle plugin limit (including queued and failed starts) is checked before admission. A full queue returns nil and a reason. Accepted starts can fail later: inspect status.error or exit_code/wait returning nil, failed, reason. `file` must be a relative path inside the plugin folder. Approval is bound to the entry, folder snapshot and helper SHA256. Allow once covers one launch; Always allow saves consent in the host user settings; Deny blocks all native helpers for this canonical plugin entry for the current session, including renamed helpers or changed content or arguments. Changed content needs new approval. While the dialog is open, preparation workers and child cleanup keep running. The entry, executable-content snapshot (including importable Lua modules and native libraries), and helper hashes are rechecked on the worker immediately before each start; code changes revoke consent, while ordinary save/data writes do not. `args` are separate literal strings without shell expansion. Options: `cwd` and `env` (string overrides, other variables inherited, except OMSI_PLUGIN_PROCESS_ALLOW is always removed). Standard streams are disconnected. Windows helpers must be .exe files. At most 32 handles per plugin; forget completed handles. Stop, disable and reload terminate children; Windows job objects also terminate descendants and survive abrupt game exit, Linux uses a parent-death signal for direct children. No native helper runs before player approval. OMSI_PLUGIN_PROCESS_ALLOW can optionally name an absolute JSON grant manifest for preapproved content. Packages must also declare process. Unload/reload cancels unanswered requests. Approved helpers run with the game account's permissions.",
      "params": [
        {
          "name": "file",
          "type": "string",
          "optional": false
        },
        {
          "name": "args",
          "type": "table",
          "optional": true
        },
        {
          "name": "options",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "handle, or nil and reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "process.status",
      "group": "process",
      "since": "unreleased",
      "doc": "Nonblocking status: `{pid, starting, awaiting_permission, running, exited, failed, error, code, success, signal}`. While verification/start is pending, starting and running are true and pid is nil. Failed preparation sets failed/error without an exit code. While running `code`, `success` and `signal` are nil. After exit `code` is the exit code (including nonzero); termination by a signal has no code, and `signal` is available on Unix. Results remain readable until forgotten.",
      "params": [
        {
          "name": "handle",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "table, or nil and reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "process.wait",
      "group": "process",
      "since": "unreleased",
      "doc": "Lua: suspend this plugin through queued verification/start and until its direct child exits, then return `code, \"exited\"` (nonzero codes retained; nil code on signal exit). The game and other plugins keep running; no game-thread wait occurs. Works in the main chunk, start/frame/event handlers and timers. Queued callbacks resume afterwards (limit 256), and normal frames/timers pause during the wait. Stop/reload cancels the continuation and terminates the child. A nested `emit` callback or manually resumed coroutine cannot suspend. Preparation failure returns `nil, \"failed\", reason`. Other language bindings should poll `process.exit_code` instead.",
      "params": [
        {
          "name": "handle",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "exit code or nil, state or reason",
      "multi": true,
      "permission": "process"
    },
    {
      "name": "release",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "Lets a key go: fires `<name>_off`.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "send",
      "group": "network",
      "since": "0.2.21",
      "doc": "Sends `data` as one UDP datagram to `127.0.0.1:port`: to another program on this computer, never over the network. Not sent when the port is below 1024 or one of the game's multiplayer ports (27015-27024), the message is longer than 8 KB, or the plugin sent 100 in the last second.",
      "params": [
        {
          "name": "port",
          "type": "integer",
          "optional": false
        },
        {
          "name": "data",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "network_local"
    },
    {
      "name": "set_other_var",
      "group": "traffic",
      "since": "0.2.21",
      "doc": "Sets a script variable of one of `others`; `true` when that vehicle has it. An AI vehicle keeps it until its scripts write it again; another player's bus takes its values from the network again.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "traffic_write"
    },
    {
      "name": "set_str",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "Sets a string variable; `true` when the bus has it.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "text",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "set_var",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "Sets a script variable; `true` when the bus has that variable.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "speed",
      "group": "vehicle",
      "since": "0.1.10",
      "doc": "The bus's speed in km/h, forwards or backwards (0 on foot).",
      "params": [],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "storage.all",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Everything stored, as one table.",
      "params": [],
      "returns": "table",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.clear",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Removes every key.",
      "params": [],
      "returns": "nil",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.delete",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Removes a key; `true` when it was there.",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.get",
      "group": "storage",
      "since": "0.2.22",
      "doc": "A value the plugin stored, or `nil`. The storage is the plugin's own and survives the session (kept as `storage.json` in its data folder).",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "any",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.keys",
      "group": "storage",
      "since": "0.2.22",
      "doc": "The keys stored, in the order they were first set.",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.save",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Writes the storage now (it is written by itself when the game ends).",
      "params": [],
      "returns": "nil",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "storage.set",
      "group": "storage",
      "since": "0.2.22",
      "doc": "Stores a value under a key: a number, text, boolean or a table of them (`nil` removes it). It is written when the game ends, the plugin is loaded again, or `storage.save()` is called.",
      "params": [
        {
          "name": "key",
          "type": "string",
          "optional": false
        },
        {
          "name": "value",
          "type": "any",
          "optional": false
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": "storage"
    },
    {
      "name": "str",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "A string variable of the bus's scripts (`IBIS_terminus_name`).",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "sys",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "A system variable of the scripts: `Time`, `Day`, `Weather_Temperature`, `SunAlt`, ... (read only).",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "time",
      "group": "events",
      "since": "0.1.5",
      "doc": "Seconds of game time since the plugin started (stands still while paused).",
      "params": [],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "timetable.buses",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The timetable buses of the AI on the road: `{id, line, tour, trip, terminus, departure, next_stop_id, at_stop, trip_done, delay, x, y, number}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "timetable.lines",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The map's lines: `{name, user_allowed, tours}`, each tour `{number, today, trips}` (`today`: it runs on the game's date).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "timetable.stop_names",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The stops the timetable knows: `{id, name}` (`id` the map's object id).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "timetable.stops",
      "group": "duty",
      "since": "0.2.22",
      "doc": "The stops of a tour's trips (or of its trip `trip`, from 1 in the order they leave) that the bus calls at: `{trip, station, name, departure}`.",
      "params": [
        {
          "name": "line",
          "type": "string",
          "optional": false
        },
        {
          "name": "tour",
          "type": "string",
          "optional": false
        },
        {
          "name": "trip",
          "type": "integer",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "timetable.tour",
      "group": "duty",
      "since": "0.3.40",
      "doc": "Read a full tour without taking it: `{line, number, ai_group, extra, today, time_offset, trips}`. Each trip has `number`, `source_number` (both from 1), `name`, `line`, `terminus`, `track`, `reverse`, `profile_index` (from 0), `profile` (`name`, `factor`), `departure`, `arrival`, and all `stops` (`id`, `name`, `arrival`, `departure`, `stops`, optional `x,y,z`). Times are seconds from service-day midnight and can exceed 86400; passing stops are retained. Unknown trip references are skipped, retaining their source numbers. No AI vehicle is reserved.",
      "params": [
        {
          "name": "line",
          "type": "string",
          "optional": false
        },
        {
          "name": "tour",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "table, or nil and reason",
      "multi": true,
      "permission": null
    },
    {
      "name": "traffic.ahead",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "The AI vehicle ahead of the player's bus within `reach` m (default 100) and 20° of its heading, with its `distance`: for a distance warning or a cruise control.",
      "params": [
        {
          "name": "reach",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "traffic.clear",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "Takes every car not running to a timetable off the road; how many went.",
      "params": [],
      "returns": "integer or nil",
      "multi": false,
      "permission": "traffic_write"
    },
    {
      "name": "traffic.counts",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "The AI vehicles: driving, timetable buses among them, asleep out of range, parked.",
      "params": [],
      "returns": "driving, buses, asleep, parked",
      "multi": true,
      "permission": null
    },
    {
      "name": "traffic.density",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "How many cars the traffic keeps around the camera, and the share of them that do not run to a timetable (0 to 1).",
      "params": [],
      "returns": "cars, share",
      "multi": true,
      "permission": null
    },
    {
      "name": "traffic.get",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "One AI vehicle by its id, as `traffic.list` gives them.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "traffic.light_ahead",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "The traffic light the player's bus comes to within `reach` m (default 80): `{aspect, change_in, distance}` - `aspect` `\"red\"`, `\"red_yellow\"`, `\"green\"`, `\"green_yellow\"`, `\"yellow\"` or `\"dark\"`, `change_in` the seconds to its next change.",
      "params": [
        {
          "name": "reach",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "traffic.list",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "The AI vehicles (within `radius` m of the player's bus, when given): `{id, kind, name, x, y, z, heading, speed, max_speed, waiting_for, standing, braking, blinker, line, bounding_box, distance}`. `kind`: `\"car\"`, `\"taxi\"`, `\"bus\"`, `\"truck\"`, `\"timetable_bus\"`, `\"tram\"`, `\"bicycle\"`; `waiting_for` why it waits or slows (`\"lead\"`, `\"light\"`, `\"yield\"`, `\"people\"`, ...); `standing` the seconds it has stood; `bounding_box` the body's `[boundingbox]` as `{width, length, height, cx, cy, cz, heading, default}` (metres, the .bus/.ovh order; `cx`/`cy`/`cz` the box centre's offset from the vehicle's x, y, z along the body's right, forward and up, which follow `heading`; `default` when the file gives no box and the collision code's 2.5 x 12 x 3 m is used).",
      "params": [
        {
          "name": "radius",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "traffic.nearest",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "The AI vehicle nearest to the player's bus (of that `kind`, when given), with its `distance`.",
      "params": [
        {
          "name": "kind",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "traffic.remove",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "Takes an AI vehicle off the road (a timetable bus too: its timetable forgets it); its passengers get out.",
      "params": [
        {
          "name": "id",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "traffic_write"
    },
    {
      "name": "traffic.set_density",
      "group": "traffic",
      "since": "0.2.22",
      "doc": "Changes the traffic's amount (as the game menu's slider: 0 to 500 cars) and, when given, the share not running to a timetable; it fills up or thins out over the next seconds.",
      "params": [
        {
          "name": "cars",
          "type": "integer",
          "optional": false
        },
        {
          "name": "share",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "traffic_write"
    },
    {
      "name": "trigger",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "A key press of the bus: fires the trigger, then `<name>_off`.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": "vehicle_write"
    },
    {
      "name": "ui.clear",
      "group": "ui",
      "since": "0.2.21",
      "doc": "Removes every panel of the plugin.",
      "params": [],
      "returns": "nil",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.dock",
      "group": "ui",
      "since": "0.3.36",
      "doc": "The navigator's board, where a panel with `anchor = \"navigator\"` goes, in that panel's pixels: its width, the most height there is room for, the height the panel there came to (0 before it is laid out; more than `room`: it is cut off at the bottom), whether that panel is this plugin's (the first one asked for has the board, another waits), and whether it fills the navigator's whole frame (`frame = true`, ui version 6; false under the map, and nothing in an older game). Nothing while the navigator shows no board: it is off, or Shift+N put its lower part away.",
      "params": [],
      "returns": "width, room, height, mine, frame",
      "multi": true,
      "permission": null
    },
    {
      "name": "ui.focus",
      "group": "ui",
      "since": "0.2.21",
      "doc": "`true`: the panels get the mouse (the cursor shows, a click goes to the panel under it and none to the bus); `false`, Esc or a menu of the game gives it back. Returns the new state.",
      "params": [
        {
          "name": "on",
          "type": "bool",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.focused",
      "group": "ui",
      "since": "0.2.21",
      "doc": "Whether the panels have the mouse.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "ui.moved",
      "group": "ui",
      "since": "0.2.22",
      "doc": "How far the player dragged a panel from where its table puts it (pixels).",
      "params": [
        {
          "name": "panel",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "dx, dy",
      "multi": true,
      "permission": null
    },
    {
      "name": "ui.panels",
      "group": "ui",
      "since": "0.2.22",
      "doc": "The ids of the plugin's panels.",
      "params": [],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "ui.remove",
      "group": "ui",
      "since": "0.2.21",
      "doc": "Removes a panel; `true` when there was one.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.remove_menu_item",
      "group": "ui",
      "since": "0.3.36",
      "doc": "Takes the plugin's line `id` out of the pause menu; `true` when there was one.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.screen",
      "group": "ui",
      "since": "0.2.21",
      "doc": "The screen in the panels' pixels, and how many of the screen's own pixels one of them is.",
      "params": [],
      "returns": "width, height, scale",
      "multi": true,
      "permission": null
    },
    {
      "name": "ui.set",
      "group": "ui",
      "since": "0.2.21",
      "doc": "Creates the panel `id` or replaces it; a table that is not right gives `false` and where (`\"children[2].size: a number is expected\"`). The same table again changes nothing.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        },
        {
          "name": "panel",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "ui"
    },
    {
      "name": "ui.set_menu_item",
      "group": "ui",
      "since": "0.3.36",
      "doc": "Puts a line in the game's pause menu, or changes the plugin's line `id`: its label (40 characters at most, shown as it is) and a Material Symbols icon of the game's (`\"departure_board\"`; the plugins' own icon without one). Choosing it closes the menu and sends `menu_item` with `id` - to open the plugin's panel, say. A plugin has 3 lines at most; they go when it stops.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        },
        {
          "name": "label",
          "type": "string",
          "optional": false
        },
        {
          "name": "icon",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "ui"
    },
    {
      "name": "ui.set_theme",
      "group": "ui",
      "since": "0.3.42",
      "doc": "Switches the game's interface to theme `id` (`\"\"` or `\"openomsi\"`: openOMSI's own look), as if the player chose it in Options › Interface: it is kept for the next start. Ask the player first; they can switch back there.",
      "params": [
        {
          "name": "id",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "ui"
    },
    {
      "name": "ui.show",
      "group": "ui",
      "since": "0.2.22",
      "doc": "Shows a panel (or hides it with `false`; it is kept); `false` when there is none.",
      "params": [
        {
          "name": "panel",
          "type": "string",
          "optional": false
        },
        {
          "name": "on",
          "type": "bool",
          "optional": true
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.theme",
      "group": "ui",
      "since": "0.3.42",
      "doc": "The id of the interface theme in use (`\"\"`: openOMSI's own look).",
      "params": [],
      "returns": "string",
      "multi": false,
      "permission": null
    },
    {
      "name": "ui.themes",
      "group": "ui",
      "since": "0.3.42",
      "doc": "The game's interface themes: each `{ id, name }`, openOMSI's own look first (its id `\"\"`). A theme is a folder with a `theme.json` (`Themes/<id>/`, or a plugin's own folder: see docs/THEMES.md).",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "ui.toast",
      "group": "ui",
      "since": "0.2.21",
      "doc": "A notification card at the top right, newest at the top; it goes after `opts.seconds` (1 to 60, default 5). `opts`: `title`, `icon`, `color`. A plugin shows 8 at most: a ninth makes its oldest go.",
      "params": [
        {
          "name": "text",
          "type": "string",
          "optional": false
        },
        {
          "name": "opts",
          "type": "table",
          "optional": true
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "ui"
    },
    {
      "name": "ui.toggle",
      "group": "ui",
      "since": "0.2.22",
      "doc": "Shows a hidden panel or hides a shown one; whether it shows now.",
      "params": [
        {
          "name": "panel",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "ui.typing",
      "group": "ui",
      "since": "0.2.22",
      "doc": "Whether the player types into a text field of a plugin now (the keys then go to the field, not to the bus).",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "ui.update",
      "group": "ui",
      "since": "0.2.22",
      "doc": "Changes one element of a panel in place, by its id: `text`, `color`, `value` (a bar, a slider), `segments` (a bar), `checked`, `selected`, `name` (an icon), `values` (a chart), `rows` and `aligns` (a table), `stops` (a stop list), `src` (an image) - cheaper than setting the whole panel again.",
      "params": [
        {
          "name": "panel",
          "type": "string",
          "optional": false
        },
        {
          "name": "element",
          "type": "string",
          "optional": false
        },
        {
          "name": "values",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "ui"
    },
    {
      "name": "ui.value",
      "group": "ui",
      "since": "0.2.22",
      "doc": "The value of a checkbox, slider, text field or tabs element now (as `ui_change` gives it).",
      "params": [
        {
          "name": "panel",
          "type": "string",
          "optional": false
        },
        {
          "name": "element",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "any",
      "multi": false,
      "permission": "ui"
    },
    {
      "name": "util.date",
      "group": "util",
      "since": "0.2.22",
      "doc": "A real time (`util.now()` by default) as `{year, month, day, hour, minute, second, weekday}` in UTC (`weekday` 1 Monday).",
      "params": [
        {
          "name": "seconds",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "table",
      "multi": false,
      "permission": null
    },
    {
      "name": "util.ms",
      "group": "util",
      "since": "0.2.22",
      "doc": "Milliseconds of real time since the game started: for timing a plugin's own work.",
      "params": [],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "util.now",
      "group": "util",
      "since": "0.2.22",
      "doc": "The real time: seconds since 1970 (UTC), with fractions.",
      "params": [],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "util.random",
      "group": "util",
      "since": "0.2.22",
      "doc": "A random number: 0 to 1 without arguments, else a whole number from `min` to `max` (as `math.random`, but not repeating the same row in every plugin).",
      "params": [
        {
          "name": "min",
          "type": "number",
          "optional": true
        },
        {
          "name": "max",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "var",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "A script variable of the bus (`Velocity`, `elec_busbar_main`, the names the `.osc` files and `.opl` lists use); `nil` without a bus or for a name it does not have.",
      "params": [
        {
          "name": "name",
          "type": "string",
          "optional": false
        }
      ],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "vars",
      "group": "vehicle",
      "since": "0.1.10",
      "doc": "The names of every variable of the bus's scripts, or of every string variable with `\"str\"`.",
      "params": [
        {
          "name": "kind",
          "type": "string",
          "optional": true
        }
      ],
      "returns": "list of strings",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.angle_diff",
      "group": "util",
      "since": "0.2.22",
      "doc": "The turn from heading `a` to heading `b`, -180 to 180 degrees (right positive).",
      "params": [
        {
          "name": "a",
          "type": "number",
          "optional": false
        },
        {
          "name": "b",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.bearing",
      "group": "util",
      "since": "0.2.22",
      "doc": "The heading from one map point to another.",
      "params": [
        {
          "name": "x1",
          "type": "number",
          "optional": false
        },
        {
          "name": "y1",
          "type": "number",
          "optional": false
        },
        {
          "name": "x2",
          "type": "number",
          "optional": false
        },
        {
          "name": "y2",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.clamp",
      "group": "util",
      "since": "0.2.22",
      "doc": "`x` held between `min` and `max`.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "min",
          "type": "number",
          "optional": false
        },
        {
          "name": "max",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.distance",
      "group": "util",
      "since": "0.2.22",
      "doc": "Metres between two map points (on the ground: x and y).",
      "params": [
        {
          "name": "x1",
          "type": "number",
          "optional": false
        },
        {
          "name": "y1",
          "type": "number",
          "optional": false
        },
        {
          "name": "x2",
          "type": "number",
          "optional": false
        },
        {
          "name": "y2",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.distance3",
      "group": "util",
      "since": "0.2.22",
      "doc": "Metres between two points in space.",
      "params": [
        {
          "name": "x1",
          "type": "number",
          "optional": false
        },
        {
          "name": "y1",
          "type": "number",
          "optional": false
        },
        {
          "name": "z1",
          "type": "number",
          "optional": false
        },
        {
          "name": "x2",
          "type": "number",
          "optional": false
        },
        {
          "name": "y2",
          "type": "number",
          "optional": false
        },
        {
          "name": "z2",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.dot",
      "group": "util",
      "since": "0.2.22",
      "doc": "The dot product of two 2D vectors.",
      "params": [
        {
          "name": "x1",
          "type": "number",
          "optional": false
        },
        {
          "name": "y1",
          "type": "number",
          "optional": false
        },
        {
          "name": "x2",
          "type": "number",
          "optional": false
        },
        {
          "name": "y2",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.heading",
      "group": "util",
      "since": "0.2.22",
      "doc": "The heading of a direction on the map, degrees clockwise from north (0 to 360), as the game's headings.",
      "params": [
        {
          "name": "dx",
          "type": "number",
          "optional": false
        },
        {
          "name": "dy",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.length",
      "group": "util",
      "since": "0.2.22",
      "doc": "The length of a vector (2D, or 3D with `z`).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.lerp",
      "group": "util",
      "since": "0.2.22",
      "doc": "From `a` to `b` by `t` (0 to 1, not held to it).",
      "params": [
        {
          "name": "a",
          "type": "number",
          "optional": false
        },
        {
          "name": "b",
          "type": "number",
          "optional": false
        },
        {
          "name": "t",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "number",
      "multi": false,
      "permission": null
    },
    {
      "name": "vec.normalize",
      "group": "util",
      "since": "0.2.22",
      "doc": "The vector made 1 long (0 stays 0).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "z",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "x, y, z",
      "multi": true,
      "permission": null
    },
    {
      "name": "vec.rotate",
      "group": "util",
      "since": "0.2.22",
      "doc": "A vector turned clockwise by `degrees` (as headings turn).",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "degrees",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "x, y",
      "multi": true,
      "permission": null
    },
    {
      "name": "vec.to_local",
      "group": "util",
      "since": "0.2.22",
      "doc": "A map point seen from a place facing `heading`: metres to the right and ahead of it.",
      "params": [
        {
          "name": "x",
          "type": "number",
          "optional": false
        },
        {
          "name": "y",
          "type": "number",
          "optional": false
        },
        {
          "name": "ox",
          "type": "number",
          "optional": false
        },
        {
          "name": "oy",
          "type": "number",
          "optional": false
        },
        {
          "name": "heading",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "right, ahead",
      "multi": true,
      "permission": null
    },
    {
      "name": "vehicle",
      "group": "vehicle",
      "since": "0.1.5",
      "doc": "The vehicle's name (manufacturer and type), or `nil` on foot.",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "vehicle_manufacturer",
      "group": "vehicle",
      "since": "0.2.21",
      "doc": "The manufacturer part of the vehicle's name, as its `[friendlyname]` has it (`\"Solaris III Gen\"`).",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "vehicle_model",
      "group": "vehicle",
      "since": "0.2.21",
      "doc": "The model part of the vehicle's name (`\"Urbino 10 / 2D\"`).",
      "params": [],
      "returns": "string or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "warn",
      "group": "game",
      "since": "0.1.5",
      "doc": "The same as a warning.",
      "params": [
        {
          "name": "...",
          "type": "any",
          "optional": true
        }
      ],
      "returns": "nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "watch",
      "group": "events",
      "since": "0.1.5",
      "doc": "Runs `fn(new, old)` whenever a value changes: `watch(name, fn)` a variable of the bus, `watch(kind, name, fn)` of kind `\"var\"`, `\"str\"`, `\"sys\"` or `\"info\"` (a key of `info()`).",
      "params": [
        {
          "name": "kind",
          "type": "string",
          "optional": false
        },
        {
          "name": "name",
          "type": "string",
          "optional": false
        },
        {
          "name": "fn",
          "type": "function",
          "optional": true
        }
      ],
      "returns": "integer id",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.get",
      "group": "weather",
      "since": "0.2.22",
      "doc": "The weather now: `{name, visibility (m), wind_direction (°), wind_speed (m/s), temperature (°C), humidity (%), absolute_humidity (g/m³), pressure (hPa), clouds, cloud_base (m), precipitation (\"none\", \"rain\", \"snow\"), precipitation_rate (0..1), snow_cover, snow_on_road, wetness (the roads, 0..1), changing, locked}` (`locked`: it follows a real weather station and cannot be set).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.precipitation",
      "group": "weather",
      "since": "0.2.22",
      "doc": "`\"none\"`, `\"rain\"` or `\"snow\"`, and how hard (0 to 1).",
      "params": [],
      "returns": "kind, rate",
      "multi": true,
      "permission": null
    },
    {
      "name": "weather.preset",
      "group": "weather",
      "since": "0.2.22",
      "doc": "Changes to a weather file (as `weather.presets` names it; `\"\"`: the map's own, changing with the day) over `seconds` (default 1).",
      "params": [
        {
          "name": "file",
          "type": "string",
          "optional": false
        },
        {
          "name": "seconds",
          "type": "number",
          "optional": true
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "world_write"
    },
    {
      "name": "weather.presets",
      "group": "weather",
      "since": "0.2.22",
      "doc": "The weather files installed: `{file, name}`.",
      "params": [],
      "returns": "list of tables",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.set",
      "group": "weather",
      "since": "0.2.22",
      "doc": "Changes the weather as the game menu's sliders do; any of `visibility`, `wind_direction`, `wind_speed`, `temperature`, `pressure`, `clouds` (`\"-1\"` none, `\"Cumulus 1\"`..`\"3\"`, `\"Overcast 1\"`), `cloud_base`, `precipitation` (`\"none\"`, `\"rain\"`, `\"snow\"`), `precipitation_rate` (0..1), `snow_cover`, `snow_on_road`, `wetness`; the rest stays. Held to the game's ranges; refused in a LAN game as a client or while the weather follows a station.",
      "params": [
        {
          "name": "values",
          "type": "table",
          "optional": false
        }
      ],
      "returns": "true, or false and the reason",
      "multi": true,
      "permission": "world_write"
    },
    {
      "name": "weather.temperature",
      "group": "weather",
      "since": "0.2.22",
      "doc": "The air temperature, °C.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.visibility",
      "group": "weather",
      "since": "0.2.22",
      "doc": "How far one sees, metres.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.wetness",
      "group": "weather",
      "since": "0.2.22",
      "doc": "How wet the roads are, 0 (dry) to 1.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "weather.wind",
      "group": "weather",
      "since": "0.2.22",
      "doc": "The wind: where it comes from (degrees) and its speed (m/s).",
      "params": [],
      "returns": "direction, speed",
      "multi": true,
      "permission": null
    },
    {
      "name": "world.date",
      "group": "time",
      "since": "0.2.22",
      "doc": "The game's date: `{year, month, day, weekday, day_of_year}` (`weekday` 1 Monday to 7 Sunday).",
      "params": [],
      "returns": "table or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "world.pause",
      "group": "time",
      "since": "0.2.22",
      "doc": "Pauses the game, as P does (not in a LAN game). The plugins stand still with it: the player resumes it.",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "world.paused",
      "group": "time",
      "since": "0.2.22",
      "doc": "Whether the game stands still (a plugin hears `pause` and runs no more until `resume`).",
      "params": [],
      "returns": "boolean",
      "multi": false,
      "permission": null
    },
    {
      "name": "world.play_time",
      "group": "time",
      "since": "0.2.22",
      "doc": "Seconds played this session (game time, never wraps).",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "world.season",
      "group": "time",
      "since": "0.2.22",
      "doc": "The season's texture folder (`nil`: the base textures) and whether snow lies.",
      "params": [],
      "returns": "folder, snow",
      "multi": true,
      "permission": null
    },
    {
      "name": "world.set_date",
      "group": "time",
      "since": "0.2.22",
      "doc": "Sets the game's date (the season's textures follow).",
      "params": [
        {
          "name": "year",
          "type": "integer",
          "optional": false
        },
        {
          "name": "month",
          "type": "integer",
          "optional": false
        },
        {
          "name": "day",
          "type": "integer",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "world.set_time",
      "group": "time",
      "since": "0.2.22",
      "doc": "Sets the time of day: seconds since midnight or `\"HH:MM\"` / `\"HH:MM:SS\"`, as the game menu's clock does (the timetable starts again after a jump of minutes). Not in a LAN game as a client, nor while the clock follows the computer's.",
      "params": [
        {
          "name": "time",
          "type": "any",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "world.set_time_speed",
      "group": "time",
      "since": "0.2.22",
      "doc": "Sets how much faster the clock runs (1 to 30; not in a LAN game).",
      "params": [
        {
          "name": "factor",
          "type": "number",
          "optional": false
        }
      ],
      "returns": "boolean",
      "multi": false,
      "permission": "world_write"
    },
    {
      "name": "world.sun_altitude",
      "group": "time",
      "since": "0.2.22",
      "doc": "The sun's height over the horizon, degrees.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "world.time",
      "group": "time",
      "since": "0.2.22",
      "doc": "The game's time of day, seconds since midnight.",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    },
    {
      "name": "world.time_speed",
      "group": "time",
      "since": "0.2.22",
      "doc": "How much faster than real time the game's clock runs (1 to 30).",
      "params": [],
      "returns": "number or nil",
      "multi": false,
      "permission": null
    }
  ],
  "events": [
    {
      "name": "start",
      "args": [],
      "doc": "Right after the plugin was loaded (also after a reload).",
      "since": "0.1.5"
    },
    {
      "name": "vehicle",
      "args": [
        "name"
      ],
      "doc": "The player got into a vehicle, changed it, or left it (`nil`).",
      "since": "0.1.5"
    },
    {
      "name": "frame",
      "args": [
        "dt"
      ],
      "doc": "Every frame of the game, after the bus's own scripts; not while paused. `dt` is the frame's seconds of game time.",
      "since": "0.1.5"
    },
    {
      "name": "stop",
      "args": [],
      "doc": "The game ends, or the plugin is about to be loaded again.",
      "since": "0.1.5"
    },
    {
      "name": "key",
      "args": [
        "key",
        "down"
      ],
      "doc": "A key went down (`true`) or came up: winit's name of it (`\"KeyH\"`, `\"F5\"`, `\"Numpad8\"`).",
      "since": "0.1.10"
    },
    {
      "name": "next_stop",
      "args": [
        "new",
        "old"
      ],
      "doc": "The duty's next stop changed, also to one of the same name (`omsi.info().next_stop_number` tells them apart).",
      "since": "0.1.10"
    },
    {
      "name": "view",
      "args": [
        "new",
        "old"
      ],
      "doc": "The view changed (`\"driver\"`, `\"pax\"`, `\"outside\"`, `\"free\"`, `\"foot\"`).",
      "since": "0.1.10"
    },
    {
      "name": "duty",
      "args": [
        "line",
        "tour"
      ],
      "doc": "A line and tour were taken (or given up: `nil`).",
      "since": "0.1.10"
    },
    {
      "name": "crash",
      "args": [
        "energy_kj",
        "speed_kmh"
      ],
      "doc": "The player's bus crashed: every crash, also one the same as the last (the screen's \"Crash: 136 kJ\"); above 50 kJ it is a heavy one.",
      "since": "0.2.21"
    },
    {
      "name": "pedestrian",
      "args": [
        "count"
      ],
      "doc": "The bus knocked people down.",
      "since": "0.2.21"
    },
    {
      "name": "stops_skipped",
      "args": [
        "count",
        "due_at",
        "now_at"
      ],
      "doc": "The duty jumped ahead: the bus passed stops of its trip without stopping (or was moved) and is now at a later one; the stops are numbered in the trip from 1.",
      "since": "0.2.21"
    },
    {
      "name": "service",
      "args": [
        "kind",
        "by",
        "amount"
      ],
      "doc": "The player's bus was serviced or moved. `kind`: `\"refuel\"` (amount: litres put in), `\"wash\"` (amount: the dirt left), `\"repair\"` (amount: the game minutes it took), `\"reset\"` or `\"teleport\"`; `by`: `\"player\"`, `\"plugin\"`, `\"host\"` or `\"game\"`.",
      "since": "0.2.21"
    },
    {
      "name": "trip_done",
      "args": [
        "trip",
        "how",
        "driving",
        "comfort",
        "tickets"
      ],
      "doc": "A trip of the duty ended, once: its number in the duty, `\"arrived\"`, `\"skipped\"` or `\"given_up\"`, then its ratings in per cent (driving, comfort, ticket selling).",
      "since": "0.2.21"
    },
    {
      "name": "jolt",
      "args": [
        "along",
        "across",
        "speed_kmh",
        "passengers"
      ],
      "doc": "The bus braked, sped up or cornered hard enough to cost driving rating (m/s², signed); at most one a second.",
      "since": "0.2.21"
    },
    {
      "name": "ticket_sold",
      "args": [
        "name",
        "price"
      ],
      "doc": "A ticket was sold at the cash desk: its name and price as the bus's ticket list has them.",
      "since": "0.2.21"
    },
    {
      "name": "ui_click",
      "args": [
        "panel",
        "element"
      ],
      "doc": "A button (or another clickable part) of one of the plugin's panels was clicked; `element` is `nil` for the panel itself. Enter in a text field is a click on it.",
      "since": "0.2.21"
    },
    {
      "name": "menu_item",
      "args": [
        "id"
      ],
      "doc": "The player chose one of the plugin's lines in the pause menu (`ui.set_menu_item`); the menu has closed.",
      "since": "0.3.36"
    },
    {
      "name": "ui_focus",
      "args": [
        "focused"
      ],
      "doc": "The panels got the mouse or gave it back (also by Esc, or a menu of the game opening).",
      "since": "0.2.21"
    },
    {
      "name": "ui_change",
      "args": [
        "panel",
        "element",
        "value"
      ],
      "doc": "A checkbox (`true`/`false`), slider (its number), text field (its text, at every key) or tabs element (the tab's number from 1) of the plugin's panels was changed by the player.",
      "since": "0.2.22"
    },
    {
      "name": "message",
      "args": [
        "from",
        "topic",
        "data"
      ],
      "doc": "Another plugin sent this one a message (`plugin.send`, `plugin.broadcast`): its name, the topic and the data (numbers, texts, tables).",
      "since": "0.2.22"
    },
    {
      "name": "setting",
      "args": [
        "key",
        "value"
      ],
      "doc": "The player changed one of the plugin's settings in its settings panel (`plugin.settings`).",
      "since": "0.2.22"
    },
    {
      "name": "door",
      "args": [
        "door",
        "open"
      ],
      "doc": "A door leaf of the player's bus opened (`true`) or closed: its number from 1, front to back.",
      "since": "0.2.22"
    },
    {
      "name": "doors",
      "args": [
        "open"
      ],
      "doc": "The bus's doors opened (`true`: one or more open) or were all closed.",
      "since": "0.2.22"
    },
    {
      "name": "engine_start",
      "args": [],
      "doc": "The player's bus's engine started running.",
      "since": "0.2.22"
    },
    {
      "name": "engine_stop",
      "args": [],
      "doc": "Its engine stopped.",
      "since": "0.2.22"
    },
    {
      "name": "gear",
      "args": [
        "new",
        "old"
      ],
      "doc": "The gear engaged changed (-1 reverse, 0 neutral), where the bus has a gearbox it shows.",
      "since": "0.2.22"
    },
    {
      "name": "indicator",
      "args": [
        "new",
        "old"
      ],
      "doc": "The indicators changed: `\"off\"`, `\"left\"`, `\"right\"` or `\"hazard\"`.",
      "since": "0.2.22"
    },
    {
      "name": "headlights",
      "args": [
        "new",
        "old"
      ],
      "doc": "The headlights changed: 0 off, 1 side lights, 2 dipped, 3 high beam.",
      "since": "0.2.22"
    },
    {
      "name": "horn",
      "args": [
        "down"
      ],
      "doc": "The horn started (`true`) or stopped.",
      "since": "0.2.22"
    },
    {
      "name": "handbrake",
      "args": [
        "on"
      ],
      "doc": "The parking brake was put on (`true`) or released.",
      "since": "0.2.22"
    },
    {
      "name": "stop_request",
      "args": [
        "on"
      ],
      "doc": "A passenger asked to stop (`true`), or the request went out.",
      "since": "0.2.22"
    },
    {
      "name": "passengers",
      "args": [
        "count",
        "old"
      ],
      "doc": "The number of passengers aboard the player's bus changed.",
      "since": "0.2.22"
    },
    {
      "name": "passenger_board",
      "args": [
        "count",
        "stop_id"
      ],
      "doc": "People got into the player's bus: how many, and the stop they waited at (its map object id, `nil` when none).",
      "since": "0.2.22"
    },
    {
      "name": "passenger_alight",
      "args": [
        "count"
      ],
      "doc": "People got out of the player's bus.",
      "since": "0.2.22"
    },
    {
      "name": "passenger_ticket",
      "args": [
        "passenger"
      ],
      "doc": "Somebody boarding the player's bus has decided about their ticket, on their way to the door - they wait in the doorway for this frame, so it can still change before they get in and ask for it at the cash desk: `{id, age, kind, ticket, name, price, stop, stop_name, destination, stop_number, destination_number}` - `kind` `\"none\"`, `\"stamp\"` or `\"buy\"`, `ticket` the ticket pack's (from 1; 0 none fits their age - the desk then asks for the pack's first) with the `name` and `price` they will ask for, `stop` the map object id they board at and `stop_name` its timetable name, `destination` the stop they ride to, and where both are in the duty's trip (from 1, `nil` where the trip does not have them). `people.set_ticket(id, ...)` changes it.",
      "since": "0.3"
    },
    {
      "name": "stop_arrive",
      "args": [
        "name",
        "id",
        "number",
        "delay"
      ],
      "doc": "The bus came to the duty's next stop (within 25 m of it): its name, map object id, number in the trip (from 1) and the delay in seconds (late positive).",
      "since": "0.2.22"
    },
    {
      "name": "stop_depart",
      "args": [
        "name",
        "id",
        "number",
        "delay"
      ],
      "doc": "The bus left the stop it stood at (more than 35 m from it, or the duty moved on): the same values, the delay as it left.",
      "since": "0.2.22"
    },
    {
      "name": "trip_start",
      "args": [
        "trip",
        "name",
        "terminus"
      ],
      "doc": "The duty moved on to another trip: its number in the duty (from 1), the timetable's name of the trip and its terminus.",
      "since": "0.2.22"
    },
    {
      "name": "duty_start",
      "args": [
        "line",
        "tour"
      ],
      "doc": "A duty was taken.",
      "since": "0.2.22"
    },
    {
      "name": "duty_end",
      "args": [
        "line",
        "tour"
      ],
      "doc": "The duty was given up (or another taken: `duty_end` of the old one comes first).",
      "since": "0.2.22"
    },
    {
      "name": "destination",
      "args": [
        "new",
        "old"
      ],
      "doc": "The destination the bus shows changed.",
      "since": "0.2.22"
    },
    {
      "name": "coupled",
      "args": [
        "parts",
        "old"
      ],
      "doc": "Something was coupled to or uncoupled from the bus: the parts behind it now.",
      "since": "0.2.22"
    },
    {
      "name": "minute",
      "args": [
        "hour",
        "minute"
      ],
      "doc": "The game's clock reached a new minute (also when it was set).",
      "since": "0.2.22"
    },
    {
      "name": "hour",
      "args": [
        "hour"
      ],
      "doc": "The game's clock reached a new hour.",
      "since": "0.2.22"
    },
    {
      "name": "day",
      "args": [
        "year",
        "month",
        "day"
      ],
      "doc": "The game's date changed.",
      "since": "0.2.22"
    },
    {
      "name": "tile",
      "args": [
        "x",
        "y",
        "old_x",
        "old_y"
      ],
      "doc": "The player's bus drove onto another tile of the map (numbered as global.cfg's `[map]` list).",
      "since": "0.2.22"
    },
    {
      "name": "weather",
      "args": [
        "name"
      ],
      "doc": "The weather changed: another weather file, rain or snow beginning or ending, the snow cover, the clouds.",
      "since": "0.2.22"
    },
    {
      "name": "light_ahead",
      "args": [
        "aspect",
        "distance"
      ],
      "doc": "The traffic light ahead of the bus (within 80 m) changed or a new one came: its aspect (`\"red\"`, `\"red_yellow\"`, `\"green\"`, `\"green_yellow\"`, `\"yellow\"`, `\"dark\"`, `nil` when none is ahead any more) and its distance in metres.",
      "since": "0.2.22"
    },
    {
      "name": "red_light",
      "args": [
        "speed_kmh"
      ],
      "doc": "The bus drove past a traffic light showing red (or red and yellow) at more than 5 km/h.",
      "since": "0.2.22"
    },
    {
      "name": "speed_limit",
      "args": [
        "kmh",
        "old"
      ],
      "doc": "The speed limit of the lane the bus drives on changed.",
      "since": "0.2.22"
    },
    {
      "name": "ai_collision",
      "args": [
        "id",
        "energy_kj"
      ],
      "doc": "The player's bus hit an AI vehicle (its id, as `traffic.list` gives it) with this energy.",
      "since": "0.2.22"
    },
    {
      "name": "pause",
      "args": [],
      "doc": "The game was paused (the plugins stand still until `resume`; nothing else comes in between).",
      "since": "0.2.22"
    },
    {
      "name": "resume",
      "args": [],
      "doc": "The game goes on after a pause.",
      "since": "0.2.22"
    },
    {
      "name": "menu_open",
      "args": [],
      "doc": "The game menu opened.",
      "since": "0.2.22"
    },
    {
      "name": "menu_close",
      "args": [],
      "doc": "The game menu closed.",
      "since": "0.2.22"
    },
    {
      "name": "screenshot",
      "args": [
        "file"
      ],
      "doc": "A screenshot was taken: its file.",
      "since": "0.2.22"
    },
    {
      "name": "controller_button",
      "args": [
        "device",
        "button",
        "down"
      ],
      "doc": "A button of a steering wheel, joystick or gamepad went down (`true`) or up: the device's name and the button's number.",
      "since": "0.2.22"
    },
    {
      "name": "lan_join",
      "args": [
        "id",
        "name"
      ],
      "doc": "A player joined the LAN session (or came back).",
      "since": "0.2.22"
    },
    {
      "name": "lan_leave",
      "args": [
        "id",
        "name"
      ],
      "doc": "A player left the LAN session.",
      "since": "0.2.22"
    },
    {
      "name": "lan_message",
      "args": [
        "from",
        "data"
      ],
      "doc": "The same plugin on another player's game sent this one a message (`lan.send`): the player's id and the text.",
      "since": "0.2.22"
    },
    {
      "name": "lan_chat",
      "args": [
        "name",
        "text"
      ],
      "doc": "A line was said in the LAN session's chat (by another player or this one).",
      "since": "0.2.22"
    },
    {
      "name": "object_init",
      "args": [
        "id",
        "type",
        "x",
        "y",
        "z",
        "heading"
      ],
      "doc": "A scenery object this script drives came within its range (once, again if it leaves and comes back): the map's id of the object, its type (the `.sco` file's name), where it stands and the way it faces. Only a script a `.sco` names with `[lua_script]` hears the `object_*` events.",
      "since": "0.2.22"
    },
    {
      "name": "object_frame",
      "args": [
        "id",
        "dt"
      ],
      "doc": "A frame of an object this script drives, while it is in range; `dt` is the game seconds since the last frame of that object (at the rate of the `.sco`'s `[lua_rate]`, else every game frame).",
      "since": "0.2.22"
    },
    {
      "name": "object_gone",
      "args": [
        "id"
      ],
      "doc": "An object this script drives left its range or was unloaded with its tile; its state in the script can go.",
      "since": "0.2.22"
    },
    {
      "name": "object_click",
      "args": [
        "id",
        "event"
      ],
      "doc": "The player clicked the `[mouseevent]` of a mesh of an object this script drives.",
      "since": "0.2.22"
    }
  ]
}
