Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- #MySQL Options
- on script load:
- set {sql::SkQuerySQLforAlgorithm} to the database "mysql://localhost:3306/rainbow?username=root&password=adminchange&useSSL=false"
- #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- on load:
- execute "CREATE TABLE IF NOT EXISTS `info` (`uuid` varchar(255), `rank` varchar(10))" in {sql::SkQuerySQLforAlgorithm}
- on join:
- execute "SELECT `rank` FROM `rainbow`.`info` WHERE uuid = %player's uuid%" in {sql::SkQuerySQLforAlgorithm} and store the result in {_sqlOutput::*}
- set {_checkIfNone::*} to {_sqlOutput::rank::*}
- if "%{_checkIfNone::*}%" is "<none>":
- execute "INSERT INTO info (`uuid`, `rank`) VALUES (%player's uuid%, 'default')" in {sql::SkQuerySQLforAlgorithm}
- send "&7You're a new player! Giving you the default rank!" to player
- else:
- execute "UPDATE `info` SET `rank` = 'default' WHERE uuid = %player's UUID%" in {sql::SkQuerySQLforAlgorithm}
- send "&7You're not a new player! Giving you the default rank, so Andrew knows all of the SQL queries. xD" to player
- on quit:
- execute "DELETE FROM `info` WHERE `uuid` = %player's UUID% AND `rank` = 'default'" in {sql::SkQuerySQLforAlgorithm}
- broadcast "&7Yea boi!!!!!!!! DELETED rank data from database to save data!! Just kidding, delted it so Andrew knows all of the SQL queries. xD"
- command /tell [<offline player>] [<string>]:
- trigger:
- if arg 1 is online:
- if arg 1 is player:
- send "&9Sorry, you can't message yourself."
- stop
- else:
- execute "SELECT `rank` FROM `rainbow`.`info` WHERE uuid = %player's uuid%" in {sql::SkQuerySQLforAlgorithm} and store the result in {_sqlOutput::*}
- set {_rank::*} to {_sqlOutput::rank::*}
- execute "SELECT `rank` FROM `rainbow`.`info` WHERE uuid = %arg-1's uuid%" in {sql::SkQuerySQLforAlgorithm} and store the result in {_sqlOutput::*}
- set {_rankTwo::*} to {_sqlOutput::rank::*}
- send "%{_rank::*}% %player% -> %arg-2%" to arg-1
- send "%{_rank::*}% %player% -> %arg-2%" to player
- else:
- send "&9Sorry, they're offline."
- #UPDATE
- #Multiple checks SQL
- on chat:
- cancel event
- execute "SELECT `rank` FROM `rainbow`.`info` WHERE uuid = %player's uuid% AND username = %player%" in {sql::SkQuerySQLforAlgorithm} and store the result in {_sqlOutput::*}
- set {_checkIfNone::*} to {_sqlOutput::rank::*}
- if "%{_checkIfNone::*}%" is not "<none>":
- broadcast "%{_checkIfNone::1}% %player% %message%"
- else:
- send "Eh you might have to rejoin so we can get the data."
- #----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement