Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #提供: soramamore さん。
- on load:
- broadcast "&aConfig Reloaded."
- 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::%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}% %{_log::4}% %{_log::5}% %{_log::6}%"
- # message "debug:%{CPT::%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}%({CPT::%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::%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::%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::%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::%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}
- set {CPT::%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::%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::%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}% %{_log::4}% %{_log::5}% %{_log::6}%"
- # message "debug:%{CPT::%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::%{_log::1}% %{_log::2}%}%({CPT::%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::%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::%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::%floor(x location of event-location)%,%floor(y location of event-location)%,%floor(z location of event-location)%::*}
- set {CPT::%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
- {CPBlock::container::*} contain loop-block
- set {_loc.%loop-block's location%.container::*} to all items in loop-block's inventory
- wait 1 seconds
- loop all blocks in radius 10 of event-location:
- {_loc.%loop-block's location%} is not loop-block
- set {_id} to random integer between 1 and 999999
- set {CPB::%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::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}
- set {CPT::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%nowdate()%;%{_id}%} to 1 seconds ago
- add {_loc.%loop-block's location%.container::*} to {CPN::%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::%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:
- if arg-1 is "inspect":
- 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":
- if arg-4 is set:
- loop all blocks in radius arg-2 of player:
- if {CP::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*} is set:
- message "&aSKCP:&b%loop-block's location%を修復しています..."
- loop {CP::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- chance of 2%:
- wait 2 ticks
- {CPR::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%loop-index%} is not set
- clear {_loop::*}
- # message "Debug:looping {CP::%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::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # loop {CPT::%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::%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"
- 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::%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::%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::%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::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*}%"
- set {CPR::%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::%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::%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::%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%巻き戻しました"
- else:
- message "&aSKCP:&c引数が指定されていません!"
- message "&aSKCP:&c必要引数指定内容: 引数1=rollback,引数2=半径,引数3=プレイヤー名,引数4=時間"
- else if arg-1 is "help":
- 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: ロールバックされた場所をロールバック前に戻します"
- else if arg-1 is "redo":
- if arg-4 is set:
- loop all blocks in radius arg-2 of player:
- if {CPR::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*} is set:
- message "&aSKCP:&b%loop-block's location%を修復しています..."
- loop {CPR::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::*}:
- chance of 2%:
- wait 2 ticks
- clear {_loop::*}
- # message "Debug:looping {CPR::%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::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- # loop {CPRT::%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::%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"
- set {_event} to {_loop::5}
- if {_event} is "placed":
- set loop-block to {CPRB::%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::%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::%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::%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::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%loop-index%}
- clear {CPRB::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%::*}
- clear {CPRT::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- clear {CPRN::%floor(x location of loop-block)%,%floor(y location of loop-block)%,%floor(z location of loop-block)%::%{_loop::1}% %{_loop::2}%}
- message "&aSKCP:&b半径%arg-2%m内のブロックを%arg-4%巻き返しました"
- else:
- message "&aSKCP:&c引数が指定されていません!"
- message "&aSKCP:&c必要引数指定内容: 引数1=rollback,引数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"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement