AntiAdvertisement.sk

Created by Unknown

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.

options:
	AmountOfMaxWarns: 3 #This is the amount of warns a player can get before being punished.#
	AdminCmdPerm: antiadv.admin #This is the permission for all admin commands/args.#
	BypassPerm: antiadv.bypass #This is the permission to bypass the advertisement check. (VERY IMPORTANT!)#
	CancelMessage: true #This cancels the message if someone is advertising.#
	DontAdvertiseHereMsg: &fPlease do not advertise here. All online staff have been notified. #This is the message sent to the player if they are caught advertising.#
	MainCmdAliases: antiad #This is the alias to the main Skript command.#
	MainCmd: antiadv #This is the actual main command.#
	MaxWarnsCommand1: /say %player% reached 3 warnings!  Edit this in the %script%.sk! #This is the first commandd that will run if a player reaches their max warnings.#
	MaxWarnsCommand2: /say %player% reached 3 warnings! x2  Edit this in the %script%.sk! #This is the second commandd that will run if a player reaches their max warnings.#
	Prefix: &8[&4&lANTI-AD&8] #This is the Skript prefix. Change as you like!#
	NoPermissionMessage: &7No permission!
	StaffWarnMsg: &7&o%player%&f could be advertising! Message: &c%message% #This is the message that is sent to staff if a player is advertising in chat.#
	DomainsToCheckFor: ".com" or ".net" or ".co" or ".us" or ".uk" or ".ws" or ".tk" or ".org" or ".to" or "dot." or "dot," or "(dot)" or ".pw" or ".it" or ".tech" or ".edu" or "DOT" or " , " or ".de" or ".tl" or ".nl" or ".be" or ".me" or ".info" or ".ly" or ".onion" or ".bit" or ".pl" or ".gl" or ".tv" or ".gs" or ".myserver" or ".club" or ".space" or ".design" or ".rent" or ".bid" or ".trade" or ".webcam" or ".press" or ".io" or ".ca" or ".college" or ".host" or ".es" or ".yoga" or ".financial" or ".flights" or ".guitars" or ".xyz" or ".dj" or ".is" or ".hub" or ".server" or ".webcam" or ".ninja" or ".financial" or ".ca" or ".eu" or ".esy" or ".google"

#---------------------------#
#          NOTICE!          #
#     ^^^^        ^^^^      #
# IF YOU DO NOT KNOW WHAT   #
# YOU ARE DOING THEN DO NOT #
# EDIT THE SKRIPT BEYOND    #
#        THIS POINT!        #
#---------------------------#

on chat:
	if player doesn't have permission "antiadv.bypass":
		if message contains {@DomainsToCheckFor}:
			loop all players:
				if loop-player has permission "antiadv.notify":
					send "{@Prefix} {@StaffWarnMsg}" to loop-player
				if {@CancelMessage} is true:
					cancel the event
			send "{@Prefix} {@DontAdvertiseHereMsg}" to player
			add 1 to {antiadv.advs.%uuid of player%}
			if {antiadv.advs.%uuid of player%} = {@AmountOfMaxWarns}:
				if player does not have permission "{@BypassPerm}":
					execute console command "{@MaxWarnsCommand1}"
					execute console command "{@MaxWarnsCommand2}"
on join:
	set {Playersuuid::%player's uuid%} to "%player's uuid%" parsed as offline player
command /{@MainCmd} [<text>] [<offlineplayer>] [<text>]:
	aliases: /{@MainCmdAliases}
	permission: {@AdminCmdPerm}
	permission message: {@Prefix} {@NoPermissionMessage}
	trigger:
		if arg 1 is not set:
			send "&8&m--------------------------"
			send "            &4&lANTI-AD &f%{version}%"
			send "             &4Commands:"
			send "&f"
			send "&f/antiad reset - &7Resets a player's warnings."
			send "&f/antiad resetall - &7Resets the whole servers warnings."
			send "&f/antiad set - &7Sets a player's warnings."
			send "&f/antiad reload - &7Reload the script."
			send "&f/antiad search [player] - &7Search a player's warn information."
			send "&f/antiad upcoming - &7View upcoming script features!"
			send "&cMore commands Coming Soon!"
			send "&7"
			send "&8&m--------------------------"
			stop
		else if arg 1 is "search" or "player" or "username" or "lookup" or "check":
			if arg 2 is set:
				send "&8&m--------------------------"
				send "                    &4Information:"
				send "&7"
				send "&fUsername: &7&o%arg 2%"
				set {_a} to "%{antiadv.advs.%arg 2%}%"
				if {_a} contains "<none>":
					set {_a} to 0
				send "&fWarnings: &7&o%{_a}%"
				set {uuid} to arg 2's uuid
				send "&fPlayer's UUID: &7&o%{uuid}%"
				if arg 2 has played before:
					if arg 2 is online:
						send "&fStatus: &aOnline"
					else:
						send "&fStatus: &cOffline"
				else:
					send "&7%arg 2% &fhas never joined!"
				send "&7"
				send "&8&m--------------------------"
			else:
				send "{@Prefix} &7Please enter a player to grab data from."
		else if arg 1 is "upcoming":
			send "&8&m--------------------------"
			send "        &4Upcoming features:"
			send "&f"
			send "&8- &fAdding back the kick on max warn reach"
			send "&8- &fAdd json capabilities"
			send "&8- &fAdd AntiAsk hooks"
			send "&8- &fAdd titles"
			send "&8- &fAdd actionbars"
			send "&fAnything you all suggest!"
			send "&f"
			send "&8&m--------------------------"
		else if arg 1 is "reset":
			if arg 2 is set:
				set {antiadv.advs.%arg 2%} to 0
				send "{@Prefix} &7&o%arg 2%'s &fadvertisement warnings and kicks have been reset."
			else:
				send "{@Prefix} &7Please specify a player."
		else if arg 1 is "resetall":
			send "{@Prefix} &fAre you sure?  If so add 'confirm' after the command you just typed."
			set {antiadresetall::%uuid of player%} to true
			if arg 2 is "confirm":
				if {antiadresetall::%uuid of player%} is set:
					set {antiadv.advs.%all players%} to 0
					send "{@Prefix} &fAdvertisement warnings and kicks have been reset for all players."
				else:
					send "{@Prefix} &7If you want to clear all data for players, run /antiad resetall."
		else if arg 1 is "set":
			if arg 2 is set:
				if arg 3 is set:
					set {antiadv.advs.%arg 2%} to arg 3
					send "{@Prefix} &7&o%arg 2%'s &fadvertisement warnings have been set to &7&o%arg 3%&f."
				else:
					send "{@Prefix} &7Please specify an amount of warnings to set the player's warn count to."
			else:
				send "{@Prefix} &7Please enter a valid player."
		else if arg 1 is "reload":
			send "{@Prefix} &7Reloading the script..."
			wait 1 ticks
			execute console command "sk reload %script%"
			send "{@Prefix} &7Successfully reloaded."
		else:
			send "{@Prefix} &7Please enter a valid argument."
on skript load:
	set {version} to "4.2"
	message "&8[&4ANTI-AD&8] &7Successfully loaded &cAnti Advertisement V1 &8v&a%{version}%&7." to console
	set {antiadv1::running} to true
	if {antiask::running} is set:
		wait 1 second
		message "&7[&cANTIASK&7] &eThank You for downloading and using &6Anti Advertisement V1&e!" to console
	if {antiask::running} is not set:
		message "&7[&cANTIASK&7] &eWe couldn't find &6Anti Ask&e!  Be sure to download it now!" to console
	if {antiadv2::running} is set:
		wait 1 second
		message "&8[&4ANTI-AD&8] &7You seem to be running &fAnti Advertisement V1 &7and &cAnti Advertisement V2&7!  V1 has been disabled.  Please choose to only run one at a time." to console
		execute console command "sk disable %script%"
on skript unload:
	delete {antiadv1::running}
	message "&8[&4ANTI-AD&8] &7Successfully unloaded &fAnti Advertisement V1 &8v&a%{version}%&7.  Goodbye!" to console