FlupMC

SkriptEnchanced - Fork

Apr 23rd, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. options:
  2. #
  3. # _____ _ _ _ ______ _ _
  4. # / ____| | (_) | | | ____| | | | |
  5. # | (___ | | ___ __ _ _ __ | |_| |__ _ __ | |__ __ _ _ __ ___ ___ __| |
  6. # \___ \| |/ / '__| | '_ \| __| __| | '_ \| '_ \ / _` | '_ \ / __/ _ \/ _` |
  7. # ____) | <| | | | |_) | |_| |____| | | | | | | (_| | | | | (_| __/ (_| |
  8. # |_____/|_|\_\_| |_| .__/ \__|______|_| |_|_| |_|\__,_|_| |_|\___\___|\__,_|
  9. # | |
  10. # Adds many |_| useful features that enhance the usage of Skript.
  11. #
  12. #
  13. # Script: SkriptEnhanced
  14. # Author: Duetro, recoded to 1.8 by FlupMC
  15. # Version: 2.00
  16. #
  17. #
  18. # Dependencies:
  19. # - Skript 2.3.1 # Download: https://github.com/SkriptLang/Skript/releases (use 2.3-alpha4 for 1.13)
  20. # - skript-mirror 2 # Download: https://skripttools.net/?q=skript-mirror
  21. # - MundoSK 1.8.6-BETA.55 # Download: https://skripttools.net/?q=MundoSK
  22. # - ProtocolLib # Download: https://www.spigotmc.org/resources/protocollib.1997/
  23. #
  24. # Settings:
  25. skript_prefix: &7[&bSkript&7] # Default: &7[&bSkript&7]
  26. skript_color: &6 # Default: &6
  27. preview_limit: 55 # Default: 55 | Limit of characters in one line while hovering the errors
  28.  
  29. notify_ingame: true # Default: true
  30. check_update: true # Default: true
  31.  
  32. # -> You should not change the code below unless you know what you are doing.
  33.  
  34. version: 2.00
  35. mcskriptsid: 3000
  36.  
  37.  
  38.  
  39. function SendMessage(p: player, type: text, message: text):
  40. if {_type} contains "se.":
  41. set {_prefix} to "&7[&bSkriptEnhanced&7]"
  42. replace all "se." in {_type} with ""
  43. else:
  44. set {_prefix} to "{@skript_prefix}"
  45. if {_type} is "error":
  46. set {_icon} to "&4&l✖&c "
  47. replace all "&r" in {_message} with "&c"
  48. else if {_type} is "success":
  49. set {_icon} to "&2&l✔&a "
  50. replace all "&r" in {_message} with "&a"
  51. else:
  52. set {_icon} to "&f"
  53. replace all "&r" in {_message} with "&f"
  54. send "%{_prefix}% %{_icon}%%{_message}%" to {_p}
  55.  
  56.  
  57. command /se [<text>] [<text>] [<integer>] [<text>]:
  58. aliases: /skriptenhanced
  59. permission: skript.admin
  60. trigger:
  61. if arg-1 is "update":
  62. SendMessage(player, "se.info", "Tjekker for opdateringer...")
  63. if {SkriptEnhanced::latestversion} isn't set:
  64. set {_dl} to text from ""
  65. if {_dl} isn't set:
  66. SendMessage(player, "se.error", "&rAn error as occurred while trying to to check for updates. Please check for Updates manually! Download: {@mcskripts}")
  67. exit
  68. set {SkriptEnhanced::latestversion} to {_dl::1}
  69. send " &7Nuværende version: v{@version} (Seneste: v%{SkriptEnhanced::latestversion}%)"
  70. if {SkriptEnhanced::latestversion} is "{@version}":
  71. SendMessage(player, "se.success", "Du har den seneste version af SkriptEnhanced-Flup!")
  72. else:
  73. SendMessage(player, "se.info", "Fjerner SkriptEnhanced...")
  74. SE2_deleteFile("plugins/Skript/scripts/%script%.sk")
  75. if SE2_fileExists("plugins/Skript/scripts/%script%.sk"):
  76. SE2_SendMessage(player, "se.error", "An error as occurred while trying to delete SkriptEnhanced. Please update manually! Download: {@skunity}")
  77. exit
  78. SE2_SendMessage(player, "se.info", "Downloading SkriptEnhanced...")
  79. set {_fw} to try new FileWriter(SE2_fixPath("plugins/Skript/scripts/%script%.sk") and true)
  80. set {_contents::*} to SE2_downloadString("http://api.duetro.de/skriptenhanced/dl/SkriptEnhanced.sk")https://mcskripts.dk/run/search/download?id=3198
  81. if {_contents::1} isn't "options:":
  82. SE2_SendMessage(player, "se.error", "An error as occurred while trying to download the script. Please update manually! Download: {@skunity}")
  83. exit
  84. loop {_contents::*}:
  85. {_fw}.write(loop-value)
  86. {_fw}.write(System.getProperty("line.separator"))
  87. {_fw}.close()
  88. if SE2_fileExists("plugins/Skript/scripts/%script%.sk") isn't true:
  89. SE2_SendMessage(player, "se.error", "An error as occurred while trying to download the script. Please update manually! Download: {@skunity}")
  90. exit
  91. SE2_SendMessage(player, "se.info", "Reloading SkriptEnhanced...")
  92. execute console command "/skript reload %script%"
  93. SE2_SendMessage(player, "se.success", "Successfully updated to SkriptEnhanced v%{SkriptEnhanced::latestversion}%!")
Advertisement
Add Comment
Please, Sign In to add comment