Share scripts you wrote for Denizen-Bukkit here!
- Posts: 46
- Joined: August 6th, 2016, 8:35 am
- Location: Roskilde, Sjælland, Denmark
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.
- 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]>
Code: Select all
- inject SQL_Handler_Connect
- ~sql id:<[id]> "update:UPDATE `servers_status` SET `TPS=<server.recent_tps.get>,`Players`=<server.list_online_players.size>,`Max`=<server.max_players>,`Update`=<server.current_time_millis> WHERE `Server Name` = <&sq>lobby<&sq>"
- Site Admin
- Posts: 252
- Joined: August 5th, 2016, 7:27 pm
- Location: Los Angeles, California, USA
- define pass:"none"
^ that's bad syntax
- yaml id:<[id]> set Password:MyPassword
^ for these lines, you should probably include a comment saying to not change the password within the script there, only within the generated config, to avoid risk of people confusing that.
You also still have old-style braces in the script.
Also your example on the forum post has a typo - missing backtick quote for "TPS"
Denizen lead developer. On Discord as
Users browsing this forum: No registered users and 0 guests