Advertisement
Guest User

Untitled

a guest
Aug 25th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.34 KB | None | 0 0
  1.  
  2. script options:
  3. $ db url jdbc:mysql://localhost:3306/sacre
  4. $ db username root
  5. $ db password -------------------
  6.  
  7. on load:
  8. update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
  9. update "CREATE table IF NOT EXISTS `pins` (`name` varchar(255),`pin` int(11), `logged` varchar(255), `pinset` varchar(255))"
  10. update "CREATE table IF NOT EXISTS `broadcast` (`message` varchar(255))"
  11. update "UPDATE broadcast SET message = 'nothing'"
  12.  
  13. command /checkrankconsole [<offline player>]:
  14. executable by: console
  15. trigger:
  16. if arg-1 is not set:
  17. send "&eUsage: /checkrank <player>"
  18. if arg-1 is set:
  19. $ thread
  20. update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
  21. set {_rank.sb.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
  22.  
  23. every 1 seconds:
  24. loop all players:
  25. wipe loop-player's sidebar
  26. set name of sidebar of loop-player to "&d&lSacreHQ"
  27. set score "&m&d&m----------" in sidebar of loop-player to 13
  28. set score "&5Server" in sidebar of loop-player to 9
  29. set score "&fLobby-2" in sidebar of loop-player to 8
  30. set score "&1 " in sidebar of loop-player to 7
  31. set score "&5Rank" in sidebar of loop-player to 6
  32. set score "%{rank.%loop-player%}%" in sidebar of loop-player to 5
  33. set score "&4 " in sidebar of loop-player to 4
  34. set score "&5Website" in sidebar of loop-player to 3
  35. set score "&fsacre.cc" in sidebar of loop-player to 2
  36. set score "&d&m----------" in sidebar of loop-player to 1
  37.  
  38. every 5 ticks:
  39. loop all players:
  40. set {_rank.%loop-player%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%loop-player%'" and close
  41. set {rank.%loop-player%} to "%{_rank.%loop-player%::*}%"
  42. set {_bc::*} to objects in column "message" from result of query "SELECT message FROM broadcast" and close
  43. set {bc} to "%{_bc::*}%"
  44. if {bc} is "<none>":
  45. send "&cERROR ANNOUNCEMENT" to console
  46. stop
  47. if {bc} is not "nothing":
  48. send loop-player title "&5Global Announcement" with subtitle "&f%{bc}%" for 5 seconds
  49. broadcast "&5&l(Global Announcement) &d%{bc}%"
  50. wait 3 ticks
  51. update "UPDATE broadcast SET message = 'nothing'"
  52.  
  53.  
  54. command /announce [<text>]:
  55. trigger:
  56. if arg-1 is not set:
  57. send "&cArgument 1 not set."
  58. stop
  59. if arg-1 is "nothing":
  60. send "&cError. 'nothing' is an invalid announce message."
  61. stop
  62. else:
  63. update "UPDATE broadcast SET message = '%arg-1%'"
  64.  
  65.  
  66. on chat:
  67. if {type.%player%} is "false":
  68. cancel event
  69. send "&cYou can't type while we are loading your profile!"
  70. if {type.%player%} is "true":
  71. if {logged.%player%} is "false":
  72. send "&cYou are not logged in."
  73. cancel event
  74. if {logged.%player%} is "true":
  75. if {rank.%player%} is "Owner":
  76. cancel event
  77. broadcast "&8(&4Owner&8) &7%player% &8» &7%message%"
  78. if {rank.%player%} is "Admin":
  79. cancel event
  80. broadcast "&8(&cAdmin&8) &7%player% &8» &7%message%"
  81. if {rank.%player%} is "SrMod":
  82. cancel event
  83. broadcast "&8(&6SrMod&8) &7%player% &8» &7%message%"
  84. if {rank.%player%} is "Mod":
  85. cancel event
  86. broadcast "&8(&3Mod&8) &7%player% &8» &7%message%"
  87. if {rank.%player%} is "Helper":
  88. cancel event
  89. broadcast "&8(&aHelper&8) &7%player% &8» &7%message%"
  90. if {rank.%player%} is "Member":
  91. cancel event
  92. broadcast "&7%player% &8» &7%message%"
  93. if {logged.%player%} is not set:
  94. if {rank.%player%} is "Owner":
  95. cancel event
  96. broadcast "&8(&4Owner&8) &7%player% &8» &7%message%"
  97. if {rank.%player%} is "Admin":
  98. cancel event
  99. broadcast "&8(&cAdmin&8) &7%player% &8» &7%message%"
  100. if {rank.%player%} is "SrMod":
  101. cancel event
  102. broadcast "&8(&6SrMod&8) &7%player% &8» &7%message%"
  103. if {rank.%player%} is "Mod":
  104. cancel event
  105. broadcast "&8(&3Mod&8) &7%player% &8» &7%message%"
  106. if {rank.%player%} is "Helper":
  107. cancel event
  108. broadcast "&8(&aHelper&8) &7%player% &8» &7%message%"
  109. if {rank.%player%} is "Member":
  110. cancel event
  111. broadcast "&7%player% &8» &7%message%"
  112.  
  113. on first join:
  114. set {fjoined.%player%} to "true"
  115. update "INSERT INTO ranks (`name`,`rank`) VALUES ('%player%','Member')"
  116. set {rank.%player%} to "Member"
  117.  
  118. on join:
  119. set {type.%player%} to "false"
  120. wait 1 second
  121. if {fjoined.%player%} is "true":
  122. execute console command "/checkrank %player%"
  123. execute console command "/manuadd %player% %{rank.%player%}%"
  124. send "&aLoading your profile..."
  125. wait 1 second
  126. send "&aProfile successfully loaded."
  127. set {type.%player%} to "true"
  128. if {fjoined.%player%} is not set:
  129. execute console command "/checkrank %player%"
  130. execute console command "/manuadd %player% %{rank.%player%}%"
  131. set {rank.%player%} to "Member"
  132. send "&aLoading your profile..."
  133. wait 1 second
  134. send "&aProfile created."
  135. wait 5 ticks
  136. send "&aProfile successfully loaded."
  137. set {fjoined.%player%} to "true"
  138. set {type.%player%} to "true"
  139. execute console command "/createsql %player%"
  140. execute console command "/manuadd %player% %{rank.%player%}%"
  141.  
  142.  
  143. command /createsql [<offline player>]:
  144. executable by: console
  145. trigger:
  146. if arg-1 is not set:
  147. send "&cError onto using &nupdatesomething&c."
  148. stop
  149. update "INSERT INTO `ranks` (`name`,`rank`) VALUES ('%arg-1%','Member')"
  150. send "&cCreated SQL line for %arg-1%"
  151. set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
  152. set {rank.%arg-1%} to "%{_rank.%arg-1%::*}%"
  153.  
  154.  
  155.  
  156. command /resetinfo [<offline player>]:
  157. permission: rank.owner
  158. permission message: &7You must meet the requred permissions to use this command!
  159. trigger:
  160. if {logged.%player%} is "false":
  161. send "&cYou are not logged in."
  162. stop
  163. if {rank.%arg-1%} is not "Helper", "Mod", "SrMod", "Admin" or "Owner":
  164. clear {fjoined.%arg-1%}
  165. send "&7Cleared &5%arg-1%&7's information. Kicking player in 3 seconds."
  166. wait 3 seconds
  167. 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"
  168. update "DELETE FROM ranks WHERE name='%arg-1%'"
  169. else:
  170. set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
  171. send "&7You can't reset &5%arg-1%&7's information due to the fact that his/her rank is %{_rank.%arg-1%::*}%"
  172.  
  173. command /checkrank [<offline player>]:
  174. permission: rank.helper
  175. permission message: &7You must meet the requred permissions to use this command!
  176. trigger:
  177. if {logged.%player%} is "false":
  178. send "&cYou are not logged in."
  179. stop
  180. if arg-1 is not set:
  181. send "&eUsage: /checkrank <player>"
  182. if arg-1 is set:
  183. $ thread
  184. update "CREATE table IF NOT EXISTS `ranks` (`name` varchar(255),`rank` varchar(255))"
  185. set {_rank.%arg-1%::*} to objects in column "rank" from result of query "SELECT rank FROM ranks WHERE name = '%arg-1%'" and close
  186. send "&dSacre &5» &f%arg-1%'s rank is &5%{_rank.%arg-1%::*}%&f."
  187. set {rank.%arg-1%} to "%{_rank.%arg-1%::*}%"
  188.  
  189. command /updaterank [<offline player>] [<text>]:
  190. permission: rank.owner
  191. permission message: &7You must meet the requred permissions to use this command!
  192. trigger:
  193. if {logged.%player%} is "false":
  194. send "&cYou are not logged in."
  195. stop
  196. if arg-1 is not set:
  197. send "&eUsage: /updaterank <player> <rank>"
  198. stop
  199. if arg-2 is not set:
  200. send "&eUsage: /updaterank %arg-1% <rank>"
  201. stop
  202. if arg-2 is set:
  203. if arg-2 is "Owner":
  204. update "UPDATE `ranks` SET `rank` = 'Owner' WHERE `name` = '%arg-1%'"
  205. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Owner"
  206. set {rank.%arg-1%} to "Owner"
  207. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  208. if arg-2 is "Admin" or "Administrator":
  209. update "UPDATE `ranks` SET `rank` = 'Admin' WHERE `name` = '%arg-1%'"
  210. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Admin"
  211. set {rank.%arg-1%} to "Admin"
  212. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  213. if arg-2 is "SrMod", "SMod", "Sr Mod" or "SeniorMod":
  214. update "UPDATE `ranks` SET `rank` = 'SrMod' WHERE `name` = '%arg-1%'"
  215. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Sr. Moderator"
  216. set {rank.%arg-1%} to "SrMod"
  217. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  218. if arg-2 is "Mod", "Moderator" or "Moderatorr":
  219. update "UPDATE `ranks` SET `rank` = 'Mod' WHERE `name` = '%arg-1%'"
  220. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Mod"
  221. set {rank.%arg-1%} to "Mod"
  222. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  223. if arg-2 is "Helper":
  224. update "UPDATE `ranks` SET `rank` = 'Helper' WHERE `name` = '%arg-1%'"
  225. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Helper"
  226. set {rank.%arg-1%} to "Helper"
  227. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  228. if arg-2 is "Default", "Member", "No" or "None":
  229. update "UPDATE `ranks` SET `rank` = 'Member' WHERE `name` = '%arg-1%'"
  230. send "&dSacre &5» &fUpdated %arg-1%'s rank to &5Member"
  231. set {rank.%arg-1%} to "Member"
  232. execute console command "/manuadd %arg-1% %{rank.%arg-1%}%"
  233. if arg-2 is not "Default", "Member", "No", "None", "Helper", "Mod", "Moderator", "Moderatorr", "SrMod", "SMod", "Sr Mod", "SeniorMod", "Admin", "Administrator" or "Owner":
  234. send "&dSacre &5» &fRank '&5%arg-2%&f' does not exist"
  235.  
  236. command /setpin [<offline player>] [<text>]:
  237. permission: rank.owner
  238. permission message: &7You must meet the requred permissions to use this command!
  239. trigger:
  240. if {logged.%player%} is "false":
  241. send "&cYou are not logged in."
  242. stop
  243. if arg-1 is not set:
  244. send "&eUsage: /setpin <player> <int>"
  245. stop
  246. if arg-2 is not set:
  247. send "&eUsage: /setpin %arg-1% <int>"
  248. stop
  249. if arg-2 is "0":
  250. update "DELETE FROM pins WHERE name='%arg-1%'"
  251. send "&aPin of %arg-1% deleted."
  252. clear {pinset.%arg-1%}
  253. stop
  254. if arg-2 is set:
  255. if {pinset.%arg-1%} is not set:
  256. update "INSERT INTO `pins` (`name`,`pin`, `logged`,`pinset`) VALUES ('%arg-1%','1234', 'false','true')"
  257. update "UPDATE `pins` SET `pin` = '%arg-2%' WHERE `name` = '%arg-1%'"
  258. send "&a%arg-1%'s PIN has been successfully set."
  259. wait 1 second
  260. update "UPDATE `pins` SET `pinset` = 'true' WHERE `name` = '%arg-1%'"
  261. update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%arg-1%'"
  262. wait 1 second
  263. if {pinset.%arg-1%} is "true":
  264. update "UPDATE `pins` SET `pin` = '%arg-2%' WHERE `name` = '%arg-1%'"
  265. send "&a%arg-1%'s PIN has been successfully updated."
  266. update "UPDATE `pins` SET `pinset` = 'true' WHERE `name` = '%arg-1%'"
  267. update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%arg-1%'"
  268.  
  269. command /pin [<text>]:
  270. trigger:
  271. set {_pinset.%player%::*} to objects in column "pinset" from result of query "SELECT pinset FROM pins WHERE name = '%player%'" and close
  272. set {pinset.%player%} to "%{_pinset.%player%::*}%"
  273. wait 1 tick
  274. if {type.%player%} is "false":
  275. stop
  276. if {pinset.%player%} is "<none>":
  277. send "&aYour account does not have a PIN."
  278. stop
  279. if {pinset.%player%} is not set:
  280. send "&aYour account does not have a PIN."
  281. stop
  282. if arg-1 is not set:
  283. send "&aNo PIN (int) specified."
  284. stop
  285. if {pinset.%player%} is "true":
  286. if arg-1 is set:
  287. if {logged.%player%} is "true":
  288. send "&aYou are already logged in."
  289. stop
  290. set {_pin.%player%::*} to objects in column "pin" from result of query "SELECT pin FROM pins WHERE name = '%player%'" and close
  291. set {pin.%player%} to "%{_pin.%player%::*}%"
  292. if arg-1 is "%{pin.%player%}%":
  293. send "&aCorrect PIN. Successfully authenticated."
  294. update "UPDATE `pins` SET `logged` = 'true' WHERE `name` = '%player%'"
  295. if arg-1 is not "%{pin.%player%}%":
  296. send "&cIncorrect PIN."
  297. update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%player%'"
  298. stop
  299.  
  300.  
  301. on join:
  302. set {spawnloc} to player's location
  303. if {pinset.%player%} is set:
  304. wait 2 seconds
  305. set {_pinset.%player%::*} to objects in column "pinset" from result of query "SELECT pinset FROM pins WHERE name = '%player%'" and close
  306. set {pinset.%player%} to "%{_pinset.%player%::*}%"
  307. set {_logged.%player%::*} to objects in column "logged" from result of query "SELECT logged FROM pins WHERE name = '%player%'" and close
  308. set {logged.%player%} to "%{_logged.%player%::*}%"
  309. wait 1 tick
  310. if {logged.%player%} is "false":
  311. send "&cYou are not logged in. Log in using /pin <int>"
  312.  
  313. on quit:
  314. update "UPDATE `pins` SET `logged` = 'false' WHERE `name` = '%player%'"
  315.  
  316. on block break:
  317. if {pinset.%player%} is "true":
  318. if {logged.%player%} is "false":
  319. cancel event
  320.  
  321. every 10 ticks:
  322. loop all players:
  323. if {pinset.%loop-player%} is set:
  324. set {_logged.%loop-player%::*} to objects in column "logged" from result of query "SELECT logged FROM pins WHERE name = '%loop-player%'" and close
  325. set {logged.%loop-player%} to "%{_logged.%loop-player%::*}%"
  326. if {logged.%loop-player%} is "false":
  327. teleport loop-player to {spawnloc}
  328.  
  329.  
  330. command /resettest [<offline player>]:
  331. trigger:
  332. clear {pinset.%arg-1%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement