#=======================================# # _ # # /\ | | _ # # / \ _ __ _ __ | |_ _ _| |_ # # / /\ \ | '_ \| '_ \| | | | |_ _| # # / ____ \| |_) | |_) | | |_| | |_| # # /_/ \_\ .__/| .__/|_|\__, | # # | | | | __/ | # # |_| |_| |___/ # # # #=======================================# #------------- By Efnilite -------------# # All options, messages, etc. are available in the 'plugins/Apply+' folder # Requirements: skript-yaml 1.2.4, skript-mirror 1.0.0, mundosk 1.8.6 import: java.util.Arrays java.lang.System java.nio.file.Paths java.nio.file.Files local effect create dir[ector(y|ies)] %string%: trigger: Files.createDirectories(Paths.get(expression-1)) local expression formatted yaml time of yaml value %string% from %string%: get: set {_e} to yaml value "%expression-1%" from expression-2 set {_e::*} to {_e} parsed as "%integer%/%integer%/%integer% %integer%:%integer%:%integer%" set {_ec} to date({_e::3}, {_e::2}, {_e::1}, {_e::4}, {_e::5}, {_e::6} + 1) return {_ec} local expression %item% with lore %text%: get: set {_i} to expression-1.clone() set {_meta} to {_i}.getItemMeta() {_meta}.setLore(Arrays.asList(split expression-2 at "||")) {_i}.setItemMeta({_meta}) return {_i} local expression nl: get: return System.lineSeparator() local effect make %player% apply: trigger: set {_p} to expression-1 set {_uuid} to expression-1's uuid set {_z} to yaml value "time-between" from "config" parsed as timespan if yaml value "user.last-apply" from "%{_uuid}%" is "N/A": if yaml value "disable-movement-on-apply" from "config" is true: spawn armor stand at {_p} (last spawned entity).setVisible(false) (last spawned entity).setGravity(false) make {_p} ride last spawned entity send colored yaml value "introduction" from "questions" to {_p} send "%first element of yaml list ""questions"" from ""questions""%" to {_p} set yaml value "user.applying" from "%{_uuid}%" to true set yaml value "user.can-apply" from "%{_uuid}%" to false set yaml value "user.at" from "%{_uuid}%" to 2 add {_uuid} to yaml list "applications" from "applications" save yaml "applications" save yaml "%{_uuid}%" stop set {_c} to formatted yaml time of yaml value "user.last-apply" from "%{_uuid}%" if difference between {_c} and now >= {_z}: if yaml value "disable-movement-on-apply" from "config" is true: spawn armor stand at {_p} (last spawned entity).setVisible(false) (last spawned entity).setGravity(false) make {_p} ride last spawned entity send colored yaml value "introduction" from "questions" to {_p} send "%first element of yaml list ""questions"" from ""questions""%" to {_p} set yaml value "user.applying" from "%{_uuid}%" to true set yaml value "user.can-apply" from "%{_uuid}%" to false set yaml value "user.at" from "%{_uuid}%" to 2 add {_uuid} to yaml list "applications" from "applications" set {_now} to yaml value "user.last-apply" from "%{_uuid}%" save yaml "applications" save yaml "%{_uuid}%" else: if {_p} has permission yaml value "permissions.bypass" from "config": if yaml value "disable-movement-on-apply" from "config" is true: spawn armor stand at {_p} (last spawned entity).setVisible(false) (last spawned entity).setGravity(false) make {_p} ride last spawned entity send colored yaml value "introduction" from "questions" to {_p} send "%first element of yaml list ""questions"" from ""questions""%" to {_p} set yaml value "user.applying" from "%{_uuid}%" to true set yaml value "user.can-apply" from "%{_uuid}%" to false set yaml value "user.at" from "%{_uuid}%" to 2 add {_uuid} to yaml list "applications" from "applications" set {_now} to yaml value "user.last-apply" from "%{_uuid}%" save yaml "applications" save yaml "%{_uuid}%" else: set {_msg} to yaml value "messages.already-applied" from "messages" set {_diff} to difference between {_c} and (yaml value "time-between" from "config" parsed as timespan) ago replace all "