> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: common
description: Client-side utility functions and world transforms
icon: wrench
---

The `common` namespace provides client-side utility functions for time, identity, input, and script control.

## get\_date

```lua
common.get_date(format: string[, unix_time: number]): string
```

> Returns the formatted date. See the [strftime reference](https://devhints.io/datetime) for format specifiers.

<Schema title="Parameters">
  <SchemaField name="format" type="string" required>
    Date format (strftime).
  </SchemaField>

  <SchemaField name="unix_time" type="number">
    Optional. Unix-format time.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="date" type="string">
    The formatted date.
  </SchemaField>
</Schema>

## get\_unixtime

```lua
common.get_unixtime(): number
```

> Returns the number of seconds that have elapsed since the unix epoch (1 January 1970 00:00:00).

<Schema title="Returns">
  <SchemaField name="seconds" type="number">
    Seconds elapsed since the unix epoch.
  </SchemaField>
</Schema>

## get\_timestamp

```lua
common.get_timestamp(): number
```

> Returns high precision timestamp in milliseconds.

<Schema title="Returns">
  <SchemaField name="timestamp" type="number">
    High precision timestamp in milliseconds.
  </SchemaField>
</Schema>

## get\_system\_time

```lua
common.get_system_time(): table
```

> Returns the windows time as a table containing the `year`, `month`, `day`, `hours`, `minutes`, and `seconds` values.

<Schema title="Returns">
  <SchemaField name="time" type="table">
    Table containing the current windows time.

    <Expandable title="Table values">
      <SchemaField name="year" type="number" />

      <SchemaField name="month" type="number" />

      <SchemaField name="day" type="number" />

      <SchemaField name="hours" type="number" />

      <SchemaField name="minutes" type="number" />

      <SchemaField name="seconds" type="number" />
    </Expandable>
  </SchemaField>
</Schema>

## get\_product\_version

```lua
common.get_product_version(): number
```

> Returns the product version of the game client.

<Schema title="Returns">
  <SchemaField name="version" type="number">
    The product version of the game client.
  </SchemaField>
</Schema>

## get\_game\_directory

```lua
common.get_game_directory(): string
```

> Returns the path to the game client folder.

<Schema title="Returns">
  <SchemaField name="path" type="string">
    The path to the game client folder.
  </SchemaField>
</Schema>

## get\_map\_data

```lua
common.get_map_data(): table
```

> Returns a table containing the `name`, `shortname`, and `group` values.

<Schema title="Returns">
  <SchemaField name="map_data" type="table">
    Table containing information about the current map.

    <Expandable title="Table values">
      <SchemaField name="name" type="string" />

      <SchemaField name="shortname" type="string" />

      <SchemaField name="group" type="string" />
    </Expandable>
  </SchemaField>
</Schema>

## get\_username

```lua
common.get_username(): string
```

> Returns your Neverlose username.

<Schema title="Returns">
  <SchemaField name="username" type="string">
    Your Neverlose username.
  </SchemaField>
</Schema>

## get\_config\_name

```lua
common.get_config_name(): string
```

> Returns the name of the currently loaded config.

<Schema title="Returns">
  <SchemaField name="name" type="string">
    The name of the currently loaded config.
  </SchemaField>
</Schema>

## get\_active\_scripts

```lua
common.get_active_scripts(): table
```

> Returns a table of strings containing the names of the loaded scripts.

<Schema title="Returns">
  <SchemaField name="scripts" type="table">
    Table of strings containing the names of the loaded scripts.
  </SchemaField>
</Schema>

## get\_mouse\_wheel\_delta

```lua
common.get_mouse_wheel_delta(): number
```

> Returns a value that indicates the amount that the mouse wheel has changed.

<Schema title="Returns">
  <SchemaField name="delta" type="number">
    The amount that the mouse wheel has changed.
  </SchemaField>
</Schema>

## is\_in\_thirdperson

```lua
common.is_in_thirdperson(): boolean
```

> Returns `true` if the camera is in thirdperson.

<Schema title="Returns">
  <SchemaField name="value" type="boolean">
    `true` if the camera is in thirdperson.
  </SchemaField>
</Schema>

## reload\_script

```lua
common.reload_script()
```

> Reloads current script.

## unload\_script

```lua
common.unload_script()
```

> Unloads current script.

## force\_full\_update

```lua
common.force_full_update()
```

> Forces the server to send a full update packet.

## set\_clan\_tag

```lua
common.set_clan_tag(text: string)
```

> Sets your in-game clan tag.

<Schema title="Parameters">
  <SchemaField name="text" type="string" required>
    New clan tag.
  </SchemaField>
</Schema>

## set\_name

```lua
common.set_name(text: string)
```

> Sets your in-game name.

<Schema title="Parameters">
  <SchemaField name="text" type="string" required>
    New name.
  </SchemaField>
</Schema>

## add\_event

```lua
common.add_event(text: string[, icon_name: string])
```

> Prints the text into the upper-left neverlose event panel.

<Schema title="Parameters">
  <SchemaField name="text" type="string" required>
    Text to print to into the upper-left panel.
  </SchemaField>

  <SchemaField name="icon_name" type="string">
    Optional. Fontawesome icon name.
  </SchemaField>
</Schema>

## add\_notify

```lua
common.add_notify(title: string, text: string)
```

> Draws the notification.

<Schema title="Parameters">
  <SchemaField name="title" type="string" required>
    Text to print to into the title.
  </SchemaField>

  <SchemaField name="body" type="string" required>
    Text to print to into the body of the notification.
  </SchemaField>
</Schema>

## is\_button\_down

```lua
common.is_button_down(key: number): boolean
```

> Returns `true` if the button is down, or `nil` on failure. See the [virtual-key codes reference](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes).

<Schema title="Parameters">
  <SchemaField name="key" type="number" required>
    Key to check.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="value" type="boolean">
    `true` if the button is down, or `nil` on failure.
  </SchemaField>
</Schema>

## is\_button\_released

```lua
common.is_button_released(key: number): boolean
```

> Returns `true` if the button is released, or `nil` on failure.

<Schema title="Parameters">
  <SchemaField name="key" type="number" required>
    Key to check.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="value" type="boolean">
    `true` if the button is released, or `nil` on failure.
  </SchemaField>
</Schema>
