#AxPlugManSk - Skrypt na zarządzanie pluginami i skryptami #$ Wersja: 1.5 $# #AxAutoUpdate section (https://skript.pl/temat/40795-axautoupdate) on load: set {AxUpdate::AxPlugManSk::link} to "https://code.skript.pl/qDWUJNJn/raw" set {AxUpdate::AxPlugManSk::status} to true set {AxUpdate::AxPlugManSk::name} to "AxPlugManSk" set {AxUpdate::AxPlugManSk} to script #importy import: org.bukkit.Bukkit ch.njol.skript.Skript #wyrazenia / efekty / warunki plural expression [AxPlugMan] [all] (1¦plugins|2¦skript addons): return type: strings loop of: plugin get: if parse mark is 1: loop ...Bukkit.getPluginManager().getPlugins(): add loop-value.getName() to {_return::*} return {_return::*} else: loop ...Skript.getAddons(): add loop-value.getName() to {_return::*} return {_return::*} expression [AxPlugMan] plugin %string% is skript addon: get: if skript addons contain expr-1: return true return false plural expression [AxPlugMan] plugin %string% authors: return type: strings get: return ...Bukkit.getPluginManager().getPlugin(expr-1).getDescription().getAuthors() expression [AxPlugMan] plugin %string% (1¦version|2¦description|3¦fullname|4¦status): get: return Bukkit.getPluginManager().getPlugin(expr-1).getDescription().getVersion() if parse mark is 1 return Bukkit.getPluginManager().getPlugin(expr-1).getDescription().getDescription() if parse mark is 2 return Bukkit.getPluginManager().getPlugin(expr-1).getDescription().getFullName() if parse mark is 3 return Bukkit.getPluginManager().getPlugin(expr-1).isEnabled() effect [AxPlugMan] (1¦disable|2¦enable|3¦reload) plugin %string%: trigger: expr-1 is not "skript" or "skript-reflect" Bukkit.getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin(expr-1)) if parse mark is 1 Bukkit.getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(expr-1)) if parse mark is 2 if parse mark is 3: Bukkit.getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin(expr-1)) Bukkit.getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(expr-1)) #funkcje function AxPlugMan_getInfo(plugin: string) :: strings: set {_authors::*} to ...Bukkit.getPluginManager().getPlugin({_plugin}).getDescription().getAuthors() add " &7Authors: &6%join plugin {_plugin} authors with ", " ? "&cIs not set!"%" to {_return::*} add " &7Version: &6%plugin {_plugin} version ? "&cIs not set!"%" to {_return::*} add " &7Description: &6%plugin {_plugin} description ? "&cIs not set!"%" to {_return::*} add " &7FullName: &6%plugin {_plugin} fullname ? "&cIs not set!"%" to {_return::*} add " &7Is Skript addon: &6%plugin {_plugin} is skript addon%" to {_return::*} add "&8 -----------------------" to {_return::*} if {_plugin} is not "skript-reflect" or "skript": add " &7Click &fLPM&7 to &cDisable&7/&aEnable|| &7Click &fPPM&7 to &eReload" to {_return::*} else: add " &7Cannot be turned &coff" to {_return::*} return {_return::*} function AxPlugMan_CreateGui(n: number) :: inventory: if {_n} is 1: set {AxPlugMan::gui::1} to "&6Plugins and Scripts Manager" set {_gui} to chest inventory named {AxPlugMan::gui::1} with 1 row set slot (integers between 0 and 8) of {_gui} to gray glass pane named " " set slot 3 of {_gui} to redstone block named "&6Plugins (%size of all plugins%)" set slot 5 of {_gui} to redstone named "&6Scripts (%size of scripts%)" if {_n} is 2: set {AxPlugMan::gui::2} to "&6Plugins Manager (%size of (AxPlugMan all plugins)%)" set {_gui} to chest inventory named {AxPlugMan::gui::2} with (rounded up (size of plugins)/9) row set {_slot} to 0 loop plugins: if plugin loop-plugin status is true: set slot {_slot} of {_gui} to light green wool named "&a%loop-plugin%" with lore AxPlugMan_getInfo(loop-plugin) else: set slot {_slot} of {_gui} to red wool named "&a%loop-plugin%" with lore AxPlugMan_getInfo(loop-plugin) add 1 to {_slot} if {_n} is 3: set {AxPlugMan::gui::3} to "&6Scripts Manager (%size of all scripts%)" set {_gui} to chest inventory named {AxPlugMan::gui::3} with (rounded up (size of all scripts)/9) row set {_slot} to 0 loop all enabled scripts: set slot {_slot} of {_gui} to light green wool named "&a%loop-value%" with lore " &7Click &fLPM &7to &cdisable&7/&aEnable" and " &7Click &fPPM &7to &eReload" add 1 to {_slot} loop all disabled scripts: set slot {_slot} of {_gui} to red wool named "&c%loop-value%" with lore " &7Click &fLPM &7to &cdisable&7/&aEnable" and " &7Click &fPPM &7to &eReload" add 1 to {_slot} return {_gui} #komenda command /AxPlugSkMan [] []: permission: PlugMan permission message: &4Error! &7You don't have permission! aliases: xAxee:plugman, plugman, plugskman, pluginmanager, pluginskriptmanager trigger: if arg 1 is not set: open AxPlugMan_CreateGui(1) to player stop if arg 1 is "list" or "lista": send (" &fPlugins (%size of all plugins%): &a%(join all plugins with ", ")%") send (" &fScripts (%size of all scripts%): &a%join all scripts with ", "%") stop if arg 2 is not set: send " &4Error! &7Correct usage: &f/plugman &6*&f<&8list&f/&aon&f/&coff&f/&eReload&f/&bchange&f> " stop if executor doesn't have permission "PlugMan.plugins" or "PlugMan.*": send " &4Error! &7You don't have permission!" if all plugins doesn't contain arg 2: send " &4Error! &7This plugin doesn't exist!" stop if arg 1 is "disable" or "wylacz" or "off": disable plugin arg 2 send " &cDisable plugin: &2%arg 2%" to player if plugins contain arg 2 if arg 1 is "enable" or "wlacz" or "on": enable plugin arg 2 send " &aEnable plugin: &2%arg 2%" to player if plugins contain arg 2 if arg 1 is "reload" or "przeladuj" or "Rl": reload plugin arg 2 send " &6Reload plugin: &2%arg 2%" to player if plugins contain arg 2 if arg 1 is "change" or "zmien": if plugin arg 2 status is true: execute player command "plugman disable %arg 2%" else: execute player command "plugman enable %arg 2%" #event on inventory click: if name of event-inventory is not {AxPlugMan::gui::1} or {AxPlugMan::gui::2} or {AxPlugMan::gui::3}: stop cancel event if name of event-inventory is {AxPlugMan::gui::1}: if clicked slot is 3: open AxPlugMan_CreateGui(2) to player if clicked slot is 5: open AxPlugMan_CreateGui(3) to player if name of event-inventory is {AxPlugMan::gui::2}: stop if player does not have permission "Plugman.plugins" stop if clicked slot is not between 0 and (size of plugins)-1 set {_plg} to uncolored name of clicked slot if click action is left mouse button: if plugin {_plg} status is true: disable plugin {_plg} else: enable plugin {_plg} open AxPlugMan_CreateGui(2) to player if click action is right mouse button: reload plugin {_plg} if name of event-inventory is {AxPlugMan::gui::3}: stop if player does not have permission "Plugman.scripts" stop if clicked slot is not between 0 and (size of scripts)-1 set {_sk} to uncolored name of clicked slot if click action is left mouse button: if script {_sk} is loaded: disable script {_sk} else: enable script {_sk} open AxPlugMan_CreateGui(3) to player if click action is right mouse button: reload script {_sk}