Modify.sk

Created by Nova

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

command /modify [<text>] [<text>] [<text>]:
	usage: /modify <modifier> <state/setting> [<value>]
	permission: modify.admin
	permission message: &cYou don't have permission to execute this command!
	aliases: /m
	trigger:
		if arg 1 is not set:
			send "&aCorrect Usage &7>> &f/modify &e<modifier> <state/setting> [<value>]"
			
		else if arg 1 is "list":
			send "&aAll Modifier Groups &7>> &ewhitelistchat&7/&ewc&7, &eclearchat&7/&ecc&7, &ebroadcast&7/&ebc&7, &esetname&7, &ekick&7, &eban&7, &eunban"

		else if arg 1 is "wc" or "whitelistchat":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify wc &e<enable|disable|add|remove|list|clear>"
			else if arg 2 is "enable":
				set {chat.whitelist} to true
				send "&aSuccessful &7>> &fModifier &ewhitelistchat &fis now &aenabled&f. Please use &e/modify wc &e<add|remove> <player> &fto whitelist players."
			else if arg 2 is "disable":
				delete {chat.whitelist}
				send "&aSuccessful &7>> &fModifier &ewhitelistchat &fis now &cdisabled&f."
			else if arg 2 is "add":
				if {chat.whitelist} != true:
					send "&cUnsuccessful &7>> &fPlease use &e/modify wc enable &fto enable &echat.whitelist&f!"
				else if arg 3 is not set:
					send "&aCorrect Usage &7>> &f/modify wc add &e<player>"
				else if arg 3 parsed as offline player is not online:
					send "&cUnsuccessful &7>> &fThat player is not online!"
				else if arg 3 parsed as offline player is online:
					if {chat.whitelist::*} contains arg 3 parsed as offline player:
						send "&cUnsuccessful &7>> &fThat player is already whitelisted!"
						stop
					add arg 3 parsed as offline player to {chat.whitelist::*}
					send "&aSuccessful &7>> &e%arg 3% &fhas been added to the whitelist."
			else if arg 2 is "remove":
				if {chat.whitelist} != true:
					send "&cUnsuccessful &7>> &fThere are no players to remove from the whitelist as it is currently &cdisabled&f!"
				else if arg 3 is not set:
					send "&aCorrect Usage &7>> /modify wc remove &e<player>"
				else if {chat.whitelist::*} doesn't contain arg 3 parsed as offline player:
					send "&cUnsuccessful &7>> &fThat player is not whitelisted!"
				else if {chat.whitelist::*} contains arg 3 parsed as offline player:
					remove arg 3 parsed as offline player from {chat.whitelist::*}
					send "&aSuccessful &7>> &e%arg 3% &fhas been removed from the whitelist."
			else if arg 2 is "list":
				if size of {chat.whitelist::*} < 1:
					send "&aSuccessful &7>> &fThere no players whitelisted currently!"
					stop
				send "&aAll Whitelisted Players &7>> &f%{chat.whitelist::*}%"
			else if arg 2 is "clear":
				if size of {chat.whitelist::*} < 1:
					send "&cUnsuccessful &7>> &fThere are no players whitelisted!"
					stop
				if arg 3 is not "confirm":
					send "&cUnsuccessful &7>> &fUse &e/modify wc clear confirm &fto clear the whitelist!"
					stop
				delete {chat.whitelist::*}
				send "&aSuccessful &7>> &fCleared all players from the whitelist."
			else:
				send "&aCorrect Usage &7>> &f/modify wc &e<enable|disable|add|remove|list>"

		else if arg 1 is "clearchat" or "cc":
			loop 500 times:
				broadcast ""
			send "&aSuccessful &7>> &fChat has been cleared."

		else if arg 1 is "broadcast" or "bc":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify bc &e<public(Current World)|global(All Worlds)> <text> [-p:<permission.node>]"
				send "&aAll Placeholders &7>> &e{$name}&7, &e{$health)&7, &e{$displayname}&7, &e{$hunger}&7, &e{$world}&7, &e{$ip}&7, &e{$uuid}"
				stop
			else if arg 2 is "public":
				if arg 3 contains "-p:":
					set {_bc::*} to arg 3 parsed as "%string% -p:%string%"
					if {_bc::2} is set:
						if {_bc::2} doesn't contain " ":
							loop all players in player's world:
								loop-player has permission "%{_bc::2}%"
								replace all "{$name}" in {_bc::1} with "%loop-player%"
								replace all "{$displayname}" in {_bc::1} with loop-player's display name
								replace all "{$health}" in {_bc::1} with "%loop-player's health * 2%"
								replace all "{$hunger}" in {_bc::1} with "%loop-player's hunger * 2%"
								replace all "{$world}" in {_bc::1} with "%loop-player's world%"
								replace all "{$ip}" in {_bc::1} with loop-player's ip
								replace all "{$uuid}" in {_bc::1} with loop-player's uuid
								send colored {_bc::1} to loop-player
								stop
				set {_bc} to arg 3
				loop all players in player's world:
					replace all "{$name}" in {_bc} with "%loop-player%"
					replace all "{$displayname}" in {_bc} with loop-player's display name
					replace all "{$health}" in {_bc} with "%loop-player's health * 2%"
					replace all "{$hunger}" in {_bc} with "%loop-player's hunger * 2%"
					replace all "{$world}" in {_bc} with "%loop-player's world%"
					replace all "{$ip}" in {_bc} with loop-player's ip
					replace all "{$uuid}" in {_bc} with loop-player's uuid
					send colored {_bc} to loop-player
			else if arg 2 is "global":
				if arg 3 contains "-p:":
					set {_bc::*} to arg 3 parsed as "%string% -p:%string%"
					if {_bc::2} is set:
						if {_bc::2} doesn't contain " ":
							loop all players in player's world:
								loop-player has permission "%{_bc::2}%"
								replace all "{$name}" in {_bc::1} with "%loop-player%"
								replace all "{$displayname}" in {_bc::1} with loop-player's display name
								replace all "{$health}" in {_bc::1} with "%loop-player's health * 2%"
								replace all "{$hunger}" in {_bc::1} with "%loop-player's hunger * 2%"
								replace all "{$world}" in {_bc::1} with "%loop-player's world%"
								replace all "{$ip}" in {_bc::1} with loop-player's ip
								replace all "{$uuid}" in {_bc::1} with loop-player's uuid
								send colored {_bc::1} to loop-player
								stop
				set {_bc} to arg 3
				loop all players:
					replace all "{$name}" in {_bc} with "%loop-player%"
					replace all "{$displayname}" in {_bc} with loop-player's display name
					replace all "{$health}" in {_bc} with "%loop-player's health * 2%"
					replace all "{$hunger}" in {_bc} with "%loop-player's hunger * 2%"
					replace all "{$world}" in {_bc} with "%loop-player's world%"
					replace all "{$ip}" in {_bc} with loop-player's ip
					replace all "{$uuid}" in {_bc} with loop-player's uuid
					send colored {_bc} to loop-player

		else if arg 1 is "motd":
			send "&7This feature is not yet implemented into this skript! Either create a new motd, or wait for version 1.0!"
			stop
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify server.motd &e<line-number> <text>"
			else if arg 2 is "1":
				if arg 3 is not set:
					send "&aCorrect Usage &7>> &f/modify server.motd 1 &e<text>"
					stop
				set {motd.1} to arg 3
				send "&aSuccessful &7>> &fThe server motd &7(line-1) &fhas been set to"
				send {motd.1}
			else if arg 2 is "2":
				if arg 3 is not set:
					send "&aCorrect Usage &7>> &f/modify server.motd 2 &e<text>"
					stop
				set {motd.2} to arg 3
				send "&aSucessful &7>> &fThe server motd &7(line-2) &fhas been set to"
				send {motd.2}
			else:
				send "&aCorrect Usage &7>> &f/modify server.motd &e<line-number> <text>"

		else if arg 1 is "setname":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify setname &e<player> <name>"
				stop
			if arg 2 parsed as offline player is not online:
				send "&cUnsuccessful &7>> &fThat player is not online."
				stop
			if arg 3 is not set:
				send "&aCorrect Usage &7>> &f/modify setname %arg-2% &e<name>"
				stop
			if length of arg 3 > 16:
				send "&cUnsuccessful &7>> &fThe length of nickname must be under 16 characters."
				stop
			set arg-2 parsed as player's display name to arg 3

		else if arg 1 is "player.kick":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify kick &e<player> [reason]"
				stop
			if arg 2 parsed as offline player is not online:
				send "&cUnsuccessful &7>> &fThat player is not online."
				stop
			if arg 3 is not set:
				kick arg-2 parsed as player due to "&cYou have been kicked from the server!"
				send "&aSuccessful &7>> &f%arg-2% has been kicked."
			else:
				if arg 3 is not "-s":
					set {_r::*} to arg 3 parsed as "%string% -s"
					if {_r::*} is set:
						kick arg-2 parsed as player due to "&fYou have been &b&lKicked &ffrom the server!%nl%%colored {_r::1}%"
						send "&aSuccessful &7>> &fKicked player due to &7%colored {_r::1}%&f."
						stop
					kick arg-2 parsed as player due to "&fYou have been &b&lKicked &ffrom the server!%nl%&7%colored arg-3%"
					broadcast "&f%arg-2% has been &b&lKicked &fdue to &7%colored arg-3%&f."
					send "&aSuccessful &7>> Kicked player due to %colored arg-3%&f."
				else:
					kick arg-2 parsed as player due to "&fYou have been &f&lKicked &ffrom the server."
					send "&aSuccessful &7>> &fKicked player."

		else if arg 1 is "ban":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify ban &e<player> [reason]"
				stop
			if arg 2 parsed as offline player is not online:
				send "&cUnsuccessful &7>> &fThat player is not online."
				stop
			if arg 3 is not set:
				kick arg-2 parsed as player due to "&4You have been banned from the server!"
				ban arg-2 parsed as offline player
				send "&aSuccessful &7>> &fBanned player!"
			else:
				if arg 3 is not "-s":
					set {_r::*} to arg 3 parsed as "%string% -s"
					if {_r::*} is set:
						kick arg-2 parsed as player due to "&fYou have been &c&lBanned &ffrom the server!%nl%%colored {_r::1}%"
						ban arg-2 parsed as offline player
						send "&aSuccessful &7>> &fBanned player due to &7%colored {_r::1}%&f."
						stop
					kick arg-2 parsed as player due to "&fYou have been &c&lBanned &ffrom the server!%nl%&7%colored arg-3%"
					ban arg-2 parsed as offline player
					broadcast "&f%arg-2% has been &c&lBanned &fdue to &7%colored arg-3%&f."
					send "&aSuccessful &7>> Banned player due to %colored arg-3%&f."
				else:
					kick arg-2 parsed as player due to "&fYou have been &c&lBanned &ffrom the server!%nl%&7%arg-3%"
					ban arg-2 parsed as offline player
					send "&aSuccessful &7>> &fBanned player due to &7%colored arg-3%&f!"
					
			
		else if arg 1 is "player.unban":
			if arg 2 is not set:
				send "&aCorrect Usage &7>> &f/modify unban &e<player>"
				stop
			if arg 2 parsed as offline player is not banned:
				send "&cUnsuccessful &7>> &fThat player is not banned!"
				stop
			else:
				unban arg-2 parsed as offline player
				send "&aSuccessful &7>> &f%arg-2% has been unbanned!"
				if arg 3 is not "-s":
					broadcast "&a%arg-2% &fhas been &6&lUnbanned&f!"

		else:
			send "&cUnsuccessful &7>> &fThat is not a valid modifier. Please use &e/modify list &fto view all modifiers!"

on chat:
	if {chat.whitelist} is true:
		if {chat.whitelist::*} contains player:
			stop
		cancel event