This function is used to retrieve the position of specified waypoint.
Original: getWaypoint
Declaration
async def getWaypoint(world : str, name : str) -> Optional[tuple]
Parameters
str world: the world name in which the waypoint exists.
str name: the name of the waypoint.
Returns
dict {x, y, z}: The position of waypoint.
Source code in src/pyg2o/functions/waypoint.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 | async def getWaypoint(world : str, name : str) -> Optional[tuple]:
"""
This function is used to retrieve the position of specified waypoint.
Original: [getWaypoint](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/waypoint/getWaypoint/)
## Declaration
```python
async def getWaypoint(world : str, name : str) -> Optional[tuple]
```
## Parameters
`str` **world**: the world name in which the waypoint exists.
`str` **name**: the name of the waypoint.
## Returns
`dict {x, y, z}`: The position of waypoint.
"""
data = f'return {get_call_repr()}'
server = await PythonWebsocketServer.get_server()
result = await server.make_request(data)
return (result['x'], result['y'], result['z']) if result is not None else (None, None, None)
|