Skip to content

function useItemToState

This function will try to use, interact, open item in specific state by player.
Original: useItemToState

Declaration

async def useItemToState(id : int, instance : str, state : int)

Parameters

int id: the player id.
str instance: the item instance from Daedalus scripts.
int state: the state that you'll start from interacting with item.

Source code in src/pyg2o/functions/player.py
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
async def useItemToState(id : int, instance : str, state : int):
    """
    This function will try to use, interact, open item in specific state by player.
    Original: [useItemToState](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/useItemToState/)

    ## Declaration
    ```python
    async def useItemToState(id : int, instance : str, state : int)
    ```
    ## Parameters
    `int` **id**: the player id.
    `str` **instance**: the item instance from Daedalus scripts.
    `int` **state**: the state that you'll start from interacting with item.
    """
    data = f'return {get_call_repr()}'

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