Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- wait : 1000 #大きくするほど負荷が大きくなりますが修復が早くなります
- #編集しないでください!!!!!!
- on load:
- broadcast "&aSKCP:&bcoreprotect-sk for PSJ が読み込まれました"
- on break:
- if {CP.inspecter.%player%} is set:
- cancel event
- message "Inspecter log of %floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%"
- loop {CP::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}:
- set {_log::*} to split loop-value at " "
- set {_log} to " %{_log::3}% "
- set {_looptimes} to 0
- loop {_log::*}:
- add 1 to {_looptimes}
- {_looptimes} > 3
- set {_log} to "%{_log}%%loop-value-2% "
- # set {_log} to " %{_log::3}% %{_log::4}% %{_log::5}% %{_log::6}%"
- # message "debug:%{CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}%({CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%})"
- set {_log1::*} to split {_log::2} at ";"
- set {_time} to difference between now and {CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}
- set {_time} to timesetting("%{_time}%")
- if {CPR::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%loop-index%} is set:
- message "&m%{_time}% ago&7&m(%{_log::1}% %{_log1::1}%) &f&mid:%{_log1::2}%%{_log}%"
- else:
- message "%{_time}% ago&7(%{_log::1}% %{_log1::1}%) &fid:%{_log1::2}%%{_log}%"
- stop
- set {_id} to random integer between 1 and 999999
- set {CPB::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%nowdate()%;%{_id}%} to type of event-block
- add "%nowdate()%;%{_id}% : %player% deleted %event-block%" to {CP::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}
- set {CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%nowdate()%;%{_id}%} to now
- add all items in event-block's inventory to {CPN::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%nowdate()%;%{_id}%::*}
- function timesetting(time: String) :: String:
- replace all " and " in {_time} with ""
- replace all " minutes" in {_time} with "m"
- replace all " seconds" in {_time} with "s"
- replace all " minute" in {_time} with "m"
- replace all " second" in {_time} with "s"
- replace all " hours" in {_time} with "h"
- replace all " hour" in {_time} with "h"
- replace all " day" in {_time} with "d"
- replace all " days" in {_time} with "d"
- return {_time}
- on place:
- if {CP.inspecter.%player%} is set:
- cancel event
- message "Inspecter log of %floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%"
- loop {CP::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}:
- set {_log::*} to split loop-value at " "
- set {_log} to " %{_log::3}% "
- set {_looptimes} to 0
- loop {_log::*}:
- add 1 to {_looptimes}
- {_looptimes} > 3
- set {_log} to "%{_log}%%loop-value-2% "
- # set {_log} to " %{_log::3}% %{_log::4}% %{_log::5}% %{_log::6}%"
- # message "debug:%{CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}%({CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%})"
- set {_log1::*} to split {_log::2} at ";"
- set {_time} to difference between now and {CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}
- set {_time} to timesetting("%{_time}%")
- if {CPR::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%loop-index%} is set:
- message "&m%{_time}% ago&7&m(%{_log::1}% %{_log1::1}%) &f&mid:%{_log1::2}%%{_log}%"
- else:
- message "%{_time}% ago&7(%{_log::1}% %{_log1::1}%) &fid:%{_log1::2}%%{_log}%"
- stop
- set {_id} to random integer between 1 and 999999
- add "%nowdate()%;%{_id}% : %player% placed %event-block%" to {CP::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}
- set {CPT::%player's world%:%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%nowdate()%;%{_id}%} to now
- on load:
- add chest to {CPBlock::container::*}
- add dispenser to {CPBlock::container::*}
- add dropper to {CPBlock::container::*}
- add furnace to {CPBlock::container::*}
- add jukebox to {CPBlock::container::*}
- add brewing stand to {CPBlock::container::*}
- on explode:
- loop all blocks in radius 10 of event-location:
- loop-block is not air
- set {_loc.%loop-block's location%} to type of loop-block
- add 1 to {_index.%loop-block's location%}
- loop {CP::%event-entity's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- add 1 to {_index.%loop-block's location%}
- {CPBlock::container::*} contain loop-block
- set {_loc.%loop-block's location%.container::*} to all items in loop-block's inventory
- wait a tick
- loop all blocks in radius 10 of event-location:
- {CP::%event-entity's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_index.%loop-block's location%}%} is not set
- {_loc.%loop-block's location%} is not loop-block
- {_loc.%loop-block's location%} is set
- set {_id} to random integer between 1 and 999999
- set {CPB::%event-entity's world%:%floor(x location of loop-block's location)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%nowdate()%;%{_id}%} to {_loc.%loop-block's location%}
- add "%nowdate()%;%{_id}% : ##%event-entity% deleted %{_loc.%loop-block's location%}%" to {CP::%event-entity's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}
- set {CPT::%event-entity's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%nowdate()%;%{_id}%} to 1 ticks ago
- add {_loc.%loop-block's location%.container::*} to {CPN::%event-entity's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%nowdate()%;%{_id}%::*}
- # message "SKCP:explosion logging process done" to console
- #on explode:
- # add "%nowdate()% : ##%event-entity% &cexploded &f%event-block%" to {CP::%player's world%:%floor(x location of event-location)%%floor(y location of event-location)%%floor(z location of event-location)%::*}
- command /coreprotect <text> [<integer>] [<text>] [<timespan>]:
- aliases: /co
- permission: skript.coreprotect.use
- trigger:
- set {_now} to now
- set {_playerlocation} to player's location
- if arg-1 is "inspect" or "i":
- if {CP.inspecter.%player%} is not set:
- set {CP.inspecter.%player%} to true
- message "&aSKCP:&bInspecterを有効にしました"
- else:
- clear {CP.inspecter.%player%}
- message "&aSKCP:&bInspecterを無効にしました"
- else if arg-1 is "rollback" or "rb":
- if arg-4 is set:
- loop all blocks in radius arg-2 of player:
- if {CP::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*} is set:
- loop {CP::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%loop-index%} is not set
- add 1 to {_loopcount}
- if mod({_loopcount}, {@wait}) is 0:
- wait a tick
- clear {_loop::*}
- # message "Debug:looping {CP::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}"
- set {_loop::*} to split loop-value-2 at " "
- # message "Debug:Splited::%{_loop::*}%"
- set {_time} to {CPT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # loop {CPT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- # message "Debug:Timeindex::%loop-index-2%"
- # message "Debug:Time::%{_time}%({CPT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%})"
- difference between {_now} and {_time} is smaller than arg-4
- # message "Debug:Passed difference"
- set {_player} to {_loop::4}
- if arg-3 is "all":
- set {_player} to arg-3
- "%arg-3%" is {_player}
- message "&aSKCP:&b%loop-block's location%を修復しています..."
- # message "Debug:Passed player"
- set {_event} to {_loop::5}
- set {_cprb} to type of loop-block
- set {_cprn::*} to all items in loop-block's inventory
- if {_event} is "placed":
- # message "Debug:block removed"
- set loop-block to air
- if {_event} is "deleted":
- set loop-block to {CPB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # message "Debug:block placed(%{CPB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}%)"
- {CPBlock::container::*} contain loop-block
- # message "%loop-block% is container"
- wait 1 seconds
- add {CPN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*} to loop-block's inventory
- # message "Debug:itemadded %{CPN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*}%"
- add 1 to {_fixedblocks}
- set {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%loop-index%} to loop-value-2
- set {CPRB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*} to {_cprb::*}
- set {CPRT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%} to {_now}
- set {CPRN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%} to {_cprn}
- message "&aSKCP:&b半径%arg-2%m内のブロックを%arg-4%巻き戻しました"
- message "&aSKCP:&b修正ブロック数 %{_fixedblocks}% / %size of blocks in radius arg-2 of {_playerlocation}%"
- message "&aSKCP:&b経過時間 %difference between now and {_now}% &7(wait時間%floor({_loopcount} / {@wait}) * 0.05%秒"
- else:
- message "&aSKCP:&c引数が指定されていません!"
- message "&aSKCP:&c必要引数指定内容: 引数1=rollback,引数2=半径,引数3=プレイヤー名,引数4=時間"
- else if arg-1 is "help" or "h":
- message "&aSKCP:&fコマンドリスト"
- message "&aSKCP:&f/coreprotect help: このヘルプを出力します。"
- message "&aSKCP:&f/coreprotect rollback <radius> <user> <timespan>: ロールバックします。"
- message "&aSKCP:&f/coreprotect inspect: 監査モードを切り替えます。"
- message "&aSKCP:&f/coreprotect redo: ロールバックされた場所をロールバック前に戻します"
- message "&aSKCP:&fDeveloped by soramame_256"
- else if arg-1 is "redo" or "rd":
- if arg-4 is set:
- loop all blocks in radius arg-2 of player:
- if {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*} is set:
- loop {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- add 1 to {_loopcount}
- if mod({_loopcount}, {@wait}) is 0:
- wait a tick
- clear {_loop::*}
- # message "Debug:looping {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}"
- set {_loop::*} to split loop-value-2 at " "
- # message "Debug:Splited::%{_loop::*}%"
- set {_time} to {CPRT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # loop {CPRT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- # message "Debug:Timeindex::%loop-index-2%"
- # message "Debug:Time::%{_time}%({CPRT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%})"
- difference between {_now} and {_time} is smaller than arg-4
- # message "Debug:Passed difference"
- set {_player} to {_loop::4}
- if arg-3 is "all":
- set {_player} to arg-3
- "%arg-3%" is {_player}
- # message "Debug:Passed player"
- message "&aSKCP:&b%loop-block's location%を修復しています..."
- set {_event} to {_loop::5}
- if {_event} is "placed":
- set loop-block to {CPRB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # message "Debug:block placed(%{CPRB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}%)"
- {CPBlock::container::*} contain loop-block
- # message "%loop-block% is container"
- wait 1 seconds
- add {CPRN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*} to loop-block's inventory
- # message "Debug:itemadded %{CPRN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*}%"
- if {_event} is "deleted":
- set loop-block to air
- # message "Debug:block deleted"
- clear {CPR::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%loop-index%}
- clear {CPRB::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*}
- clear {CPRT::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- clear {CPRN::%player's world%:%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- add 1 to {_fixedblocks}
- message "&aSKCP:&b半径%arg-2%m内のブロックを%arg-4%巻き返しました"
- message "&aSKCP:&b修正ブロック数 %{_fixedblocks}% / %size of blocks in radius arg-2 of {_playerlocation}%"
- message "&aSKCP:&b経過時間 %difference between now and {_now}% &7(wait時間%floor({_loopcount} / {@wait}) * 0.05%&7秒)"
- else:
- message "&aSKCP:&c引数が指定されていません!"
- message "&aSKCP:&c必要引数指定内容: 引数1=redo,引数2=半径,引数3=プレイヤー名,引数4=時間"
- function nowdate() :: string:
- set {_nowdate1} to "%now%"
- set {_nowdate2::*} to split {_nowdate1} at " "
- replace "," in {_nowdate2::1} with ""
- set {_return} to "%{_nowdate2::1}% %{_nowdate2::2}%%{_nowdate2::3}%"
- return {_return}
- #command /now:
- # trigger:
- # message "%now%"
- #command /variablescheck <text>:
- # permission: skript.add
- # trigger:
- # message "%{%arg-1%}%"
- #command /variabledelete <text>:
- # permission: skript.add
- # trigger:
- # clear {%arg-1%}
- # message "Deleted"
- command /co-resetvariables:
- permission:skript.admin
- trigger:
- # stop #使うならstopの行の一番最初に#つけてね
- clear {CP::*}
- clear {CPR::*}
- clear {CPRT::*}
- clear {CPRB::*}
- clear {CPRN::*}
- clear {CPT::*}
- clear {CPN::*}
- clear {CPB::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement