TrinityPy is a super simple Python library for interacting with your TrinityCore 3.3.5 server. TrinityPy allows you to interact with your
server, but without fiddling with any SQL, and instead providing clean, one-liner Python solutions for many actions.
TrinityPy is compatible with the latest TrinityCore 3.3.5 version (as of this commit), and works with the new authentication system.
import TrinityPyAuth
import TrinityPyDatabase
TrinityPyDatabase.connect("127.0.0.1", 3306, "trinity", "trinity", "auth", "characters")
TrinityPyAuth.create_account("JokerMan456780", "iamjokerman2", "[email protected]")
TrinityPyAuth.change_password("JokerMan456780", "iamjokerman23")
cash = TrinityPyDatabase.get_player_money("Kalaumyaymoo")
TrinityPyDatabase.set_player_health("Kalaumyaymoo", 50)
The code above creates an account, changes its passwords, stores a player's money in a variable, and sets the player's health to 50. Pretty self-explanatory and easy, right?
Check out the wiki for more examples and documentation!
Before using any library functions, you need to connect to the database. See here for more info.
TrinityPyAuth.py
provides features such as account creation, password reset, and authentication checks.
TrinityPyDatabase.py
provides everything else!
TrinityPyAuth.py documentation
TrinityPyDatabase.py documentation
Just install the requirements, connect to your database, and use any functions you like.
Step 0) Clone this repo (git clone https://github.com/UltraFuture7000/TrinityPy
)
Step 1) pip install -r requirements.txt
to install the requirements.
Step 2) Connecting to the database:
import TrinityPyDatabase
TrinityPyDatabase.connect("127.0.0.1", 3306, "trinity", "trinity", "auth", "characters")
# You are now ready to use any TrinityPy functions!
TrinityPy is being developed for the upcoming Velamoon 3.3.5a server, but has been developed from the ground-up with the intention of it being open-source.
Use cases include using your own Python code along TrinityPy to control your server, or even a Flask or Django webserver to allow many web-based actions.
TrinityPy is licensed under the Apache License 2.0.