# ___ ___ ___ _____ # / /\ /__/| / /\ / /::\ ___ ___ # / /:/_ | |:| / /:/ / /:/\:\ / /\ / /\ # / /:/ /\ | |:| / /:/ /\ / /:/ \:\ / /:/ / /:/ # / /:/ /::\ __| |:| / /:/ /:/ /__/:/ \__\:| /__/::\ / /:/ # /__/:/ /:/\:\ /__/\_|:|____ /__/:/ /:/ /\ \ \:\ / /:/ \__\/\:\__ / /::\ # \ \:\/:/~/:/ \ \:\/:::::/ \ \:\/:/ /:/ \ \:\ /:/ \ \:\/\ /__/:/\:\ # \ \::/ /:/ \ \::/~~~~ \ \::/ /:/ \ \:\/:/ \__\::/ \__\/ \:\ # \__\/ /:/ \ \:\ \ \:\/:/ \ \::/ /__/:/ \ \:\ # /__/: / \ \:\ \ \::/ \__\/ \__\/ \__\/ # \__\/ \__\/ \__\/ [By: Jeroeno_Boy] # # # Terms of usage: # 1. Do not copy! # 2. Do not claim as yours # 3. Do not remove ANY credits # 4. Please do not edit the code, if you edit it. you can't repost it. # # # Why did I make this? # I was searching for ways to paste structures in with skript. I looked # at SkEmatic. but that one didnt work for me. then I searched some more # and came to the conclusion. Skript needs a good edit API. and well... # here it is :D # # # Options: # all are in a GUI. # # # (Quick disclaimer): # I could have used TuSKe for the gui. but I wanted to keep it skript # only, so its not a tuske gui, sorry # #--------------------- #API #--------------------- #Players only: # GiveWand: # Syntax: skeGivewand(player) # Example: skeGivewand(player) # Notes: # Gives the SkEdit wand # # GetPosition: # Syntax: skePos(position, player) # Example: set {_Pos} skePos(1, player) # Returns: # - postion x of player's selection # - Nothing (Everything went well) # Notes: # Gives the first or second position, can only be 1 and 2 # # PlayerCopy: # Syntax: skePCopy(Location 1, Location 2, player) # Example: set {_R} to skePCopy(skePos(1, player), skePos(2, player), player) # Returns: # - Nothing (Everything went well) # - Location x not set # - Player not found # - Different worlds of positions # Notes: # Copies block, its slower than pasting or filling # # PlayerPaste: # Syntax: skePPaste(player) # Example: set {_R} to skePPaste(player) # Returns: # - Nothing (Everything went well) # - Clipboard empty # - Player not found # Notes: # Pasts the clipboard of the player # # PlayerSaveSchem: # Syntax: skePSaveSchem(location 1, location 2, "new Schematic", player) # Example: set {_R} to skePSaveSchem(skePos(1, player), skePos(2, player), arg 3, player) # Returns: # - Nothing (Everything went well) # - Location x not set # - Different worlds of positions # - Schematic already exists # - Player isnt online # Notes: # Saves a schematic relative to the player # # PlayerLoadSchem: # Syntax: skePLoadSchem("Schematic", player) # Example: set {_R} to skePLoadSchem(arg 3, player) # Returns: # - Schematic does not exist # - Nothing (Everything went well) # Notes: # Loads the schematic to the player's clipboard # # #Global: # Fill: # Syntax: skeFill(Location 1, Location 2, Blocks) # Example: set {_R} to skeFill(skePos(1, player), skePos(2, player), "Sand||stone||dirt") # Returns: # - Nothing (Everything went well) # - Location x not set # - World are different # Notes: # - doesn't check if the block is valid or not # - There can be multiple blocks, seperatet at "||" example: "Red wool||White wool||Orange wool" # # SaveSchem: # Syntax: skeSaveSchem(Location 1, Location 2, "new schematic") # Example: set {_R} to skeSaveSchem({_Loc1}, {_Loc2}, "Tower_Tier_1") # Returns: # - Nothing (Everything went well) # - Position x not set # - Different worlds # - Schematic already exist # Notes: # Saves the schematic relative to location 1 # # PasteSchem: # Syntax: skeSchemPaste(Center location, world, "schematic") # Example: set {_R} to skeSchemPaste(location of player, world of player, arg 3) # Returns: # - Nothing (Everything went well) # - Center not set # - Schematic doesn't exists # - World does not exist # Notes: # Pastes from where the schematic has been created # # ShowSchems: # Syntax: skeShowSchems() # Example: set {_list::*} to skeShowSchems() # Returns: # - List of all schems # - No schematic set (No schematics exist) # # DeleteSchem: # Syntax: skeDeleteSchem("schematic") # Example: set {_R} to skeDeleteSchem("Lol") # Returns: # - Nothing (All went succesful) # - Invalid schematic (Schematic doesn't exist) #-------------------------------------------- # Events #-------------------------------------------- on right click: player's tool = blaze rod named "&8[&b&lSkEdit&8]" with lore "&7Official SkEdit wand" cancel event set {SKE::Temp::players::%player%::pos2} to location of target block message "&8[&4SkEdit&8] &fPosition 2 set to &b%location of target block%" on left click: player's tool = blaze rod named "&8[&b&lSkEdit&8]" with lore "&7Official SkEdit wand" cancel event set {SKE::Temp::players::%player%::pos1} to location of target block message "&8[&4SkEdit&8] &fPosition 1 set to &b%location of target block%" on load: if {ske::Speed::Copy::Blocks} is not set: set {ske::Speed::Copy::Blocks} to 500 if {ske::Speed::Copy::MaxDelay} is not set: set {ske::Speed::Copy::MaxDelay} to 0.05 if {ske::Speed::Paste::Blocks} is not set: set {ske::Speed::Paste::Blocks} to 10000 if {ske::Speed::Paste::MaxDelay} is not set: set {ske::Speed::Paste::MaxDelay} to 0.05 on unload: delete {ske::temp::*} on inventory click: if name of player's current inventory = "SkEdit >> Settings": cancel event if clicked slot = 13: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "Delay") if name of player's current inventory = "SkEdit >> Settings >> Delay": cancel event if clicked slot = 14: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "Delay>Paste") else if clicked slot = 12: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "Delay>Copy") else if clicked slot = 22: skeGUISettings(player, "mm") play sound "block.note.pling" with volume 1 at player if name of player's current inventory = "... >> Settings >> Delay >> Paste": cancel event if clicked slot = 14: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", 1000) else if clicked slot = 15: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", 100) else if clicked slot = 16: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", 10) else if clicked slot = 12: if {ske::Speed::Paste::Blocks}-1000 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", -1000) else if clicked slot = 11: if {ske::Speed::Paste::Blocks}-100 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", -100) else if clicked slot = 10: if {ske::Speed::Paste::Blocks}-10 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPaste", -10) else if clicked slot = 20: if {ske::Speed::Paste::MaxDelay}-0.01 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPasteMS", -1) else if clicked slot = 21: if {ske::Speed::Paste::MaxDelay}-0.1 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPasteMS", -10) else if clicked slot = 23: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPasteMS", 10) else if clicked slot = 24: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayPasteMS", 1) else if clicked slot = 40: skeGUISettings(player, "Delay") play sound "block.note.pling" with volume 1 at player if name of player's current inventory = "... >> Settings >> Delay >> Copy": cancel event if clicked slot = 14: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", 1000) else if clicked slot = 15: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", 100) else if clicked slot = 16: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", 10) else if clicked slot = 12: if {ske::Speed::Copy::Blocks}-1000 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", -1000) else if clicked slot = 11: if {ske::Speed::Copy::Blocks}-100 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", -100) else if clicked slot = 10: if {ske::Speed::Copy::Blocks}-10 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopy", -10) else if clicked slot = 20: if {ske::Speed::Copy::MaxDelay}-0.01 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopyMS", -1) else if clicked slot = 21: if {ske::Speed::Copy::MaxDelay}-0.1 is less or equal to 0: play sound "entity.villager.no" with volume 1 at player else: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopyMS", -10) else if clicked slot = 23: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopyMS", 10) else if clicked slot = 24: play sound "block.note.pling" with volume 1 at player skeGUISettings(player, "RefreshDelayCopyMS", 1) else if clicked slot = 40: skeGUISettings(player, "Delay") play sound "block.note.pling" with volume 1 at player #-------------------------------------------- # Commands #-------------------------------------------- command /SkEdit [] [] []: aliases: /ske trigger: if player does not have permission "Ske.admin": message "&8[&4SkEdit&8] &7Invalid perms" stop if arg 1 = "wand": skeGivewand(player) else if arg 1 = "fill": add skePos(1, player) to {_Obj::*} add skePos(2, player) to {_Obj::*} if arg 3 is set: add "%arg 2% %arg 3%" to {_Obj::*} else: add arg 2 to {_Obj::*} set {_R} to ske("Fill", {_Obj::*}) if {_R} parsed as a integer is a integer: set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fFilling blocks..." message "&8[&4SkEdit&8] &fTotal blocks: &c%{_B::2}%" message "&8[&4SkEdit&8] &fEstimated time: &c%(Rounded ({_B::2}/{ske::speed::paste::Blocks}*{ske::speed::paste::MaxDelay}*100))/30% seconds" set {_Now} to now while {_B::1} = false: wait skeDelay("paste") if difference between now and {_Now} is more than 1 second: message "&8[&4SkEdit&8] &fProgress: &c%{_B::2}% &fBPC, &c%{_B::3}%&f Cycles, &c%{_B::4}% &fBlocks left" set {_Now} to now set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fSuccesfully pasted &c%{_B::2}% &fBlocks, in &c%{_B::3}% &fCycles" message "&8[&4SkEdit&8] &fTotal time: &c%{_B::4}%" else: message "&8[&4SkEdit&8] &fFailed pasting due to: &c%{_R}%" else if arg 1 = "copy": add skePos(1, player) to {_Obj::*} add skePos(2, player) to {_Obj::*} add player to {_Obj::*} set {_R} to ske("PlayerCopy", {_Obj::*}) if {_R} parsed as a integer is a integer: set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fCopying Blocks..." message "&8[&4SkEdit&8] &fTotal blocks: &c%{_B::2}%" message "&8[&4SkEdit&8] &fEstimated time: &c%(Rounded ({_B::2}/{ske::speed::Copy::Blocks}*{ske::speed::Copy::MaxDelay}*100))/50% seconds" set {_Now} to now while {_B::1} = false: wait skeDelay("copy") if difference between now and {_Now} is more than 2 seconds: message "&8[&4SkEdit&8] &fProgress: &c%{_B::2}% &fBPC, &c%{_B::3}%&f Cycles, &c%{_B::4}% &fBlocks left" set {_Now} to now set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fSuccesfully copied &c%{_B::2}% &fBlocks, in &c%{_B::3}% &fCycles" message "&8[&4SkEdit&8] &fTotal time: &c%{_B::4}%" else: message "&8[&4SkEdit&8] &fFailed copying due to: &c%{_R}%" else if arg 1 = "paste": add player to {_Obj::*} set {_R} to ske("PlayerPaste", {_Obj::*}) if {_R} parsed as a integer is a integer: set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fPasting Blocks..." message "&8[&4SkEdit&8] &fTotal blocks: &c%{_B::2}%" message "&8[&4SkEdit&8] &fEstimated time: &c%(Rounded ({_B::2}/{ske::speed::Paste::Blocks}*{ske::speed::Paste::MaxDelay}*100))/50% seconds" set {_Now} to now while {_B::1} = false: wait skeDelay("copy") if difference between now and {_Now} is more than 2 seconds: message "&8[&4SkEdit&8] &fProgress: &c%{_B::2}% &fBPC, &c%{_B::3}%&f Cycles, &c%{_B::4}% &fBlocks left" set {_Now} to now set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fSuccesfully pasted &c%{_B::2}% &fBlocks, in &c%{_B::3}% &fCycles" message "&8[&4SkEdit&8] &fTotal time: &c%{_B::4}%" else: message "&8[&4SkEdit&8] &fFailed pasting due to: &c%{_R}%" else if arg 1 = "reload": if player does not have permission "skript.admin": message "&8[&4SkEdit&8] &fSorry, you need Skript.Admin to reload the skript" else: message "&8[&4SkEdit&8] &fReloading skript" wait 5 ticks make player execute command "sk reload SkEdit" else if arg 1 = "settings": skeGUISettings(player, "mm") else if arg 1 = "schem": if arg 2 = "load": add arg 3 to {_Obj::*} add player to {_Obj::*} set {_R} to ske("PlayerLoadSchem", {_Obj::*}) if {_R} parsed as a integer is a integer: set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fLoading blocks to your clipboard" set {_Now} to now while {_B::1} = false: wait skeDelay("copy") set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fSuccesfully loaded &c%arg 3% &fTo your clipboard" else: message "&8[&4SkEdit&8] &fFailed loading due to: &c%{_R}%" else if arg 2 = "save": add skePos(1, player) to {_Obj::*} add skePos(2, player) to {_Obj::*} add arg 3 to {_Obj::*} add player to {_Obj::*} set {_R} to ske("PlayerSaveSchem", {_Obj::*}) if {_R} parsed as a integer is a integer: set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fCopying Blocks..." message "&8[&4SkEdit&8] &fTotal blocks: &c%{_B::2}%" message "&8[&4SkEdit&8] &fEstimated time: &c%(Rounded ({_B::2}/{ske::speed::Copy::Blocks}*{ske::speed::Copy::MaxDelay}*100))/50% seconds" set {_Now} to now while {_B::1} = false: wait skeDelay("copy") if difference between now and {_Now} is more than 2 seconds: message "&8[&4SkEdit&8] &fProgress: &c%{_B::2}% &fBPC, &c%{_B::3}%&f Cycles, &c%{_B::4}% &fBlocks left" set {_Now} to now set {_B::*} to skIDGetstate({_R} parsed as a integer) message "&8[&4SkEdit&8] &fSuccesfully copied &c%{_B::2}% &fBlocks, in &c%{_B::3}% &fCycles" message "&8[&4SkEdit&8] &fTotal time: &c%{_B::4}%" else: message "&8[&4SkEdit&8] &fFailed copying due to: &c%{_R}%" else if arg 2 = "delete": set {_item} to arg 2 parsed as a item set {_R} to skeDeleteSchem(arg 3) if {_R} is not set: message "&8[&4SkEdit&8] &fSchematic deletet" else: message "&8[&4SkEdit&8] &fFailed to fill due to &c%{_R}%" else if arg 2 = "list": set {_item} to arg 2 parsed as a item set {_R::*} to skeShowSchems() message "&8----------------- &7< &4SkEdit &7> &8-----------------" message "&7All schematics:" loop {_R::*}: message " %loop-value%" else: message "&8----------------- &7< &4SkEdit &7> &8-----------------" message "&7Commands: /SkEdit schem, /ske schem" message " &cLoad [schematic]&8- &7Load a schematic to your clipboard" message " &cSave [schematic]&8- &7Save your selection into a schematic" message " &cDelete [schematic]&8- &7Delete a schematic" message " &cList &8- &7Show all schematics" else: message "&8----------------- &7< &4SkEdit &7> &8-----------------" message "&7Commands: /SkEdit, /ske" message "&c Reload &8- &7Reload the skript" message "&c API &8- &7View the SkEdit API" message "&c Settings &8- &7Shows all settings" message "&c Wand &8- &7Gives you the wand" message "&c Fill [block]&8- &7fill a area" message "&c Copy&8- &7copy a structure" message "&c Paste&8- &7Paste what your clipboard" message "&c schem&8- &7Schematic options" function skeGUISettings(P: offline player, S: string, I: integer = 0): if {_P} does not have permission "ske.Admin": message "&8[&4SkEdit&8] &cYou don't have permissions for this gui!" to {_P} else if {_S} = "mm": wait 1 tick open chest inventory with 3 rows named "SkEdit >> Settings" to {_P} loop 3*9 times: set slot loop-value -1 of {_P}'s current inventory to light gray stained glass pane named " " set slot 13 of {_P}'s current inventory to clock named "&aDelay" with lore "&7Click to change ||||&7BPC is Blocks per cycle||&7MD is the amount of seconds has been||&7 passed in order to wait the seconds||&7 So the server wont crash||||&7Paste:|| &7BPC: &c%{ske::Speed::Paste::Blocks}%|| &7MD: &c%{ske::Speed::Paste::MaxDelay}%||&7Copy:|| &7BPC: &c%{ske::Speed::Copy::Blocks}%|| &7MD: &c%{ske::Speed::Copy::MaxDelay}%" else if {_S} = "Delay": wait 1 tick open chest inventory with 3 rows named "SkEdit >> Settings >> Delay" to {_P} loop 5*9 times: set slot loop-value -1 of {_P}'s current inventory to light gray stained glass pane named " " set slot 12 of {_P}'s current inventory to sugar named "&6Copy" with lore "&7Click to select||||&7Click to edit the Copy delay" set slot 14 of {_P}'s current inventory to redstone dust named "&6Paste" with lore "&7Click to select||||&7Click to edit the Paste delay" set slot 22 of {_P}'s current inventory to nether star named "&cGo back" with lore "&7Click to go back" else if {_S} = "Delay>Paste": wait 1 tick open chest inventory with 5 rows named "... >> Settings >> Delay >> Paste" to {_P} loop 5*9 times: set slot loop-value -1 of {_P}'s current inventory to light gray stained glass pane named " " skeGUISettings({_P}, "RefreshDelayPaste") skeGUISettings({_P}, "RefreshDelayPasteMS") set slot 40 of {_P}'s current inventory to nether star named "&cGo back" with lore "&7Click to go back" else if {_S} = "Delay>Copy": wait 1 tick open chest inventory with 5 rows named "... >> Settings >> Delay >> Copy" to {_P} loop 5*9 times: set slot loop-value -1 of {_P}'s current inventory to light gray stained glass pane named " " skeGUISettings({_P}, "RefreshDelayCopy") skeGUISettings({_P}, "RefreshDelayCopyMS") set slot 40 of {_P}'s current inventory to nether star named "&cGo back" with lore "&7Click to go back" else if {_S} = "RefreshDelayPaste": add {_I} to {ske::Speed::Paste::Blocks} set slot 13 of {_P}'s current inventory to obsidian named "&6Blocks per cycle" with lore "&7Current BPC: &c%{ske::Speed::Paste::Blocks}%||||&7Blocks per cycle is the amount of Blocks||&7 the skript does for the Maxdelay|| &7Is put in. Higher is better||&7To high & low can crash your server||&7This is also the block per cycle limit" set slot 14 of {_P}'s current inventory to arrow named "&a+1000" with lore "&7Paste BPC||||&7Click to add &a1000 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" set slot 15 of {_P}'s current inventory to arrow named "&a+100" with lore "&7Paste BPC||||&7Click to add &a100 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" set slot 16 of {_P}'s current inventory to arrow named "&a+10" with lore "&7Paste BPC||||&7Click to add &a10 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" set slot 12 of {_P}'s current inventory to arrow named "&e-1000" with lore "&7Paste BPC||||&7Click to remove &e1000 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" set slot 11 of {_P}'s current inventory to arrow named "&e-100" with lore "&7Paste BPC||||&7Click to remove &e100 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" set slot 10 of {_P}'s current inventory to arrow named "&e-10" with lore "&7Paste BPC||||&7Click to remove &e10 BPC||&7Current: &c%{ske::Speed::Paste::Blocks}%" else if {_S} = "RefreshDelayPasteMS": add {_I}/100 to {ske::Speed::Paste::MaxDelay} set slot 22 of {_P}'s current inventory to plain glass block named "&6Max Delay" with lore "&7Current MD: &c%{ske::Speed::Paste::MaxDelay}%||||&cWARNING: &7Changing the Max delay||&7can crash your server!||&7MD is the amount of seconds has been||&7 passed in order to wait the seconds||&7 So the server wont crash" set slot 23 of {_P}'s current inventory to arrow named "&a+0.1" with lore "&7Paste MD||||&7Click to add &a0.1 MD||&7Current: &c%{ske::Speed::Paste::MaxDelay}%" set slot 24 of {_P}'s current inventory to arrow named "&a+0.01" with lore "&7Paste MD||||&7Click to add &a0.01 MD||&7Current: &c%{ske::Speed::Paste::MaxDelay}%" set slot 21 of {_P}'s current inventory to arrow named "&e-0.1" with lore "&7Paste MD||||&7Click to remove &e0.1 MD||&7Current: &c%{ske::Speed::Paste::MaxDelay}%" set slot 20 of {_P}'s current inventory to arrow named "&e-0.01" with lore "&7Paste MD||||&7Click to remove &e0.01 MD||&7Current: &c%{ske::Speed::Paste::MaxDelay}%" else if {_S} = "RefreshDelayCopy": add {_I} to {ske::Speed::Copy::Blocks} set slot 13 of {_P}'s current inventory to obsidian named "&6Blocks per cycle" with lore "&7Current BPC: &c%{ske::Speed::Copy::Blocks}%||||&7Blocks per cycle is the amount of Blocks||&7 the skript does for the Maxdelay|| &7Is put in. Higher is better|| &7To high & low can crash your server||&7This is also the block per cycle limit" set slot 14 of {_P}'s current inventory to arrow named "&a+1000" with lore "&7Copy BPC||||&7Click to add &a1000 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" set slot 15 of {_P}'s current inventory to arrow named "&a+100" with lore "&7Copy BPC||||&7Click to add &a100 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" set slot 16 of {_P}'s current inventory to arrow named "&a+10" with lore "&7Copy BPC||||&7Click to add &a10 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" set slot 12 of {_P}'s current inventory to arrow named "&e-1000" with lore "&7Copy BPC||||&7Click to remove &e1000 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" set slot 11 of {_P}'s current inventory to arrow named "&e-100" with lore "&7Copy BPC||||&7Click to remove &e100 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" set slot 10 of {_P}'s current inventory to arrow named "&e-10" with lore "&7Copy BPC||||&7Click to remove &e10 BPC||&7Current: &c%{ske::Speed::Copy::Blocks}%" else if {_S} = "RefreshDelayCopyMS": add {_I}/100 to {ske::Speed::Copy::MaxDelay} set slot 22 of {_P}'s current inventory to plain glass block named "&6Max Delay" with lore "&7Current MD: &c%{ske::Speed::Copy::MaxDelay}%||||&cWARNING: &7Changing the Max delay||&7can crash your server!||&7MD is the amount of seconds has been||&7 passed in order to wait the seconds||&7 So the server wont crash" set slot 23 of {_P}'s current inventory to arrow named "&a+0.1" with lore "&7Copy MD||||&7Click to add &a0.1 MD||&7Current: &c%{ske::Speed::Copy::MaxDelay}%" set slot 24 of {_P}'s current inventory to arrow named "&a+0.01" with lore "&7Copy MD||||&7Click to add &a0.01 MD||&7Current: &c%{ske::Speed::Copy::MaxDelay}%" set slot 21 of {_P}'s current inventory to arrow named "&e-0.1" with lore "&7Copy MD||||&7Click to remove &e0.1 MD||&7Current: &c%{ske::Speed::Copy::MaxDelay}%" set slot 20 of {_P}'s current inventory to arrow named "&e-0.01" with lore "&7Copy MD||||&7Click to remove &e0.01 MD||&7Current: &c%{ske::Speed::Copy::MaxDelay}%" #-------------------------------------------- # Return v2 #-------------------------------------------- function ske(Function: string, Obj: objects) :: string: set {_SkID} to random integer between 100000 and 999999 if {_Function} = "Fill": if {_Obj::4} is not set: set {_R} to skeFill({_Obj::1}, {_Obj::2}, {_Obj::3}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "PlayerCopy": if {_Obj::4} is not set: set {_R} to skePCopy({_Obj::1}, {_Obj::2}, {_Obj::3}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "PlayerPaste": if {_Obj::2} is not set: set {_R} to skePPaste({_Obj::1}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "PlayerLoadSchem": if {_Obj::3} is not set: set {_R} to skePLoadSchem({_Obj::1}, {_Obj::2}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "PlayerSaveSchem": if {_Obj::5} is not set: set {_R} to skePSaveSchem({_Obj::1}, {_Obj::2}, {_Obj::3}, {_Obj::4}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "PasteSchem": if {_Obj::4} is not set: set {_R} to skeSchemPaste({_Obj::1}, {_Obj::2}, {_Obj::3}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else if {_Function} = "SaveSchem": if {_Obj::4} is not set: set {_R} to skeSaveSchem({_Obj::1}, {_Obj::2}, {_Obj::3}, {_SkID}) if {_R} is set: return {_R} else: return "%{_SkID}%" else: return "To many objects" else: return "Invalid function" function skIDGetstate(SkID: integer = 0) :: objects: return {SkID::%{_SkID}%::*} function skeDelay(s: string) :: timespan: if {_S} = "paste": return "%{ske::Speed::paste::MaxDelay}% seconds" parsed as a timespan else if {_S} = "copy": return "%{ske::Speed::copy::MaxDelay}% seconds" parsed as a timespan else: return 1 second #-------------------------------------------- # API #-------------------------------------------- function skeFill(Loc1: location, Loc2: Location, item: string, SkID: integer = 0) :: string: set {_i::*} to {_item} split at "||" set {_int} to 0 loop {_i::*}: add 1 to {_int} set {_block} to {_i::%{_int}%} parsed as a item add {_block} to {_B::*} if {_Loc1} is not a location: return "Location 1 is not set" if {_Loc2} is not a location: return "Location 2 is not set" if world of {_Loc1} != world of {_Loc2}: return "Worlds are different" if x position of {_loc1} > x position of {_loc2}: set {_Xlow} to x position of {_loc2} else: set {_XLow} to x position of {_loc1} if y position of {_loc1} > y position of {_loc2}: set {_Ylow} to y position of {_loc2} else: set {_YLow} to y position of {_loc1} if z position of {_loc1} > z position of {_loc2}: set {_Zlow} to z position of {_loc2} else: set {_ZLow} to z position of {_loc1} set {SkID::%{_SkID}%::1} to false set {_X} to difference between x position of {_Loc1} and x position of {_Loc2} set {_Y} to difference between y position of {_Loc1} and y position of {_Loc2} set {_Z} to difference between z position of {_Loc1} and z position of {_Loc2} set {_Blocks} to ({_X}+1)*({_Y}+1)*({_Z}+1) set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop (difference between x position of {_Loc1} and x position of {_Loc2})+1 times: set {_X3} to {_XLow}-1 + loop-value-1 loop (difference between z position of {_Loc1} and z position of {_Loc2})+1 times: set {_Z3} to {_ZLow}-1 + loop-value-2 loop (difference between y position of {_Loc1} and y position of {_Loc2})+1 times: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::paste::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} set {_Y3} to {_YLow}-1 + loop-value-3 set {_rand} to Random(1, {_int}) set {_block} to {_B::%{_rand}%} set block at location {_X3}, {_Y3}, {_Z3} in world of {_loc1} to {_block} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skeSaveSchem(Loc1: location, Loc2: Location, Schem: string, SkID: integer = 0) :: string: if {SKE::SchemList::*} contains {_Schem}: return "schematic already exists" if {_Loc1} is not a location: return "Location 1 is not set" if {_Loc2} is not a location: return "Location 2 is not set" if world of {_Loc1} != world of {_Loc2}: return "Worlds are different" set {_World} to world of {_Loc1} add {_Schem} to {SKE::SchemList::*} if x position of {_loc1} > x position of {_loc2}: set {_Xlow} to x position of {_loc2} else: set {_XLow} to x position of {_loc1} if y position of {_loc1} > y position of {_loc2}: set {_Ylow} to y position of {_loc2} else: set {_YLow} to y position of {_loc1} if z position of {_loc1} > z position of {_loc2}: set {_Zlow} to z position of {_loc2} else: set {_ZLow} to z position of {_loc1} set {SkID::%{_SkID}%::1} to false set {_X} to difference between x position of {_Loc1} and x position of {_Loc2} set {_Y} to difference between y position of {_Loc1} and y position of {_Loc2} set {_Z} to difference between z position of {_Loc1} and z position of {_Loc2} set {_Blocks} to ({_X}+1)*({_Y}+1)*({_Z}+1) set {SKE::Schem::%{_Schem}%::clipboard::size} to {_Blocks} set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop (difference between x position of {_Loc1} and x position of {_Loc2})+1 times: set {_X3} to ({_XLow}-1 + loop-value-1) - x-position of {_Loc1} loop (difference between z position of {_Loc1} and z position of {_Loc2})+1 times: set {_Z3} to ({_ZLow}-1 + loop-value-2) - z-position of {_Loc1} loop (difference between y position of {_Loc1} and y position of {_Loc2})+1 times: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::paste::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} set {_Y3} to {_YLow}-1 + loop-value-3 set {_rand} to Random(1, {_int}) set {_block} to {_B::%{_rand}%} set block at location {_X3}, {_Y3}, {_Z3} in world of {_loc1} to {_block} set {_Y3} to ({_YLow}-1 + loop-value-3) - y-position of {_Loc1} add location {_X3}, {_Y3}, {_Z3} in {_World} to {SKE::Schem::%{_Schem}%::clipboard::loc::*} set {_Block} to block at location loop-value-1 + {_XLow}-1, loop-value-3 + {_YLow}-1, loop-value-2 + {_ZLow}-1 in {_World} add data of (block at {_Block}) to {SKE::Schem::%{_Schem}%::clipboard::blockNBT::*} add "%{_Block}%" parsed as a item to {SKE::Schem::%{_Schem}%::clipboard::block::*} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skeSchemPaste(Center: location, world: world, schem: string, SkID: integer = 0) :: string: if {SKE::Schem::%{_schem}%::clipboard::loc::1} is not set: return "Schematic doesn't exists" if {_Center} is not set: return "Center is not set" set {SkID::%{_SkID}%::1} to false set {_Blocks} to {SKE::schem::%{_schem}%::clipboard::size} set {_id} to 0 set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop {ske::Schem::%{_schem}%::clipboard::loc::*}: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::paste::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} add 1 to {_id} set {_X} to (X-position of loop-value) + X-position of {_Center} set {_Y} to (Y-position of loop-value) + Y-position of {_Center} set {_Z} to (Z-position of loop-value) + Z-position of {_Center} set {_Loc} to location {_X}, {_Y}, {_Z} in {_world} set block at {_loc} to {SKE::Schem::%{_schem}%::clipboard::block::%{_id}%} set data of (block at {_Loc}) to {SKE::Schem::%{_schem}%::clipboard::blockNBT::%{_id}%} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skeShowSchems() :: objects: if {ske::schemlist::1} is set: return {ske::schemlist::*} else: return "No schematic set" function skeDeleteSchem(schem: string) :: string: if {SKE::Schemlist::*} contains {_schem}: delete {SKE::Schem::%{_schem}%::*} remove {_schem} from {ske::schemlist::*} else: return "Invalid schematic" #----------------- #Player options \/ #----------------- function skePCopy(Loc1: location, Loc2: Location, P: offline player, SkID: integer = 0) :: string: if {_Loc1} is not a location: return "Location 1 is not set" if {_Loc2} is not a location: return "Location 2 is not set" if {_P} is not online: return "Player isn't found" if world of {_Loc1} != world of {_Loc2}: return "Worlds are different" set {_Loc3} to block at location of {_P} clear {SKE::Temp::%{_P}%::clipboard::*} if x position of {_loc1} > x position of {_loc2}: set {_Xlow} to x position of {_loc2} else: set {_XLow} to x position of {_loc1} if y position of {_loc1} > y position of {_loc2}: set {_Ylow} to y position of {_loc2} else: set {_YLow} to y position of {_loc1} if z position of {_loc1} > z position of {_loc2}: set {_Zlow} to z position of {_loc2} else: set {_ZLow} to z position of {_loc1} set {SkID::%{_SkID}%::1} to false set {_X} to difference between x position of {_Loc1} and x position of {_Loc2} set {_Y} to difference between y position of {_Loc1} and y position of {_Loc2} set {_Z} to difference between z position of {_Loc1} and z position of {_Loc2} set {_Blocks} to ({_X}+1)*({_Y}+1)*({_Z}+1) set {SKE::Temp::%{_P}%::clipboard::size} to {_Blocks} set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop (difference between x position of {_Loc1} and x position of {_Loc2})+1 times: set {_X3} to ({_XLow}-1 + loop-value-1) - x-position of {_Loc3} loop (difference between z position of {_Loc1} and z position of {_Loc2})+1 times: set {_Z3} to ({_ZLow}-1 + loop-value-2) - z-position of {_Loc3} loop (difference between y position of {_Loc1} and y position of {_Loc2})+1 times: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::paste::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} set {_Y3} to ({_YLow}-1 + loop-value-3) - y-position of {_Loc3} add location {_X3}, {_Y3}, {_Z3} in world of {_P} to {SKE::Temp::%{_P}%::clipboard::loc::*} set {_Block} to block at location {_XLow}-1 + loop-value-1, {_YLow}-1 + loop-value-3, {_ZLow}-1 + loop-value-2 in world of {_P} add data of block at {_Block} to {SKE::Temp::%{_P}%::clipboard::blockNBT::*} add "%{_Block}%" parsed as a item to {SKE::Temp::%{_P}%::clipboard::block::*} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skePPaste(P: offline player, SkID: integer = 0) :: string: if {_P} is not online: return "Player isn't found" if {SKE::Temp::%{_P}%::clipboard::loc::1} is not set: return "Nothing at clipboard" set {_center} to block at {_P} set {SkID::%{_SkID}%::1} to false set {_Blocks} to {SKE::Temp::%{_P}%::clipboard::size} set {_id} to 0 set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop {SKE::Temp::%{_P}%::clipboard::loc::*}: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::paste::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Paste::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} add 1 to {_id} set {_X3} to (x-position of loop-value) + x-position of {_center} set {_Z3} to (z-position of loop-value) + z-position of {_center} set {_Y3} to (y-position of loop-value) + y-position of {_center} set {_Loc} to block at location {_X3}, {_Y3}, {_Z3} in world of {_P} set block at {_loc} to {SKE::Temp::%{_P}%::clipboard::block::%{_id}%} set data of block at {_loc} to {SKE::Temp::%{_P}%::clipboard::blockNBT::%{_id}%} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skePSaveSchem(Loc1: location, Loc2: Location, Schem: string, P: offline player, SkID: integer = 0) :: string: if {SKE::SchemList::*} contains {_Schem}: return "schematic already exists" if {_Loc1} is not a location: return "Location 1 is not set" if {_Loc2} is not a location: return "Location 2 is not set" if {_P} is not online: return "Player isn't found" if world of {_Loc1} != world of {_Loc2}: return "Worlds are different" set {_World} to world of {_Loc1} add {_Schem} to {SKE::SchemList::*} set {_Loc3} to block at location of {_P} if x position of {_loc1} > x position of {_loc2}: set {_Xlow} to x position of {_loc2} else: set {_XLow} to x position of {_loc1} if y position of {_loc1} > y position of {_loc2}: set {_Ylow} to y position of {_loc2} else: set {_YLow} to y position of {_loc1} if z position of {_loc1} > z position of {_loc2}: set {_Zlow} to z position of {_loc2} else: set {_ZLow} to z position of {_loc1} set {SkID::%{_SkID}%::1} to false set {_X} to difference between x position of {_Loc1} and x position of {_Loc2} set {_Y} to difference between y position of {_Loc1} and y position of {_Loc2} set {_Z} to difference between z position of {_Loc1} and z position of {_Loc2} set {_Blocks} to ({_X}+1)*({_Y}+1)*({_Z}+1) set {SKE::Schem::%{_Schem}%::clipboard::size} to {_Blocks} set {SkID::%{_SkID}%::2} to {_Blocks} set {_Blocksleft} to {_Blocks} set {_Cycles} to 1 set {_Count} to 0 wait 1 tick set {_Last} to now set {_Start} to now loop (difference between x position of {_Loc1} and x position of {_Loc2})+1 times: set {_X3} to ({_XLow}-1 + loop-value-1) - x-position of {_Loc3} loop (difference between z position of {_Loc1} and z position of {_Loc2})+1 times: set {_Z3} to ({_ZLow}-1 + loop-value-2) - z-position of {_Loc3} loop (difference between y position of {_Loc1} and y position of {_Loc2})+1 times: add 1 to {_Count} if difference between {_Last} and now is more than "%{ske::Speed::Copy::MaxDelay}% seconds" parsed as a timespan: set {_1} to 1 else if {_Count} = {ske::speed::Copy::Blocks}: set {_1} to 1 if {_1} = 1: remove {_Count} from {_Blocksleft} set {SkID::%{_SkID}%::2} to {_Count} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_Blocksleft} add 1 to {_Cycles} set {_Count} to 0 wait "%{ske::Speed::Copy::MaxDelay}% seconds" parsed as a timespan set {_Last} to now delete {_1} set {_Y3} to ({_YLow}-1 + loop-value-3) - y-position of {_Loc3} add location {_X3}, {_Y3}, {_Z3} in {_World} to {SKE::Schem::%{_Schem}%::clipboard::loc::*} set {_Block} to block at location loop-value-1 + {_XLow}-1, loop-value-3 + {_YLow}-1, loop-value-2 + {_ZLow}-1 in {_World} add data of (block at {_Block}) to {SKE::Schem::%{_Schem}%::clipboard::blockNBT::*} add "%block at {_Block}%" parsed as a item to {SKE::Schem::%{_Schem}%::clipboard::block::*} set {_S} to difference between now and {_Start} set {SkID::%{_SkID}%::1} to true set {SkID::%{_SkID}%::2} to {_Blocks} set {SkID::%{_SkID}%::3} to {_Cycles} set {SkID::%{_SkID}%::4} to {_S} function skePLoadSchem(schem: string, P: offline player, SkID: integer = 0) :: string: if {SKE::Schem::%{_Schem}%::clipboard::loc::1} is not set: return "schematic doesn't exists" set {_Start} to now set {SkID::%{_SkID}%::1} to false set {SKE::Temp::%{_P}%::clipboard::loc::*} to {SKE::Schem::%{_Schem}%::clipboard::loc::*} set {SKE::Temp::%{_P}%::clipboard::block::*} to {SKE::Schem::%{_Schem}%::clipboard::block::*} set {SKE::Temp::%{_P}%::clipboard::blockNBT::*} to {SKE::Schem::%{_Schem}%::clipboard::blockNBT::*} set {SkID::%{_SkID}%::1} to true function skeGivewand(P: offline player): give {_P} 1 blaze rod named "&8[&b&lSkEdit&8]" with lore "&7Official SkEdit wand" function skePos(pos: integer, P: offline player) :: location: if {_pos} = 1: return {SKE::Temp::players::%{_P}%::pos1} else if {_pos} = 2: return {SKE::Temp::players::%{_P}%::pos2} function Random(min: integer, max: integer, Times: integer = 5) :: integer: if {_times} is less than 1: set {_times} to 5 loop {_Times} times: add random integer between {_min} and {_max} to {_Int::*} set {_int} to random integer between 1 and {_times} return rounded {_int::%{_int}%}