Advertisement
ShameYT

SkMessage - plugin

Jun 28th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 KB | None | 0 0
  1. #╔═══════════════════════════════╗
  2. #║ ╔═══════════════════════════╗ ║
  3. #║ ║ ║ ║
  4. #║ ║ Message ║ ║
  5. #║ ║ Shame ║ ║
  6. #║ ║ ║ ║
  7. #║ ╚═══════════════════════════╝ ║
  8. #╚═══════════════════════════════╝
  9.  
  10. #╔═══════════════════════════════╗
  11. #╚═══════════════════════════════╝
  12.  
  13. #╔═══════════════════════════════╗
  14. #║ ╔═══════════════════════════╗ ║
  15. #║ ║ ║ ║
  16. #║ ║ Options ║ ║
  17. #║ ║ ║ ║
  18. #║ ╚═══════════════════════════╝ ║
  19. #╚═══════════════════════════════╝
  20.  
  21. options:
  22. pluginName: SkMessage
  23. #Ne changer seulement si vous savez ce que vous faites. Le modifier peut entraîner un disfonctionnement du plugin.
  24.  
  25. #╔═══════════════════════════════╗
  26. #╚═══════════════════════════════╝
  27.  
  28. #╔═══════════════════════════════╗
  29. #║ ╔═══════════════════════════╗ ║
  30. #║ ║ ║ ║
  31. #║ ║ Chargement ║ ║
  32. #║ ║ ║ ║
  33. #║ ╚═══════════════════════════╝ ║
  34. #╚═══════════════════════════════╝
  35.  
  36. function loadLang(file: text):
  37. if {_file} is set:
  38. set {authorText} to value "authorText" get of "plugins/{@pluginName}/lang/lang.yml"
  39. set {versionText} to value "versionText" get of "plugins/{@pluginName}/lang/lang.yml"
  40. set {descriptionText} to value "descriptionText" get of "plugins/{@pluginName}/lang/lang.yml"
  41. set {tagsText} to value "tagsText" get of "plugins/{@pluginName}/lang/lang.yml"
  42. set {lastVersionText} to value "lastVersionText" get of "plugins/{@pluginName}/lang/lang.yml"
  43. set {description} to value "description" get of "plugins/{@pluginName}/lang/lang.yml"
  44. set {updateFind} to value "updateFind" get of "plugins/{@pluginName}/lang/lang.yml"
  45. set {updateInstalled} to value "updateInstalled" get of "plugins/{@pluginName}/lang/lang.yml"
  46. set {messageFormat} to value "messageFormat" get of "plugins/{@pluginName}/lang/lang.yml"
  47. set {optionsPlayer} to value "optionsPlayer" get of "plugins/{@pluginName}/lang/lang.yml"
  48. set {pluginLoad} to value "pluginLoad" get of "plugins/{@pluginName}/lang/lang.yml"
  49. set {optionsMessage} to value "optionsMessage" get of "plugins/{@pluginName}/lang/lang.yml"
  50. set {optionsWorld} to value "optionsWorld" get of "plugins/{@pluginName}/lang/lang.yml"
  51. set {optionsLocation} to value "optionsLocation" get of "plugins/{@pluginName}/lang/lang.yml"
  52. set {optionsTime} to value "optionsTime" get of "plugins/{@pluginName}/lang/lang.yml"
  53. set {chatModification} to value "chatModification" get of "plugins/{@pluginName}/lang/lang.yml"
  54. set {badUsage} to value "badUsage" get of "plugins/{@pluginName}/lang/lang.yml"
  55.  
  56. on load:
  57. set {_MAJ} to text from "https://pastebin.com/raw/8AVRPRcq"
  58. if folder "plugins/WildSkript" doesn't exists:
  59. send "&7[&e!&7] The plugin WildSkript isn't installed!" to console
  60. if folder "plugins/SkQuery" doesn't exists:
  61. send "&7[&e!&7] The plugin SkQuery isn't installed!" to console
  62. if folder "plugins/{@pluginName}" doesn't exists:
  63. send "&7[&e!&7] &fPlugin's folder creation." to console
  64. create folder "plugins/{@pluginName}"
  65. if file "plugins/{@pluginName}/config.yml" doesn't exists:
  66. create file "plugins/{@pluginName}/config.yml"
  67. wf "version: %{_MAJ}%" to "plugins/{@pluginName}/config.yml"
  68. wf "message: &7@player &8>> &f@message" to "plugins/{@pluginName}/config.yml"
  69. send "&7[&e!&7] &fCreation of the plugin's file." to console
  70. if folder "plugins/{@pluginName}/lang" doesn't exists:
  71. send "&7[&e!&7] &fCreation of the language folder." to console
  72. create folder "plugins/{@pluginName}/lang"
  73. if file "plugins/{@pluginName}/lang/lang.yml" doesn't exists:
  74. skutil download file from "https://pastebin.com/raw/S3dwafX1" to file "plugins/{@pluginName}/lang/lang.yml"
  75. send "&7[&e!&7] &fLangage's file creation." to console
  76. set {formatMessage} to value "message" get of "plugins/{@pluginName}/config.yml"
  77. set {pluginVersion} to value "version" get of "plugins/{@pluginName}/config.yml"
  78. set {defaultLang} to value "lang" get of "plugins/{@pluginName}/config.yml"
  79.  
  80. loadLang("plugins/{@pluginName}/lang/lang.yml")
  81.  
  82. #╔═══════════════════════════════╗
  83. #╚═══════════════════════════════╝
  84.  
  85. #╔═══════════════════════════════╗
  86. #║ ╔═══════════════════════════╗ ║
  87. #║ ║ ║ ║
  88. #║ ║ Modifications ║ ║
  89. #║ ║ ║ ║
  90. #║ ╚═══════════════════════════╝ ║
  91. #╚═══════════════════════════════╝
  92.  
  93. on chat:
  94. if {SkMessageModifications} is true:
  95. set {_message} to {formatMessage}
  96. if {_message} is set:
  97. if {_message} contains "@player":
  98. replace all "@player" with "%player%" in {_message}
  99. if {_message} contains "@message":
  100. replace all "@message" with "%message%" in {_message}
  101. if {_message} contains "@world":
  102. replace all "@world" with "%world%" in {_message}
  103. if {_message} contains "@location":
  104. replace all "@location" with "%location%" in {_message}
  105. if {_message} contains "@now":
  106. replace all "@now" with "%now%" in {_message}
  107. cancel event
  108. broadcast "%{_message}%"
  109.  
  110.  
  111. #╔═══════════════════════════════╗
  112. #╚═══════════════════════════════╝
  113.  
  114. #╔═══════════════════════════════╗
  115. #║ ╔═══════════════════════════╗ ║
  116. #║ ║ ║ ║
  117. #║ ║ Commands ║ ║
  118. #║ ║ ║ ║
  119. #║ ╚═══════════════════════════╝ ║
  120. #╚═══════════════════════════════╝
  121.  
  122. command /{@pluginName}:version:
  123. trigger:
  124. set {_MAJ} to text from "https://pastebin.com/raw/8AVRPRcq"
  125. send "&7╔ &e%{versionText}% : &f%{pluginVersion}%"
  126. send "&7╠ &e%{authorText}% : &fShameYT"
  127. send "&7╠ &e%{descriptionText}% : &fModifier le chat minecraft !"
  128. send "&7╠ &e%{tagsText}% :&f chat, minecraft, skript"
  129. send "&7╚ &e%{lastVersionText}% :&f %{_MAJ}%"
  130.  
  131. command /{@pluginName}:reload:
  132. trigger:
  133. set {formatMessage} to value "message" get of "plugins/{@pluginName}/config.yml"
  134. set {pluginVersion} to value "version" get of "plugins/{@pluginName}/config.yml"
  135. loadLang("plugins/{@pluginName}/lang/lang.yml")
  136. set {_MAJ} to text from "https://pastebin.com/raw/8AVRPRcq"
  137. if "%{pluginVersion}%" != "%{_MAJ}%":
  138. broadcast "&7[&e!&7] &f%{updateFind}% (%{_MAJ}%)"
  139. else:
  140. broadcast "&7[&e!&7] &f%{updateInstalled}% (%{_MAJ}%)"
  141. broadcast "&7[&e!&7]&f %{pluginLoad}%"
  142. command /{@pluginName}:format:
  143. trigger:
  144. if {formatMessage} is set:
  145. broadcast "&7[&e!&7] &f%{messageFormat}%: %{formatMessage}%"
  146.  
  147. command /{@pluginName}:options:
  148. trigger:
  149. send "&7╔ &e@player : &f%{optionsPlayer}%"
  150. send "&7╠ &e@world : &f%{optionsWorld}%"
  151. send "&7╠ &e@message : &f%{optionsMessage}%"
  152. send "&7╠ &e@location : &f%{optionsLocation}%"
  153. send "&7╚ &e@now : &f%{optionsTime}%"
  154. command /{@pluginName}:enable [<text>]:
  155. trigger:
  156. if arg 1 is set:
  157. if arg 1 is "true":
  158. send "&7[&e!&7] &f%{chatModification}% true"
  159. set {SkMessageModifications} to true
  160. else if arg 1 is "false":
  161. send "&7[&e!&7] &f%{chatModification}% false"
  162. set {SkMessageModifications} to false
  163. else:
  164. send "&7[&e!&7] &f%{badUsage}% &6| &f/SkMessage:enable <true/false>"
  165. command /{@pluginName}:info:
  166. trigger:
  167. send "testt"
  168. #╔═══════════════════════════════╗
  169. #╚═══════════════════════════════╝
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement