Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- clear {builder::*}
- if folder "plugins/Skript/scripts/Anemonex" doesn't exists:
- create folder "plugins/Skript/scripts/Anemonex"
- if folder "plugins/Skript/scripts/Anemonex/Builder" doesn't exists:
- create folder "plugins/Skript/scripts/Anemonex/Builder"
- if folder "plugins/Skript/scripts/Anemonex/Builder/buildings" doesn't exists:
- create folder "plugins/Skript/scripts/Anemonex/Builder/buildings"
- if folder "plugins/Skript/scripts/Anemonex/Builder/effects" doesn't exists:
- create folder "plugins/Skript/scripts/Anemonex/Builder/effects"
- command /builder [<text>] [<text>] [<int>] [<int>] [<int>] [<int>] [<int>] [<int>]:
- trigger:
- if sender is player:
- if sender has permission "builder":
- if arg-1 is "build":
- if arg-2 is set:
- set {_x} to x-coordinate of targeted block
- set {_y} to y-coordinate of targeted block
- set {_z} to z-coordinate of targeted block
- if arg-3 is set:
- if arg-4 is set:
- if arg-5 is set:
- set {_x} to arg-3
- set {_y} to arg-4
- set {_z} to arg-5
- set {_w} to world of targeted block
- set {_t} to "%arg-2%"
- if file "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_t}%.schema" exists:
- function "build.build" {{_x} and {_y} and {_z} and {_w} and {_t}};
- stop
- else:
- send "&cPlik %{_t}%.schema nie zostal znaleziony w folderze plugins/Skript/scripts/Anemonex/Builder/buildings/"
- stop
- else:
- send "&cMusisz podac nazwe pliku!"
- stop
- if arg-1 is "save":
- if arg-2 is set:
- if file "plugins/Skript/scripts/Anemonex/Builder/buildings/%arg-2%.schema" doesn't exists:
- if {builder::loc1.%player%} is set:
- if {builder::loc2.%player%} is set:
- set {_f} to arg-2
- set {_w} to world of player
- function "save.quick" {{builder::loc1.%player%} and {builder::loc2.%player%} and {_f} and {_w}};
- send "&3Schemat zostal zapisany do pliku %arg-2%.schema!"
- stop
- else:
- send "&cDruga lokalizacja nie zostala podana!"
- stop
- else:
- send "&cPierwsza lokalizacja nie zostala znaleziona!"
- stop
- else:
- send "&cPlik o podanej nazwie istnieje!"
- stop
- else:
- send "&cMusisz podac nazwe pliku, w ktorym zostanie zapisany schemat"
- stop
- if arg-1 is "help":
- if arg-2 is "2":
- send "&7=======================[ &32/4 &7]========================"
- send "&3/builder build <file> [x] [y] [z] &7- przy pomocy tej komendy stworzysz w wybranym miejscu schemat, ktory zostal zapisany w pliku &3<file>&7. Pamietaj, aby nazwe pliku podac &cbez rozszerzenia .schema&7. Dodatkowo mozesz podac koordynaty, na ktorych rozpoczeta zostanie budowanie. Jezeli tego nie zrobisz, obiekt pojawi sie na miejscu, na ktore patrzyles podczas uzywania komendy."
- stop
- if arg-2 is "3":
- send "&7=======================[ &33/4 &7]========================"
- send "&3/builder save <file> &7- zapisuje zaznaczony teren do pliku &3<file>&7. Teren mozesz zaznaczyc klikajac PPM i LPM trzymajac patyk. Potrzebujesz do tego pozwolenia &3builder&7 (ktore, jezeli mozesz to przeczytac, posiadasz)."
- stop
- if arg-2 is "4":
- send "&7=======================[ &34/4 &7]========================"
- send "&3 WKROTCE"
- stop
- send "&7=======================[ &31/4 &7]========================"
- send "&7* &3Strona 2: Wywolywanie schematu"
- send "&7* &3Strona 3: Zapisywanie schematu"
- send "&7* &3Strona 4: Linki i informacje od autora"
- send " "
- send "&7Wpisz &3/builder help [strona]&7, aby przejsc do wybranej strony"
- send " "
- send "&7Legenda:"
- send "&7* &3<wymagane>"
- send "&7* &3[opcjonalne]"
- stop
- send "&3/builder help"
- else:
- send "&cBrak uprawnien!"
- else:
- send "Konsola potem, nie mialem czasu :v"
- on leftclick:
- player is holding stick
- player has permission "builder"
- set {builder::loc1.%player%} to location of clicked block
- send "&3Pierwsza pozycja ustawiona!"
- stop
- on rightclick:
- player is holding stick
- player has permission "builder"
- set {builder::loc2.%player%} to location of clicked block
- send "&3Druga pozycja ustawiona!"
- stop
- # ROZPOCZNIJ BUDOWĘ
- method "build.rozpocznij" {x and y and z and w and file}:
- set {_lokalizacja.x} to arg{1};
- set {_lokalizacja.y} to arg{2};
- set {_lokalizacja.z} to arg{3};
- set {_lokalizacja.w} to arg{4};
- set {_plik} to arg{5};
- set {_schemat} to content of file "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema" parsed as text
- replace all "%nl%" with "" in {_schemat}
- replace all " " with "" in {_schemat}
- if last character of {_schemat} is ";":
- set {_skracanie} to length of {_schemat}
- set {_schemat} to first {_skracanie}-1 characters of {_schemat}
- set {_schemat.wiersze::*} to {_schemat} split at ";"
- loop {_schemat.wiersze::*}:
- set {_schemat.podzielone::*} to loop-value-1 split at "="
- set {_schemat.koordynaty.pobierz} to {_schemat.podzielone::1}
- set {_schemat.bloki.pobierz} to {_schemat.podzielone::2}
- set {_schemat.koordynaty::*} to {_schemat.koordynaty.pobierz} split at ","
- set {_schemat.koordynat.x} to {_schemat.koordynaty::1} parsed as integer
- set {_schemat.koordynat.y} to {_schemat.koordynaty::2} parsed as integer
- set {_schemat.koordynat.z} to {_schemat.koordynaty::3} parsed as integer
- set {_schemat.bloki::*} to {_schemat.bloki.pobierz} split at ","
- loop {_schemat.bloki::*}:
- add 1 to {_liczba.x}
- if "%loop-value-2%" contains "[" or "]":
- set {_stala} to "%loop-value-2%"
- if {_stala} contains "explosion":
- function "build.explosion" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "ecuboid":
- function "build.ecuboid" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "fcuboid":
- function "build.fcuboid" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "edge":
- function "build.edge" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "line":
- function "build.line" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "build":
- function "build.build" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "wall":
- function "build.wall" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else if {_stala} contains "floor":
- function "build.floor" {{_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x} and {_lokalizacja.y}+{_schemat.koordynat.y} and {_lokalizacja.z}+{_schemat.koordynat.z} and {_lokalizacja.w} and {_stala}};
- else:
- set {_blok} to loop-value-2 parsed as item
- set block at location at {_lokalizacja.x}-1+{_liczba.x}+{_schemat.koordynat.x}, {_lokalizacja.y}+{_schemat.koordynat.y}, {_lokalizacja.z}+{_schemat.koordynat.z} in world {_lokalizacja.w} to {_blok}
- clear {_liczba.x}
- # EKSPLOZJA
- method "build.explosion" {x and y and z and w and text}:
- set {_stala} to arg{5};
- replace "explosion[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_moc} to {_stala} parsed as integer
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- broadcast "%{_x}%, %{_y}%, %{_z}% in world %{_w}% with power %{_moc}%"
- create an explosion of force {_moc} at location at {_x}, {_y}, {_z} in world {_w}
- # WYPEŁNIONY PROSTOKĄT
- method "build.fcuboid" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "fcuboid[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.y} to {_argumenty::3} parsed as integer
- set {_wartosc.z} to {_argumenty::4} parsed as integer
- loop {_wartosc.y} times:
- loop {_wartosc.z} times:
- set {_blok.1} to block at location {_x}, {_y}-1+loop-number-1, {_z}-1+loop-number-2 in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number-1, {_z}-1+loop-number-2 in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- # PUSTY PROSTOKĄT
- method "build.ecuboid" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "ecuboid[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.y} to {_argumenty::3} parsed as integer
- set {_wartosc.z} to {_argumenty::4} parsed as integer
- loop {_wartosc.z} times:
- set {_blok.1} to block at location {_x}, {_y}, {_z}-1+loop-number in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}, {_z}-1+loop-number in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- loop {_wartosc.z} times:
- set {_blok.1} to block at location {_x}, {_y}-1+{_wartosc.y}, {_z}-1+loop-number in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+{_wartosc.y}, {_z}-1+loop-number in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- loop {_wartosc.y} times:
- set {_blok.1} to block at location {_x}, {_y}-1+loop-number, {_z} in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number, {_z} in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- loop {_wartosc.y} times:
- set {_blok.1} to block at location {_x}, {_y}-1+loop-number, {_z}-1+{_wartosc.z} in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number, {_z}-1+{_wartosc.z} in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- loop {_wartosc.y} times:
- set {_blok.1} to block at location {_x}, {_y}-1+loop-number, {_z} in world {_w}
- set {_blok.2} to block at location {_x}, {_y}-1+loop-number, {_z}-1+{_wartosc.z} in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- loop {_wartosc.y} times:
- set {_blok.1} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number, {_z} in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number, {_z}-1+{_wartosc.z} in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- # KRAWĘDZIE PROSTOKĄTA
- method "build.edge" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "edge[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.y} to {_argumenty::3} parsed as integer
- set {_wartosc.z} to {_argumenty::4} parsed as integer
- set {_punkt.1} to block at location {_x}, {_y}, {_z} in world {_w}
- set {_punkt.2} to block at location {_x}-1+{_wartosc.x}, {_y}, {_z} in world {_w}
- set {_punkt.3} to block at location {_x}-1+{_wartosc.x}, {_y}, {_z}-1+{_wartosc.z} in world {_w}
- set {_punkt.4} to block at location {_x}, {_y}, {_z}-1+{_wartosc.z} in world {_w}
- set {_punkt.5} to block at location {_x}, {_y}-1+{_wartosc.y}, {_z} in world {_w}
- set {_punkt.6} to block at location {_x}-1+{_wartosc.x}, {_y}-1+{_wartosc.y}, {_z} in world {_w}
- set {_punkt.7} to block at location {_x}-1+{_wartosc.x}, {_y}-1+{_wartosc.y}, {_z}-1+{_wartosc.z} in world {_w}
- set {_punkt.8} to block at location {_x}, {_y}-1+{_wartosc.y}, {_z}-1+{_wartosc.z} in world {_w}
- loop blocks between {_punkt.1} and {_punkt.2}:
- set loop-block to {_blok}
- loop blocks between {_punkt.2} and {_punkt.3}:
- set loop-block to {_blok}
- loop blocks between {_punkt.3} and {_punkt.4}:
- set loop-block to {_blok}
- loop blocks between {_punkt.4} and {_punkt.1}:
- set loop-block to {_blok}
- loop blocks between {_punkt.1} and {_punkt.5}:
- set loop-block to {_blok}
- loop blocks between {_punkt.2} and {_punkt.6}:
- set loop-block to {_blok}
- loop blocks between {_punkt.3} and {_punkt.7}:
- set loop-block to {_blok}
- loop blocks between {_punkt.4} and {_punkt.8}:
- set loop-block to {_blok}
- loop blocks between {_punkt.5} and {_punkt.6}:
- set loop-block to {_blok}
- loop blocks between {_punkt.6} and {_punkt.7}:
- set loop-block to {_blok}
- loop blocks between {_punkt.7} and {_punkt.8}:
- set loop-block to {_blok}
- loop blocks between {_punkt.8} and {_punkt.5}:
- set loop-block to {_blok}
- # PODŁOGA
- method "build.floor" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "floor[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.z} to {_argumenty::3} parsed as integer
- loop {_wartosc.z} times:
- set {_blok.1} to block at location {_x}, {_y}, {_z}-1+loop-number in world {_w}
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}, {_z}-1+loop-number in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- # ŚCIANA
- method "build.wall" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "wall[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.y} to {_argumenty::3} parsed as integer
- set {_kierunek} to {_argumenty::4} parsed as integer
- loop {_wartosc.y} times:
- set {_blok.1} to block at location {_x}, {_y}-1+loop-number, {_z} in world {_w}
- if {_kierunek} is 0:
- set {_blok.2} to block at location {_x}-1+{_wartosc.x}, {_y}-1+loop-number, {_z} in world {_w}
- if {_kierunek} is 1:
- set {_blok.2} to block at location {_x}, {_y}-1+loop-number, {_z}-1+{_wartosc.x} in world {_w}
- loop blocks between {_blok.1} and {_blok.2}:
- set loop-block to {_blok}
- # PROSTA
- method "build.line" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "line[" with "" in {_stala}
- replace "]" with "" in {_stala}
- set {_argumenty::*} to {_stala} split at "."
- set {_blok} to {_argumenty::1} parsed as item
- set {_wartosc.x} to {_argumenty::2} parsed as integer
- set {_wartosc.y} to {_argumenty::3} parsed as integer
- set {_wartosc.z} to {_argumenty::4} parsed as integer
- set {_punkt.1} to block at location {_x}, {_y}, {_z} in world {_w}
- set {_punkt.2} to block at location {_x}+{_wartosc.x}, {_y}+{_wartosc.y}, {_z}+{_wartosc.z} in world {_w}
- loop blocks between {_punkt.1} and {_punkt.2}:
- set loop-block to {_blok}
- # BUDYNEK ZE SCHEMATU
- method "build.build" {x and y and z and w and text}:
- set {_x} to arg{1};
- set {_y} to arg{2};
- set {_z} to arg{3};
- set {_w} to arg{4};
- set {_stala} to arg{5};
- replace all "build[" with "" in {_stala}
- replace "]" with "" in {_stala}
- if file "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_stala}%.schema" exists:
- function "build.rozpocznij" {{_x} and {_y} and {_z} and {_w} and {_stala}};
- # ZAPISYWANIE SZYBKIE
- method "save.quick" {loc1 and loc2 and file and world}:
- set {_loc1} to arg{1};
- set {_loc2} to arg{2};
- set {_plik} to arg{3};
- set {_w} to arg{4};
- create file "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
- set {_x1} to x-coordinate of {_loc1}
- set {_y1} to y-coordinate of {_loc1}
- set {_z1} to z-coordinate of {_loc1}
- set {_x2} to x-coordinate of {_loc2}
- set {_y2} to y-coordinate of {_loc2}
- set {_z2} to z-coordinate of {_loc2}
- if {_x2} is bigger than {_x1}:
- set {_temp} to {_x2}
- set {_x2} to {_x1}
- set {_x1} to {_temp}
- if {_y2} is bigger than {_y1}:
- set {_temp} to {_y2}
- set {_y2} to {_y1}
- set {_y1} to {_temp}
- if {_z2} is bigger than {_z1}:
- set {_temp} to {_z2}
- set {_z2} to {_z1}
- set {_z1} to {_temp}
- set {_x} to {_x1} - {_x2} + 1
- set {_y} to {_y1} - {_y2} + 1
- set {_z} to {_z1} - {_z2} + 1
- loop {_x} times:
- loop {_y} times:
- loop {_z} times:
- set {_nowy.x} to {_x2} - 1 + loop-number-1
- set {_nowy.y} to {_y2} - 1 + loop-number-2
- set {_nowy.z} to {_z2} - 1 + loop-number-3
- set {_b} to id of block at location {_nowy.x}, {_nowy.y}, {_nowy.z} in world {_w}
- set {_m} to data value of block at location {_nowy.x}, {_nowy.y}, {_nowy.z} in world {_w}
- set {_wf} to "%{_b}%"
- if {_m} is not 0:
- set {_wf} to "%{_b}%:%{_m}%"
- wf "%loop-number-1 + 1 - 2%,%loop-number-2 + 1 - 2%,%loop-number-3 + 1 - 2% = %{_wf}%;" to "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
Advertisement
Add Comment
Please, Sign In to add comment