Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- set {anemonex::builder} to true
- 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"
- on unload:
- clear {anemonex::builder}
- 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 arg-3 is 0 or 1:
- if arg-4 is 0 or 1:
- if arg-5 is 0 or 1:
- 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 {_a1} to arg-3
- set {_a2} to arg-4
- set {_a3} to arg-5
- set {_w} to world of player
- function "save.start" {{builder::loc1.%player%} and {builder::loc2.%player%} and {_w} and {_a1} and {_a2} and {_a3} and {_f}};
- 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 "&cArgument ##3 (data) jest niepoprawny!"
- else:
- send "&cArgument ##2 (air) jest niepoprawny!"
- else:
- send "&cArgument ##1 (quick) jest niepoprawny!"
- 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"
- cancel event
- 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}};
- # ROZPOCZĘCIE ZAPISYWANIA
- method "save.start" {loc1 and loc2 and world and arg1 and arg2 and arg3 and file}:
- set {_arg.1} to arg{4};
- set {_arg.2} to arg{5}; # doesn't matter right now
- set {_arg.3} to arg{6}; # doesn't matter right now
- if {_arg.1} is 1:
- function "save.quick" {arg{1} and arg{2} and arg{3} and arg{7}};
- else:
- function "save.smart" {arg{1} and arg{2} and arg{3} and arg{7}};
- method "save.smart" {loc1 and loc2 and world and file}:
- set {_loc1} to arg{1};
- set {_loc2} to arg{2};
- set {_w} to arg{3};
- set {_plik} 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
- set {_loopnum} to 0
- set {_skip} to 0
- loop {_x} times:
- loop {_y} times:
- loop {_z} times:
- add 1 to {_loopnum}
- if {_data.%loop-number-1 + 1 - 2%.%loop-number-2 + 1 - 2%.%loop-number-3 + 1 - 2%} is set:
- set {_skip} to {_data.%loop-number-1 + 1 - 2%.%loop-number-2 + 1 - 2%.%loop-number-3 + 1 - 2%}
- if {_skip} is 0:
- set {_now.x} to {_x2} - 1 + loop-number-1
- set {_now.y} to {_y2} - 1 + loop-number-2
- set {_now.z} to {_z2} - 1 + loop-number-3
- set {_check.0.0.0} to block at location {_now.x}, {_now.y}, {_now.z} in world {_w}
- set {_check.0.0.1} to block at location {_now.x}, {_now.y}, {_now.z}+1 in world {_w}
- set {_check.0.1.0} to block at location {_now.x}, {_now.y}+1, {_now.z} in world {_w}
- set {_check.0.1.1} to block at location {_now.x}, {_now.y}+1, {_now.z}+1 in world {_w}
- set {_check.1.0.0} to block at location {_now.x}+1, {_now.y}, {_now.z} in world {_w}
- set {_check.1.0.1} to block at location {_now.x}+1, {_now.y}, {_now.z}+1 in world {_w}
- set {_check.1.1.0} to block at location {_now.x}+1, {_now.y}+1, {_now.z} in world {_w}
- set {_check.1.1.1} to block at location {_now.x}+1, {_now.y}+1, {_now.z}+1 in world {_w}
- if {_x} is loop-number-1:
- set {_check.1.0.0} to "null"
- set {_check.1.0.1} to "null"
- set {_check.1.1.0} to "null"
- set {_check.1.1.1} to "null"
- if {_y} is loop-number-2:
- set {_check.0.1.0} to "null"
- set {_check.0.1.1} to "null"
- set {_check.1.1.0} to "null"
- set {_check.1.1.1} to "null"
- if {_z} is loop-number-3:
- set {_check.0.0.1} to "null"
- set {_check.0.1.1} to "null"
- set {_check.1.0.1} to "null"
- set {_check.1.1.1} to "null"
- set {_type} to ""
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.0.0.1}%:%data value of {_check.0.0.1}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.0.1.0}%:%data value of {_check.0.1.0}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.0.1.1}%:%data value of {_check.0.1.1}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.1.0.0}%:%data value of {_check.1.0.0}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.1.0.1}%:%data value of {_check.1.0.1}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.1.1.0}%:%data value of {_check.1.1.0}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%" is "%id of {_check.1.1.1}%:%data value of {_check.1.1.1}%":
- set {_type} to "%{_type}%1"
- else:
- set {_type} to "%{_type}%0"
- if "%{_type}%" is "1111111": # PROSTOKĄT
- set {_max.x} to {_x} - loop-number-1
- set {_max.y} to {_y} - loop-number-2
- set {_max.z} to {_z} - loop-number-3
- set {_count.x} to 2
- set {_count.y} to 2
- set {_count.z} to 2
- set {_mainblock} to "%id of {_check.0.0.0}%:%data value of {_check.0.0.0}%"
- set {_break} to 3
- while {_break} is not 0:
- set {_break} to 3
- if {_max.x} is not 0:
- set {_checknum.1} to 0
- set {_checknum.2} to 0
- loop {_count.y} times:
- loop {_count.z} times:
- add 1 to {_checknum.1}
- set {_checkblock} to "%id of block at location {_now.x} + {_count.x}, {_now.y} + loop-number-4 + 1 - 2, {_now.z} + loop-number-5 + 1 - 2 in world {_w}%:%data value of block at location {_now.x} + {_count.x}, {_now.y} + loop-number-4 + 1 - 2, {_now.z} + loop-number-5 + 1 - 2 in world {_w}%"
- if "%{_mainblock}%" is "%{_checkblock}%":
- add 1 to {_checknum.2}
- remove 1 from {_max.x}
- if {_checknum.1} is {_checknum.2}:
- add 1 to {_count.x}
- else:
- set {_max.x} to 0
- else:
- remove 1 from {_break}
- if {_max.y} is not 0:
- set {_checknum.1} to 0
- set {_checknum.2} to 0
- loop {_count.x} times:
- loop {_count.z} times:
- add 1 to {_checknum.1}
- set {_checkblock} to "%id of block at location {_now.x} + loop-number-4 + 1 - 2, {_now.y} + {_count.y}, {_now.z} + loop-number-5 + 1 - 2 in world {_w}%:%data value of block at location {_now.x} + loop-number-4 + 1 - 2, {_now.y} + {_count.y}, {_now.z} + loop-number-5 + 1 - 2 in world {_w}%"
- if "%{_mainblock}%" is "%{_checkblock}%":
- add 1 to {_checknum.2}
- remove 1 from {_max.y}
- if {_checknum.1} is {_checknum.2}:
- add 1 to {_count.y}
- else:
- set {_max.x} to 0
- else:
- remove 1 from {_break}
- if {_max.z} is not 0:
- set {_checknum.1} to 0
- set {_checknum.2} to 0
- loop {_count.x} times:
- loop {_count.y} times:
- add 1 to {_checknum.1}
- set {_checkblock} to "%id of block at location {_now.x} + loop-number-4 + 1 - 2, {_now.y} + loop-number-5 + 1 - 2, {_now.z} + {_count.z} in world {_w}%:%data value of block at location {_now.x} + loop-number-4 + 1 - 2, {_now.y} + loop-number-5 + 1 - 2, {_now.z} + {_count.z} in world {_w}%"
- if "%{_mainblock}%" is "%{_checkblock}%":
- add 1 to {_checknum.2}
- remove 1 from {_max.z}
- if {_checknum.1} is {_checknum.2}:
- add 1 to {_count.z}
- else:
- remove 1 from {_break}
- set {_save.x} to {_x2} - {_now.x}
- set {_save.y} to {_y2} - {_now.y}
- set {_save.z} to {_z2} - {_now.z}
- if {_now.x} is bigger than {_x2}:
- set {_save.x} to {_now.x} - {_x2}
- if {_now.y} is bigger than {_y2}:
- set {_save.y} to {_now.y} - {_y2}
- if {_now.z} is bigger than {_z2}:
- set {_save.z} to {_now.z} - {_z2}
- if id of {_check.0.0.0} is 0:
- wf "%{_save.x}%,%{_save.y}%,%{_save.z}% = fcuboid[%id of {_check.0.0.0}%.%{_count.x}%.%{_count.y}%.%{_count.z}%];" to "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
- else:
- wf "%{_save.x}%,%{_save.y}%,%{_save.z}% = fcuboid[%id of {_check.0.0.0}%:%data of {_check.0.0.0}%.%{_count.x}%.%{_count.y}%.%{_count.z}%];" to "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
- loop {_count.y} times:
- loop {_count.z} times:
- set {_data.%loop-number-1 + loop-number-5 + 1 - 3%.%loop-number-2 + loop-number-4 + 1 - 3%.%loop-number-3 + 1 - 2%} to {_count.x}
- set {_skip} to {_count.x}
- else if "%{_type}%" is "1001100": # PODŁOGA
- send "nope" to console
- else if "%{_type}%" is "0101010": # ŚCIANA [0]
- send "nope" to console
- else if "%{_type}%" is "1110000": # ŚCIANA [1]
- send "nope" to console
- else if "%{_type}%" is "1000000": # PROSTA [0.0.1]
- send "nope" to console
- else if "%{_type}%" is "0100000": # PROSTA [0.1.0]
- send "nope" to console
- else if "%{_type}%" is "0010000": # PROSTA [0.1.1]
- send "nope" to console
- else if "%{_type}%" is "0001000": # PROSTA [1.0.0]
- send "nope" to console
- else if "%{_type}%" is "0000100": # PROSTA [1.0.1]
- send "nope" to console
- else if "%{_type}%" is "0000010": # PROSTA [1.1.0]
- send "nope" to console
- else if "%{_type}%" is "0000001": # PROSTA [1.1.1]
- send "nope" to console
- else: # SAMOTNY BLOK
- if id of {_check.0.0.0} is 0:
- wf "%loop-number-1 + 1 - 2%,%loop-number-2 + 1 - 21%,%loop-number-3 + 1 - 2% = %id of {_check.0.0.0}%;" to "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
- else:
- wf "%loop-number-1 + 1 - 2%,%loop-number-2 + 1 - 2%,%loop-number-3 + 1 - 2% = %id of {_check.0.0.0}%:%data of {_check.0.0.0}%;" to "plugins/Skript/scripts/Anemonex/Builder/buildings/%{_plik}%.schema"
- wait 0.1 second
- else:
- remove 1 from {_skip}
- # ZAPISYWANIE SZYBKIE
- method "save.quick" {loc1 and loc2 and world and file}:
- set {_loc1} to arg{1};
- set {_loc2} to arg{2};
- set {_w} to arg{3};
- set {_plik} 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