This package allows you to connect to TPC servers as a client and send packets.
Project description
The Puzzle Cell Client Python Package
This package allows you to connect to TPC servers as a client and send packets.
Available at PyPi
Documentation
Install
To use The Puzzle Cell Client, install it using pip:
pip install thepuzzlecell
Quickstart
Here is a quick example:
import thepuzzlecell
async def test():
connection = await thepuzzlecell.client("wss://tpc.milenakos.repl.co", "2.0", "Hello World Client")
await connection.send_packet("Hello")
await connection.send_packet("World!")
for y in range(0, 10):
await connection.place(x=0, y=y, id="push")
print(connection.get_packets())
await connection.close()
asyncio.run(test())
Easy, right?
API and stuff
-
thepuzzlecell
-
client(ip, version="2.0", client_id="PythonUser", auto_reconnect=False)
creates aClient()
and returns it -
Client
is main class-
async
connect()
does not take any arguments and runs on self variables -
listen()
runs a loop to listen for any incoming packets (interal; not recommended to use externally) -
async
get(websocket)
returns information from given websocket -
async
send_packet(data)
send given information into self.websocket -
async
close()
closes self.websocket -
get_packets(**wait_until_packet=False)
gets packets collected bylisten()
get_packet(**wait_until_packet=False)
is an alias for it
-
async
place(**x, **y, **id, **rot=0, **heat=0)
places cell -
async
bg(**x, **y, **bg="placeable")
sets background (placeables) -
async
setinit(code)
sets initial state on the server -
async
new_hover(**uuid=self.client_id, **x, **y, **id, **rot=0)
creates new hover -
async
set_hover(**uuid=self.client_id, **x, **y)
sets the new hover position -
async
drop_hover(uuid=self.client_id)
removes the hover -
async
set_cursor(**uuid=self.client_id, **x, **y)
sets cursor state
-
-
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for thepuzzlecell-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1930790207f4de64dba92664f67c1a3edb8c50b35b405cf7e43d08825652351b |
|
MD5 | a12851da699dfdcc57cba1a823c704ed |
|
BLAKE2b-256 | 47a42411b1643ac06f0434d76561f02d6c4c5d20b40c3ee2ec5a2d5b7eadabc2 |