This handler takes care of the SQL connection and should be used whenever you make SQL tasks.
This only handles a single connection for simplicity reasons.
Instructions:
Example:
This only handles a single connection for simplicity reasons.
Instructions:
- Download the script here: https://one.denizenscript.com/paste/59562.txt
- Place the script in your script folder.
- Restart server or reload scripts
- Configure the file: plugins/denizen/data/sql/config.yml (path is the address with the SQL database)
- Place `- inject SQL_Handler_Connect` right before you have SQL commands; use the SQL ID definition: <[id]>
Example:
Code:
- inject SQL_Handler_Connect
- ~sql id:<[id]> "update:UPDATE `servers_status` SET `TPS=<server.recent_tps.get[1]>,`Players`=<server.list_online_players.size>,`Max`=<server.max_players>,`Update`=<server.current_time_millis> WHERE `Server Name` = <&sq>lobby<&sq>"