# LuaBee Functions

## Playback functions:

```
number Position = GetPosition()
```

Gets the second of playback of the current file.

```
bool Success = SetPosition(number: seconds)
```

Sets the second of playback of the current file.

```
bool ShuffleState = GetShuffle()
```

Gets the shuffle state.

```
bool Result = SetShuffle(bool: status)
```

Sets the shuffle state.

```
bool AutoDJEnabled = GetAutoDJ()
```

Gets the ***`AUTO-DJ`*** state.

```
bool Muted = GetMute()
```

Gets the mute state.

```
bool Result = SetMute(bool: enable)
```

Sets the mute state.

```
PlayTrackURL(string: file/url)
```

Plays track by URL or filename.

```
SetPlayState(string: state)
```

Sets play state for current playing track view [play state constants](/luabee/untitled.md#playback-states) for list of available constants.

**These functions bellow added in 1.1.1 version and will not work on earlier versions:**

```
SetAutoDJ(bool: state)
```

Sets ***`AUTO-DJ`*** state

## File operation functions

```
table Files = GetFileList(string: rule)
```

Gets the file list by rule e.g `GetFileList("domain=Library")`.

```
string tag = GetFileTag(string: file, string: metadataConstant)
```

Gets the tag values from filename see [metadata constants](/luabee/untitled.md#metadata) for list of available constants.

```
bool result = CommitTagIntoFile(string: file)
```

Commits changes into file made using the function `SetFileTag`

```
SetFileTag(string: file, string: metadataConstant, string: value)
```

Sets tag value in track by file. see [metadata constants](/luabee/untitled.md#metadata) for list of available constants.

## GUI Functions

```
AddElementInContextMenu(string: address, string: name, function: handler)
```

Adds element in context menu.

## Playlist functions

**These functions bellow added in 1.2.1 version and will not work on earlier versions:**

```
bool result = CreatePlaylist(string: playlistfilename, string: playlistName, table: filenames)
```

Creates playlist.

```
bool result = PlaylistSetFiles(string: playlistfilename, table: filenames)
```

Override all playlist file index.

```
bool result = RemoveFileFromPlaylist(string: filename, number: index)
```

Removes file from playlist by index.

```
bool result = DeletePlaylist(string: filename)
```

Removes playlist from disk


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lainez.gitbook.io/luabee/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
