9nq

Untitled

9nq
Jan 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. Ifunction updateChecker(n: number):
  2. set {_csver} to line 1 from url "https://api.spigotmc.org/legacy/update.php?resource=35948/" parsed as a number
  3. set {_csv} to "%{csversion}%" parsed as a number
  4. if {_csver} is equal to {_csv}:
  5. message "&c&l(!) &7Successfully loaded the latest version of CommandSpy &8v&a%{csversion}%&7." to console
  6. else if {_csv} is greater than {_csver}:
  7. send "&c&l(!) &7Either you're running a beta version or you changed the version number! (&8v&a%{csversion}%&7)" to console
  8. else:
  9. send "&c&l(!) &7An update is available! (&a%{_csv}% &7-> &a%{_csver}%&7)" to console
  10. send "&c&l(!) &7Download it here: &fhttp://bit.ly/2BzFgKd" to console
  11.  
  12. function updateCheckerCmd(p: player):
  13. set {_csver} to line 1 from url "https://api.spigotmc.org/legacy/update.php?resource=35948/" parsed as a number
  14. set {_csv} to "%{csversion}%" parsed as a number
  15. if {_csver} is equal to {_csv}:
  16. send "&c&l(!) &7You are currently running the latest version of CommandSpy &8v&a%{csversion}%&7." to {_p}
  17. else if {_csv} is greater than {_csver}:
  18. send "&c&l(!) &7Either you're running a beta version or you changed the version number! (&8v&a%{csversion}%&7)" to {_p}
  19. else:
  20. send "&c&l(!) &7An update is available! (&a%{_csv}% &7-> &a%{_csver}%&7)" to {_p}
  21. send "&c&l(!) &7Download it here: &fhttp://bit.ly/2BzFgKd" to {_p}
  22.  
  23. command /commandspy [<player>]:
  24. aliases: /commands, /cspy
  25. permission: commandspy.use
  26. permission message: &e&l(!) You cannot use this command!
  27. trigger:
  28. if arg 1 is set:
  29. if {cs::%uuid of arg 1%} is set:
  30. clear {cs::%uuid of arg 1%}
  31. send "&c&l(!) Command spy has been disabled for %arg 1%."
  32. send "&c&l(!) Your command spy has been disabled." to arg 1
  33. else:
  34. set {cs::%uuid of arg 1%} to true
  35. send "&a&l(!) Your command spy has been enabled." to arg 1
  36. send "&a&l(!) Command spy has been enabled for %arg 1%."
  37. else:
  38. if {cs::%uuid of player%} is set:
  39. clear {cs::%uuid of player%}
  40. send "&c&l(!) Your command spy has been disabled."
  41. else:
  42. set {cs::%uuid of player%} to true
  43. send "&a&l(!) Your command spy has been enabled."
  44. command /commandspyupdater [<text>]:
  45. permission: commandspy.admin
  46. permission message: &e&l(!) You cannot use this command!
  47. trigger:
  48. if arg 1 is set:
  49. if arg 1 is "toggle":
  50. if {csupdater} is true:
  51. set {csupdater} to false
  52. send "&e&l(!) Successfully set the updater to false."
  53. else:
  54. set {csupdater} to true
  55. send "&e&l(!) Successfully set the updater to true."
  56. else if arg 1 is "check":
  57. updateCheckerCmd(player)
  58. else:
  59. send "&e&l(!) Unknown argument."
  60. else:
  61. if {csupdater} is true:
  62. set {csupdater} to false
  63. send "&e&l(!) Successfully set the updater to false."
  64. else:
  65. set {csupdater} to true
  66. send "&e&l(!) Successfully set the updater to true."
  67. on command:
  68. if sender is a player:
  69. loop all players:
  70. if {cs::%uuid of loop-player%} is set:
  71. if "%player%" is not "%loop-player%":
  72. send "&c&l(!) %player% executed the command &n/%complete command%&c&l." to loop-player
  73. on load:
  74. set {csversion} to "1.3"
  75. message "&4&l(!) Successfully loaded CommandSpy&7." to console
  76. on unload:
  77. message "&4&l(!) &7Successfully unloaded CommandSpy&7. Goodbye!" to console
  78. on quit:
  79. delete {cs::%uuid of player%}
  80. on skript load:
  81. if {csupdater} is true:
  82. updateChecker(1)
  83. every 5 minutes:
  84. if {csupdater} is true:
  85. updateChecker(1)
Advertisement
Add Comment
Please, Sign In to add comment