MisterBasic

AntiSwear [Skript]

Nov 13th, 2017
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.83 KB | None | 0 0
  1. # Created by MisterBasic, only by MisterBasic!
  2. options:
  3. enabled: true
  4. custom_chat: false
  5. version: 1.4 # Release
  6.  
  7. blocked_domains: ".com" or ".tk" or ".net" or ".org" or ".onion" or ".serv.nu" or ".gs" or ".server" or ".pro" or ".aternos" or ".me" or ".minehut" or ".int" or ".edu" or ".abc" or ".bot" or ".buy" or ".dev" # Add more if you wish. These are just the main ones
  8.  
  9. on chat:
  10. if {PLUGIN::enabled} is true:
  11. if message contains {@blocked_domains}:
  12. player does not have permission "antiswear.bypass" or "antiswear.admin"
  13. cancel event
  14. send "%{antiswear::prefix}%%{MESSAGES::no-advert}%"
  15. set {_messager} to the player
  16. loop all players:
  17. loop-player has permission "antiswear.notify" or "antiswear.admin"
  18. send "%{antiswear::prefix}%&6Advertisement Detected by %{_messager}%: %message%" to loop-player
  19. stop
  20. if message contains {antiswear::blockedwords::*}:
  21. player does not have permission "antiswear.bypass" or "antiswear.admin"
  22. replace every {antiswear::blockedwords::*} in message with "%{MESSAGES::censor}%"
  23. send "%{antiswear::prefix}%%{MESSAGES::no-cussing}%"
  24. set {_messager} to the player
  25. loop all players:
  26. loop-player has permission "antiswear.notify" or "antiswear.admin"
  27. send "%{antiswear::prefix}%&6Swear Detected by %{_messager}%: %message%" to loop-player
  28. stop
  29. if {antiswear::chatdisabled} is true:
  30. cancel event
  31. send "%{MESSAGES::chat-disabled}%" to player
  32. if {chatmode.%player%} is "staffchat":
  33. cancel event
  34. loop all players:
  35. send "%{MESSAGES::staffchat-prefix}% %message%" to loop-player
  36. if {@custom_chat} is true:
  37. cancel event
  38. if {prefix.%player%} is not set:
  39. set {prefix.%player%} to ""
  40. if {suffix.%player%} is not set:
  41. set {suffix.%player%} to ""
  42. broadcast "%{prefix.%player%}%%player%%{suffix.%player%}%&r: %message%"
  43. if {prefix.%player%} is "":
  44. clear {prefix.%player%}
  45. if {suffix.%player%} is "":
  46. clear {suffix.%player%}
  47. on join:
  48. if {prefix.%player%} is not set:
  49. set {prefix.%player%} to ""
  50. if {suffix.%player%} is not set:
  51. set {suffix.%player%} to ""
  52. set player's display name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  53. set player's tablist name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  54. if {prefix.%player%} is "":
  55. clear {prefix.%player%}
  56. if {suffix.%player%} is "":
  57. clear {suffix.%player%}
  58. every 5 seconds:
  59. loop all players:
  60. if {prefix.%loop-player%} is not set:
  61. set {prefix.%loop-player%} to ""
  62. if {suffix.%loop-player%} is not set:
  63. set {suffix.%loop-player%} to ""
  64. set loop-player's display name to "%{prefix.%loop-player%}%%loop-player%%{suffix.%loop-player%}%"
  65. set loop-player's tablist name to "%{prefix.%loop-player%}%%loop-player%%{suffix.%loop-player%}%"
  66. if {prefix.%loop-player%} is "":
  67. clear {prefix.%loop-player%}
  68. if {suffix.%loop-player%} is "":
  69. clear {suffix.%loop-player%}
  70. command /antiswear:antiswear [<text>] [<text>]:
  71. description: Main command for AntiSwear
  72. aliases: /as, /atsw, /noswear, /ns, /aswear, /swear, /antiswear
  73. executable by: console and players
  74. trigger:
  75. if {PLUGIN::enabled} is true:
  76. if sender has permission "antiswear.use" or "antiswear.admin":
  77. if arg 1 is not set:
  78. wait 2 ticks
  79. send "%{antiswear::prefix}%&eCurrent Version: &a%{PLUGIN::version}%&e, should be up to date!"
  80. send "%{antiswear::prefix}%&eUse ""/antiswear help"" to list all commands!"
  81. exit
  82. if arg 1 is set:
  83. if arg 1 is "help":
  84. if arg 2 is "1":
  85. send "&8&m------------- &7 AntiSwear &8&m------------------"
  86. send "&7/antiswear: Main command"
  87. send "&7/antiswear version: Get the version"
  88. send "&7/antiswear reload: Reload the skript / config"
  89. send "&7/antiswear add [word]: Add a blocked word"
  90. send "&7/antiswear remove [word]: Remove a blocked word"
  91. send "&7/antiswear list: List all blocked words"
  92. send "&7/antiswear broadcast [message]: Broadcast a msg"
  93. send "&7/antiswear test: Test the skript"
  94. send "&7/antiswear notify [true|false]: Toggle Notifications"
  95. send "&8&m----------------------------- &7Page 1&8&m ---"
  96. exit
  97. if arg 2 is not set:
  98. send "&8&m------------- &7 AntiSwear &8&m------------------"
  99. send "&7/antiswear: Main command"
  100. send "&7/antiswear version: Get the version"
  101. send "&7/antiswear reload: Reload the skript / config"
  102. send "&7/antiswear add [word]: Add a blocked word"
  103. send "&7/antiswear remove [word]: Remove a blocked word"
  104. send "&7/antiswear list: List all blocked words"
  105. send "&7/antiswear broadcast [message]: Broadcast a msg"
  106. send "&7/antiswear test: Test the skript"
  107. send "&7/antiswear notify [true|false]: Toggle Notifications"
  108. send "&8&m----------------------------- &7Page 1&8&m ---"
  109. exit
  110. if arg 2 is "2":
  111. send "&8&m------------- &7 AntiSwear &8&m------------------"
  112. send "&7/clearchat [reason]: Clear the chat"
  113. send "&7/togglechat: Toggle the chat"
  114. send "&7/addons: List addons"
  115. send "&7/prefix <player> [prefix]: Set a player's prefix"
  116. send "&7/suffix <player> [suffix]: Set a player's suffix"
  117. send "&8&m----------------------------- &7Page 2&8&m ---"
  118. exit
  119. if arg 2 is not "" or "1" or "2":
  120. send "&cPage %arg 2% does not exist!"
  121. if arg 1 is "add":
  122. wait 2 ticks
  123. if arg 2 is not set:
  124. send "%{antiswear::prefix}%&cMissing Arguments: /antiswear add <word>"
  125. exit
  126. if arg 2 is set:
  127. add "%arg 2%" to {antiswear::blockedwords::*}
  128. send "%{antiswear::prefix}%&aAdded&e %arg 2% to Blocked words!"
  129. exit
  130. if arg 1 is "remove":
  131. wait 2 ticks
  132. if arg 2 is not set:
  133. send "%{antiswear::prefix}%&cMissing Arguments: /antiswear remove <word>"
  134. exit
  135. if arg 2 is set:
  136. remove "%arg 2%" from {antiswear::blockedwords::*}
  137. send "%{antiswear::prefix}%&cRemoved&e %arg 2%&c from Blocked words"
  138. exit
  139. if arg 1 is "list":
  140. if {antiswear::blockedwords::*} is not set:
  141. set {antiswear::blockedwords::*} to "No words blocked!"
  142. wait 2 ticks
  143. send "%{antiswear::prefix}%&9Total Words:%nl%&r%{antiswear::blockedwords::*}%"
  144. wait a tick
  145. clear {antiswear::blockedwords::*}
  146. exit
  147. if arg 1 is "reload":
  148. send "%{antiswear::prefix}%&aReloading..."
  149. wait a ticks
  150. make console execute "skript reload %script name%"
  151. send "%{antiswear::prefix}%&aReloaded!"
  152. exit
  153. if arg 1 is "broadcast":
  154. if arg 2 is set:
  155. wait a ticks
  156. broadcast "%{antiswear::prefix}%%coloured arg 2%"
  157. exit
  158. if arg 1 is "test":
  159. wait 2 ticks
  160. send "&8&m-----------------------------"
  161. send "%{antiswear::prefix}%&a&lVersion: %{PLUGIN::version}% is working!"
  162. send "&8&m-----------------------------"
  163. exit
  164. if arg 1 is "addon":
  165. wait 2 ticks
  166. send "%{antiswear::prefix}%Please use /addon"
  167. exit
  168. if arg 1 is "notify":
  169. wait 2 ticks
  170. if arg 2 is not set:
  171. if {antiswear::notify.%executor%} is true:
  172. set {antiswear::notify.%executor%} to false
  173. send "%{antiswear::prefix}%&eNotifications &cDisabled"
  174. exit
  175. else:
  176. set {antiswear::notify.%executor%} to true
  177. send "%{antiswear::prefix}%&eNotifications &aEnabled"
  178. exit
  179. else:
  180. if arg 2 is set:
  181. if arg 2 is "true":
  182. set {antiswear::notify.%executor%} to true
  183. send "%{antiswear::prefix}%&eNotifications &aEnabled"
  184. exit
  185. else:
  186. if arg 2 is "false":
  187. set {antiswear::notify.%executor%} to false
  188. send "%{antiswear::prefix}%&eNotifications &cDisabled"
  189. exit
  190. else:
  191. send "%{antiswear::prefix}%&cInvaild Input:&e /antiswear notify [true|false]"
  192. exit
  193. if arg 1 is "version":
  194. send "%{antiswear::prefix}%&eCurrent Version:&a %{PLUGIN::version}%"
  195. exit
  196. else:
  197. send "%{antiswear::prefix}%&cYou do not have permission to use this command!"
  198. exit
  199. else if {PLUGIN::enabled} is "false":
  200. send "%{antiswear::prefix}%&cPlugin was Disabled by Administrator."
  201. exit
  202. on enable:
  203. set {MESSAGES::chat-disabled} to yaml value "messages.chat-disabled" from "plugins\AntiSwear\config.yml"
  204. set {MESSAGES::staffchat-prefix} to yaml value "messages.staffchat-prefix" from "plugins\AntiSwear\config.yml"
  205. set {MESSAGES::no-advert} to yaml value "messages.deny-advertising" from "plugins\AntiSwear\config.yml"
  206. set {MESSAGES::no-cussing} to yaml value "messages.deny-cussing" from "plugins\AntiSwear\config.yml"
  207. set {MESSAGES::censor} to yaml value "messages.censor" from "plugins\AntiSwear\config.yml"
  208. set {antiswear::prefix} to yaml value "messages.prefix" from "plugins\AntiSwear\config.yml"
  209. set {PLUGIN::enabled} to yaml value "plugin.enabled" from "plugins\AntiSwear\config.yml"
  210. set {PLUGIN::version} to yaml value "plugin.version" from "plugins\AntiSwear\config.yml"
  211. remove yaml list "blocked.blocked-words" from file "plugins\AntiSwear\config.yml" from {antiswear::blockedwords::*}
  212. remove yaml list "blocked.blocked-domains" from file "plugins\AntiSwear\config.yml" from {antiswear::blockedwords::*}
  213. add yaml list "blocked.blocked-words" from "plugins\AntiSwear\config.yml" to {antiswear::blockedwords::*}
  214. add yaml list "blocked.blocked-domains" from "plugins\AntiSwear\config.yml" to {antiswear::blockedwords::*}
  215. send "%{antiswear::prefix}%Loaded" to console
  216. on disable:
  217. send "%{antiswear::prefix}%Unloaded" to console
  218. clear {antiswear::addons::*}
  219. clear {MESSAGES::*}
  220. clear {PLUGIN::*}
  221. clear {prefix}
  222. remove yaml list "blocked.blocked-words" from file "plugins\AntiSwear\config.yml" from {antiswear::blockedwords::*}
  223. every 1 second:
  224. remove yaml list "blocked.blocked-words" from file "plugins\AntiSwear\config.yml" from {antiswear::blockedwords::*}
  225. add yaml list "blocked.blocked-words" from "plugins\AntiSwear\config.yml" to {antiswear::blockedwords::*}
  226. command /antiswear:clearchat [<text>]:
  227. description: Clear the chat
  228. aliases: /cc, /chatclear, /chat-clear, /clear-chat, /clearchat
  229. permission: antiswear.clearchat
  230. permission message: &cInsufficent Permission.
  231. trigger:
  232. if arg 1 is set:
  233. loop 25 times:
  234. broadcast "%nl%&m------------------------"
  235. broadcast "%nl%"
  236. broadcast "%nl%"
  237. broadcast "%nl%"
  238. broadcast "%nl%"
  239. broadcast "%nl%"
  240. broadcast "%nl%"
  241. broadcast "%nl%"
  242. broadcast "&8&m&l------------------------------------------"
  243. broadcast "&7&lChat was cleared by %executor%! Reason: %arg 1%"
  244. broadcast "&8&m&l------------------------------------------"
  245. stop trigger
  246. else:
  247. loop 25 times:
  248. broadcast "%nl%&m------------------------"
  249. broadcast "%nl%"
  250. broadcast "%nl%"
  251. broadcast "%nl%"
  252. broadcast "%nl%"
  253. broadcast "%nl%"
  254. broadcast "%nl%"
  255. broadcast "%nl%"
  256. broadcast "&8&m&l------------------------------------------"
  257. broadcast "&7&lChat was cleared by %executor%!"
  258. broadcast "&8&m&l------------------------------------------"
  259. stop trigger
  260. command /antiswear:togglechat:
  261. description: Mute or Unmute chat
  262. aliases: /mutechat, /mchat, /stopchat, /chatstop, /mch, /antiswear:mutechat, /togglechat
  263. permission: antiswear.togglechat
  264. permission message: &cInsufficent Permission.
  265. trigger:
  266. if {antiswear::chatdisabled} is false:
  267. set {antiswear::chatdisabled} to true
  268. send "%{antiswear::prefix}%&cChat has been disabled!"
  269. stop trigger
  270. else:
  271. set {antiswear::chatdisabled} to false
  272. send "%{antiswear::prefix}%&aChat has been enabled!"
  273. stop trigger
  274. command /antiswear:addons:
  275. description: Main Addons Command
  276. aliases: /addons, /addon
  277. permission: antiswear.addon
  278. permission message: &cInsufficent Permission.
  279. trigger:
  280. send "%{antiswear::prefix}%§cThis feature has been temporarialy disabled by the Developer!"
  281. # Prefixes && Suffixes
  282. command /prefix [<text>] [<text>]:
  283. description: Set a player's prefix
  284. permission: antiswear.prefix
  285. permission message: &cInsufficent Permission.
  286. trigger:
  287. if arg 1 is not set:
  288. send "&cUsage: /prefix <player> [prefix]"
  289. stop
  290. if arg 2 is not set:
  291. clear {prefix.%arg 1%}
  292. send "Cleared %arg 1%'s prefix"
  293. stop
  294. else:
  295. loop all players:
  296. if loop-player is arg 1:
  297. set {prefix.%arg 1%} to coloured arg 2
  298. send "§aChanged %arg 1%'s prefix to §6""&r%arg 2%§6""§r"
  299. if {prefix.%player%} is not set:
  300. set {prefix.%player%} to ""
  301. if {suffix.%player%} is not set:
  302. set {suffix.%player%} to ""
  303. set loop-player's display name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  304. set loop-player's tablist name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  305. if {prefix.%player%} is "":
  306. clear {prefix.%player%}
  307. if {suffix.%player%} is "":
  308. clear {suffix.%player%}
  309. stop
  310. command /suffix [<text>] [<text>]:
  311. description: Set a player's suffix
  312. permission: antiswear.suffix
  313. permission message: &cInsufficent Permission.
  314. trigger:
  315. if arg 1 is not set:
  316. send "&cUsage: /suffix <player> [suffix]"
  317. stop
  318. if arg 2 is not set:
  319. clear {suffix.%arg 1%}
  320. send "Cleared %arg 1%'s suffix"
  321. stop
  322. else if arg 2 is set:
  323. loop all players:
  324. if loop-player is arg 1:
  325. set {suffix.%arg 1%} to coloured arg 2
  326. send "§aChanged %arg 1%'s suffix to §6""%arg 2%§6""§r"
  327. if {prefix.%player%} is not set:
  328. set {prefix.%player%} to ""
  329. if {suffix.%player%} is not set:
  330. set {suffix.%player%} to ""
  331. set loop-player's display name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  332. set loop-player's tablist name to "%{prefix.%player%}%%player%%{suffix.%player%}%"
  333. if {prefix.%player%} is "":
  334. clear {prefix.%player%}
  335. if {suffix.%player%} is "":
  336. clear {suffix.%player%}
  337. stop
  338. # Chat Modes
  339. command /staffchat [<text>]:
  340. description: Talk in staffchat
  341. aliases: /s, /sc
  342. trigger:
  343. player has permission "antiswear.staffchat"
  344. loop all players:
  345. loop-player has permission "antiswear.staffchat"
  346. send "%{MESSAGES::staffchat-prefix}% &4%sender% &e> &c%arg 1%" to loop-player
  347. command /chatmode [<text>] [<player>]:
  348. description: Change ChatMode!
  349. aliases: /cm
  350. trigger:
  351. player has permission "antiswear.chatmode"
  352. if arg 1 is not set:
  353. if arg 1 is "staffchat" or "staffmode" or "staff" or "sc":
  354. set {chatmode.%sender%} to "staffchat"
  355. if arg 1 is "off" or "default" or "disable":
  356. clear {chatmode.%sender%}
  357. else if arg 1 is set:
  358. if arg 1 is "staffchat" or "staffmode" or "staff" or "sc":
  359. set {chatmode.%player arg%} to "staffchat"
  360. if arg 1 is "off" or "default" or "disable":
  361. clear {chatmode.%sender%}
  362. command /debug:
  363. permission: antiswear.debug
  364. permission message: &cInsufficent Permission
  365. trigger:
  366. send "&cNo function set." to sender
  367. # end
Advertisement
Add Comment
Please, Sign In to add comment