MisterBasic

ChatController.sk

Nov 1st, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.16 KB | None | 0 0
  1. # _________________________________________
  2. # Chat Controllor
  3. # Author: MisterBasic
  4. # Version: 1.0
  5. # Desc: Gives you full control of chat.
  6. # You are using version ALPHA_1.0
  7. # Requirements:
  8. # Skript (duh)
  9. #
  10. # _________________________________________
  11.  
  12.  
  13.  
  14.  
  15. options:
  16. #________________________________________________________#
  17. # #
  18. # Configuration #
  19. #________________________________________________________#
  20. showPrefixOnJoinMessage: false
  21. enablecustomprefixes: false # This option can be buggy, please leave false this until it is fully complete
  22. enablejoinmessages: true
  23. #________________________________________________________#
  24. # #
  25. # Messages #
  26. #________________________________________________________#
  27. usage: &cUsage: /{command}
  28. prefix: &8[&9Chat&8] &r # leave blank for no prefix, prefix requires a space at the end
  29. version: ALPHA_1.0
  30. nopermission: &cYou do not have permission to execute this command!
  31. onenablemessage: &aChat Controllor has been enabled! Created by: MisterBasic
  32. ondisablemessage: &cChat Controllor has been disabled! Created by: MisterBasic
  33. blockedchatcontents: ".com"
  34. # Credits #
  35. # Remember, nothing has to be in caps. This is just a example so YOU can fill out the slots
  36. Owner: OWNERNAME
  37. credits1: JIM
  38. role1: COOWNER
  39. credits2: LEXI
  40. role2: Developer
  41. credits3: EMPTY
  42. role3: Developer
  43. credits4: KEVIN
  44. role4: MODERATOR
  45. credits5: CHICKEN
  46. role5: BUILDER
  47. credits6:
  48. role6:
  49. credits7:
  50. role7:
  51. Extra: Spigot, Bukkit, My Cat
  52. # Credits end here... #
  53. joinmessage: &c%player% has joined! Yay!
  54. firstjoinmessage: &c%player% has joined for the first time! You get a big welcome!
  55. broadcastmessagecolor: &c
  56. broadcastPrefix: &4&BROADCAST&c
  57.  
  58. # Debug #
  59. dir: plugins/Skript/scripts/Chat Controllor.sk
  60. on command "/chatcontrollor reload":
  61. set {chat_muted} to false
  62. set {noperm} to {@prefix}{@nopermission}
  63.  
  64.  
  65. ## End of the config file ##
  66.  
  67.  
  68. # WARNING!!! The Rest of this file is in the "Skript" Language, this
  69. # is for people who know the language or are interested to read. Please
  70. # don't modifiy this and betray it as your own. I would appreciate
  71. # if you credit me with the /credits command! Thank you :)
  72. #
  73. #
  74. #________________________________________________________#
  75. # #
  76. # Commands #
  77. #________________________________________________________#
  78.  
  79. command /mutechat <time> [reason]:
  80. description: Mute the chat.
  81. usage: /mutechat <time> [reason]
  82. permission: chat.command.mutechat
  83. permission message: {noperm}
  84. executable by: players and console
  85. alias: /mc
  86. trigger:
  87. set {chat_muted} to true
  88. set {time} to %args 1%
  89. set {chat_muted_reason} to %args 2%
  90. wait {time} ticks
  91. set {chat_muted} to false
  92. command /mute <player> <time> [<reason>]:
  93. description: Mute a player.
  94. usage: /mutechat <player> <time> [reason]
  95. permission: chat.command.mutechat
  96. permission message: {noperm}
  97. executable by: players
  98. alias: /mc
  99. trigger:
  100. set {mute.%args 1%} to 1
  101. set {time.%args 1%} to %args 2%
  102. set {reason.%args 1%} to %args 3%
  103. send "&aYou have successfully muted %args 1% for %args 2%: %args 3%"
  104. command /broadcast [<message>]:
  105. description: Broadcast a message to the server
  106. usage: /broadcast [message]
  107. permission: chat.command.broadcast
  108. permission message: {noperm}
  109. executable by: players
  110. alias: /announce,/bc,/a,/alert
  111. trigger:
  112. broadcast "{@broadcastprefix} {@broadcastmessagecolor} %args 1%"
  113. send "%args 1%"
  114. command /chatcolor <color>:
  115. description: Change your chat color
  116. usage: /chatcolor <colorcode>
  117. permission: chat.command.chatcolor
  118. permission message: {noperm}
  119. executable by: players
  120. trigger:
  121. set {chatcolor.%player%} to %args 1%
  122. command /setprefix <player> [prefix]:
  123. description: Set a players prefix
  124. usage: /setprefix <player> [prefix]
  125. permission: chat.command.setprefix
  126. permission message: {noperm}
  127. executable by: players
  128. trigger:
  129. set {prefix.%args 1%} to %args 2%
  130. command /getip <player>:
  131. description: Get a players IP address
  132. usage: /getip <player>
  133. permission: chat.command.getip
  134. permission message: {noperm}
  135. executable by: console
  136. trigger:
  137. player is online
  138. set {ip} to ip address of %arg 1%
  139. send "&aThe players IP address is:&r {ip}"
  140. stop trigger
  141. command /nick [<name>] [player]:
  142. description: Change a players name
  143. usage: /nick <nickname> [player]
  144. permission: chat.command.nick
  145. permission message: {noperm}
  146. executable by: player
  147. trigger:
  148. set player's display name to %args 1%
  149. if %args 1% is %executor%:
  150. send "You have changed your nickname to %args 1%"
  151. else:
  152. send "You have changed %args 2%'s name to %args 1%"
  153. on command "/chat version":
  154. player has permission "chat.version"
  155. send "{@prefix}&aThe version you are using is {@version} by MisterBasic"
  156. send "{@prefix}&aCheck the current version to see if it is outdated!"
  157. on command "/credits":
  158. if player does not have permission "chat.credits":
  159. send "{noperm}"
  160. cancel event
  161. player has permission "chat.credits"
  162. send "{@prefix}&aHere are all the staff and developers of the server!"
  163. send "{@Owner}: Owner of the server"
  164. send "{@credits1}: {@role1}"
  165. send "{@credits2}: {@role2}"
  166. send "{@credits3}: {@role3}"
  167. send "{@credits4}: {@role4}"
  168. send "{@credits5}: {@role5}"
  169. send "{@credits6}: {@role6}"
  170. send "{@credits7}: {@role7}"
  171. send "Extra: {extra}"
  172. send "Chat Controllor Developer: MisterBasic"
  173. #________________________________________________________#
  174. # #
  175. # Script and funtionality #
  176. #________________________________________________________#
  177. on chat:
  178. if {_mutedchat} is set:
  179. cancel the event
  180. message "{@prefix}&aChat has been muted for &c{time}<dark_red> seconds: {chat_muted_reason}<reset>"
  181. if {_muted.%player%} is true:
  182. cancel the event
  183. send "{@prefix} &cYou have been muted for {_muted.time.%player%}: {_muted.reason.%player%}"
  184. if {@enablecustomprefixes} is true:
  185. if {prefix.%player%} is set:
  186. cancel event
  187. set {prefix.%player%} to {groupprefix.%player%}
  188. set {prefix.%player%} to {groupsuffix.%player%}
  189. broadcast "%{prefix.%player%}% %player%%{suffix.%player%}%» %message%"
  190. # if {chatcolor.%player%} is set:
  191. # if player has permission "chat.chatcolor.use":
  192. # cancel event
  193. # broadcast "{prefix.%player%} %player%{suffix.%player%}»&{chatcolor.%player%} %message%&r"
  194. # else:
  195. # send "{@prefix}You may not use chat colors!"
  196. #________________________________________________________#
  197. # #
  198. # Join and leave Messages #
  199. #________________________________________________________#
  200. on join:
  201. if {@enablejoinmessages} is true:
  202. set {showprefix} to {@showPrefixOnJoinMessages}
  203.  
  204. if {showprefix} is set:
  205. if {showprefix} is true:
  206. send "{@prefix}{@joinmessage}"
  207. the player hasn't played before
  208. send "{@prefix}{@firstjoinmessage}"
  209. if {@showprefix} is not set:
  210. send "{@prefix}&cERROR: Config 'showPrefixOnJoinMessages' is empty!!! Please go into {@dir} and set it to true|false!" to console
  211. on first join:
  212. if {@enablejoinmessages} is true:
  213. set {showprefix} to {@showprefix}
  214.  
  215. if {showprefix} is set:
  216. if {showprefix} is true:
  217. send "{@prefix}{@joinmessage}"
  218. the player has played before
  219. send "{@prefix}{@firstjoinmessage}"
  220. else:
  221. if {@showprefix} is not set:
  222. send "{@prefix}&cERROR: Config 'showprefix:' is empty!!! Please go into {@dir} and set it to true|false!" to console
  223. else:
  224. send "{@prefix}ERROR: No clue what happened, contact the developer."
  225.  
  226.  
  227. #________________________________________________________#
  228. # #
  229. # Plugin #
  230. #________________________________________________________#
  231. on enable:
  232. send "{@onenablemessage}"
  233. on disable:
  234. send "{@ondisablemessage}"
Advertisement
Add Comment
Please, Sign In to add comment