Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script options:
- $ db url jdbc:mysql://localhost:3306/sacre
- $ db username root
- $ db password -------------------
- on load:
- update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
- update "CREATE table IF NOT EXISTS `pins` (`name` varchar(255),`pin` int(11), `logged` varchar(255), `pinset` varchar(255))"
- update "CREATE table IF NOT EXISTS `broadcast` (`message` varchar(255))"
- update "UPDATE broadcast SET message = 'nothing'"
- command /checkrankconsole [<offline player>]:
- executable by: console
- trigger:
- if arg-1 is not set:
- send "&eUsage: /checkrank <player>"
- if arg-1 is set:
- $ thread
- update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
- set {_rank.sb.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
- every 1 seconds:
- loop all players:
- wipe loop-player's sidebar
- set name of sidebar of loop-player to "&d&lSacreHQ"
- set score "&m&d&m----------" in sidebar of loop-player to 13
- set score "&5Server" in sidebar of loop-player to 9
- set score "&fLobby-2" in sidebar of loop-player to 8
- set score "&1 " in sidebar of loop-player to 7
- set score "&5Rank" in sidebar of loop-player to 6
- set score "%{rank.%loop-player%}%" in sidebar of loop-player to 5
- set score "&4 " in sidebar of loop-player to 4
- set score "&5Website" in sidebar of loop-player to 3
- set score "&fsacre.cc" in sidebar of loop-player to 2
- set score "&d&m----------" in sidebar of loop-player to 1
- every 5 ticks:
- loop all players:
- set {_rank.%loop-player%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%loop-player%'" and close
- set {rank.%loop-player%} to "%{_rank.%loop-player%::*}%"
- set {_bc::*} to objects in column "message" from result of query "SELECT message FROM broadcast" and close
- set {bc} to "%{_bc::*}%"
- if {bc} is "<none>":
- send "&cERROR ANNOUNCEMENT" to console
- stop
- if {bc} is not "nothing":
- send loop-player title "&5Global Announcement" with subtitle "&f%{bc}%" for 5 seconds
- broadcast "&5&l(Global Announcement) &d%{bc}%"
- wait 3 ticks
- update "UPDATE broadcast SET message = 'nothing'"
- command /announce [<text>]:
- trigger:
- if arg-1 is not set:
- send "&cArgument 1 not set."
- stop
- if arg-1 is "nothing":
- send "&cError. 'nothing' is an invalid announce message."
- stop
- else:
- update "UPDATE broadcast SET message = '%arg-1%'"
- on chat:
- if {type.%player%} is "false":
- cancel event
- send "&cYou can't type while we are loading your profile!"
- if {type.%player%} is "true":
- if {logged.%player%} is "false":
- send "&cYou are not logged in."
- cancel event
- if {logged.%player%} is "true":
- if {rank.%player%} is "Owner":
- cancel event
- broadcast "&8(&4Owner&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Admin":
- cancel event
- broadcast "&8(&cAdmin&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "SrMod":
- cancel event
- broadcast "&8(&6SrMod&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Mod":
- cancel event
- broadcast "&8(&3Mod&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Helper":
- cancel event
- broadcast "&8(&aHelper&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Member":
- cancel event
- broadcast "&7%player% &8» &7%message%"
- if {logged.%player%} is not set:
- if {rank.%player%} is "Owner":
- cancel event
- broadcast "&8(&4Owner&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Admin":
- cancel event
- broadcast "&8(&cAdmin&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "SrMod":
- cancel event
- broadcast "&8(&6SrMod&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Mod":
- cancel event
- broadcast "&8(&3Mod&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Helper":
- cancel event
- broadcast "&8(&aHelper&8) &7%player% &8» &7%message%"
- if {rank.%player%} is "Member":
- cancel event
- broadcast "&7%player% &8» &7%message%"
- on first join:
- set {fjoined.%player%} to "true"
- update "INSERT INTO ranks (`name`,`rank`) VALUES ('%player%','Member')"
- set {rank.%player%} to "Member"
- on join:
- set {type.%player%} to "false"
- wait 1 second
- if {fjoined.%player%} is "true":
- execute console command "/checkrank %player%"
- execute console command "/manuadd %player% %{rank.%player%}%"
- send "&aLoading your profile..."
- wait 1 second
- send "&aProfile successfully loaded."
- set {type.%player%} to "true"
- if {fjoined.%player%} is not set:
- execute console command "/checkrank %player%"
- execute console command "/manuadd %player% %{rank.%player%}%"
- set {rank.%player%} to "Member"
- send "&aLoading your profile..."
- wait 1 second
- send "&aProfile created."
- wait 5 ticks
- send "&aProfile successfully loaded."
- set {fjoined.%player%} to "true"
- set {type.%player%} to "true"
- execute console command "/createsql %player%"
- execute console command "/manuadd %player% %{rank.%player%}%"
- command /createsql [<offline player>]:
- executable by: console
- trigger:
- if arg-1 is not set:
- send "&cError onto using &nupdatesomething&c."
- stop
- update "INSERT INTO `ranks` (`name`,`rank`) VALUES ('%arg-1%','Member')"
- send "&cCreated SQL line for %arg-1%"
- set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
- set {rank.%arg-1%} to "%{_rank.%arg-1%::*}%"
- command /resetinfo [<offline player>]:
- permission: rank.owner
- permission message: &7You must meet the requred permissions to use this command!
- trigger:
- if {logged.%player%} is "false":
- send "&cYou are not logged in."
- stop
- if {rank.%arg-1%} is not "Helper", "Mod", "SrMod", "Admin" or "Owner":
- clear {fjoined.%arg-1%}
- send "&7Cleared &5%arg-1%&7's information. Kicking player in 3 seconds."
- wait 3 seconds
- kick arg 1 because "&d&lSacreHQ%nl%%nl%&7You have been kicked.%nl%&7Your accout's information have been reset by &5%player%&7.%nl%%nl%&7Abuse? Report &5%player%&7 at &5sacre.cc"
- update "DELETE FROM ranks WHERE name='%arg-1%'"
- else:
- set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
- send "&7You can't reset &5%arg-1%&7's information due to the fact that his/her rank is %{_rank.%arg-1%::*}%"
- command /checkrank [<offline player>]:
- permission: rank.helper
- permission message: &7You must meet the requred permissions to use this command!
- trigger:
- if {logged.%player%} is "false":
- send "&cYou are not logged in."
- stop
- if arg-1 is not set:
- send "&eUsage: /checkrank <player>"
- if arg-1 is set:
- $ thread
- update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
- set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
- send "&dSacre &5» &f%arg-1%'s rank is &5%{_rank.%arg-1%::*}%&f."
- set {rank.%arg-1%} to "%{_rank.%arg-1%::*}%"
- command /updaterank [<offline player>] [<text>]:
- permission: rank.owner
- permission message: &7You must meet the requred permissions to use this command!
- trigger:
- if {logged.%player%} is "false":
- send "&cYou are not logged in."
- stop
- if arg-1 is not set:
- send "&eUsage: /updaterank <player> <rank>"
- stop
- if arg-2 is not set:
- send "&eUsage: /updaterank %arg-1% <rank>"
- stop
- if arg-2 is set:
- if arg-2 is "Owner":
- update "UPDATE `ranks` SET `rank` = 'Owner' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Owner"
- set {rank.%arg-1%} to "Owner"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is "Admin" or "Administrator":
- update "UPDATE `ranks` SET `rank` = 'Admin' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Admin"
- set {rank.%arg-1%} to "Admin"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is "SrMod", "SMod", "Sr Mod" or "SeniorMod":
- update "UPDATE `ranks` SET `rank` = 'SrMod' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Sr. Moderator"
- set {rank.%arg-1%} to "SrMod"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is "Mod", "Moderator" or "Moderatorr":
- update "UPDATE `ranks` SET `rank` = 'Mod' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Mod"
- set {rank.%arg-1%} to "Mod"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is "Helper":
- update "UPDATE `ranks` SET `rank` = 'Helper' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Helper"
- set {rank.%arg-1%} to "Helper"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is "Default", "Member", "No" or "None":
- update "UPDATE `ranks` SET `rank` = 'Member' WHERE `name` = '%arg-1%'"
- send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Member"
- set {rank.%arg-1%} to "Member"
- execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
- if arg-2 is not "Default", "Member", "No", "None", "Helper", "Mod", "Moderator", "Moderatorr", "SrMod", "SMod", "Sr Mod", "SeniorMod", "Admin", "Administrator" or "Owner":
- send "&dSacre &5» &fRank '&5%arg-2%&f' does not exist"
- command /setpin [<offline player>] [<text>]:
- permission: rank.owner
- permission message: &7You must meet the requred permissions to use this command!
- trigger:
- if {logged.%player%} is "false":
- send "&cYou are not logged in."
- stop
- if arg-1 is not set:
- send "&eUsage: /setpin <player> <int>"
- stop
- if arg-2 is not set:
- send "&eUsage: /setpin %arg-1% <int>"
- stop
- if arg-2 is "0":
- update "DELETE FROM pins WHERE name='%arg-1%'"
- send "&aPin of %arg-1% deleted."
- clear {pinset.%arg-1%}
- stop
- if arg-2 is set:
- if {pinset.%arg-1%} is not set:
- update "INSERT INTO `pins` (`name`,`pin`, `logged`,`pinset`) VALUES ('%arg-1%','1234', 'false','true')"
- update "UPDATE `pins` SET `pin` = '%arg-2%' WHERE `name` = '%arg-1%'"
- send "&a%arg-1%'s PIN has been successfully set."
- wait 1 second
- update "UPDATE `pins` SET `pinset` = 'true' WHERE `name` = '%arg-1%'"
- update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%arg-1%'"
- wait 1 second
- if {pinset.%arg-1%} is "true":
- update "UPDATE `pins` SET `pin` = '%arg-2%' WHERE `name` = '%arg-1%'"
- send "&a%arg-1%'s PIN has been successfully updated."
- update "UPDATE `pins` SET `pinset` = 'true' WHERE `name` = '%arg-1%'"
- update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%arg-1%'"
- command /pin [<text>]:
- trigger:
- set {_pinset.%player%::*} to objects in column "pinset" from result of query "SELECT pinset FROM pins WHERE name = '%player%'" and close
- set {pinset.%player%} to "%{_pinset.%player%::*}%"
- wait 1 tick
- if {type.%player%} is "false":
- stop
- if {pinset.%player%} is "<none>":
- send "&aYour account does not have a PIN."
- stop
- if {pinset.%player%} is not set:
- send "&aYour account does not have a PIN."
- stop
- if arg-1 is not set:
- send "&aNo PIN (int) specified."
- stop
- if {pinset.%player%} is "true":
- if arg-1 is set:
- if {logged.%player%} is "true":
- send "&aYou are already logged in."
- stop
- set {_pin.%player%::*} to objects in column "pin" from result of query "SELECT pin FROM pins WHERE name = '%player%'" and close
- set {pin.%player%} to "%{_pin.%player%::*}%"
- if arg-1 is "%{pin.%player%}%":
- send "&aCorrect PIN. Successfully authenticated."
- update "UPDATE `pins` SET `logged` = 'true' WHERE `name` = '%player%'"
- if arg-1 is not "%{pin.%player%}%":
- send "&cIncorrect PIN."
- update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%player%'"
- stop
- on join:
- set {spawnloc} to player's location
- if {pinset.%player%} is set:
- wait 2 seconds
- set {_pinset.%player%::*} to objects in column "pinset" from result of query "SELECT pinset FROM pins WHERE name = '%player%'" and close
- set {pinset.%player%} to "%{_pinset.%player%::*}%"
- set {_logged.%player%::*} to objects in column "logged" from result of query "SELECT logged FROM pins WHERE name = '%player%'" and close
- set {logged.%player%} to "%{_logged.%player%::*}%"
- wait 1 tick
- if {logged.%player%} is "false":
- send "&cYou are not logged in. Log in using /pin <int>"
- on quit:
- update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%player%'"
- on block break:
- if {pinset.%player%} is "true":
- if {logged.%player%} is "false":
- cancel event
- every 10 ticks:
- loop all players:
- if {pinset.%loop-player%} is set:
- set {_logged.%loop-player%::*} to objects in column "logged" from result of query "SELECT logged FROM pins WHERE name = '%loop-player%'" and close
- set {logged.%loop-player%} to "%{_logged.%loop-player%::*}%"
- if {logged.%loop-player%} is "false":
- teleport loop-player to {spawnloc}
- command /resettest [<offline player>]:
- trigger:
- clear {pinset.%arg-1%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement