Skip to content

function useItem

This function will try to use, interact, open item by player.
Original: useItem

Declaration

async def useItem(id : int, instance : str)

Parameters

int id: the player id.
str instance: the item instance from Daedalus scripts.

Source code in src/pyg2o/functions/player.py
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
async def useItem(id : int, instance : str):
    """
    This function will try to use, interact, open item by player.
    Original: [useItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/useItem/)

    ## Declaration
    ```python
    async def useItem(id : int, instance : str)
    ```
    ## Parameters
    `int` **id**: the player id.
    `str` **instance**: the item instance from Daedalus scripts.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result