Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getPeriodFromSeconds(arg: integer) :: string:
- set {_days} to floor({_arg}/86400)
- set {_seconds} to {_arg}-86400*{_days}
- set {_hours} to floor({_seconds}/3600)
- set {_seconds} to {_seconds}-3600*{_hours}
- set {_minutes} to floor({_seconds}/60)
- set {_seconds} to {_seconds}-60*{_minutes}
- set {_timetext} to "%{_days}%日 %{_hours}%時間 %{_minutes}%分 %{_seconds}%秒"
- return {_timetext}
- command /mute [<offline player>] [<text>] [<text>] [<text>] [<text>] [<text>]:
- permission: sk.command.mute
- permission message: &4このコマンドを実行する権限がありません!
- trigger:
- if arg-1 is not set:
- send "&cUsage: /mute <player> never OR /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-1 has not played before:
- send "&cプレイヤー%arg-1%はログインしたことがありません!"
- else if {mute::%UUID of arg-1%} is 1:
- send "&c%arg-1%は既にミュートされています!"
- else if arg-2 is not set:
- send "&cUsage: /mute <player> never OR /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-2 is not "never" or "temply":
- send "&cUsage: /mute <player> never OR /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-2 is "never":
- set {mute::%UUID of arg-1%} to 1
- set {mutedplayername.%UUID of arg-1%} to "%arg-1%"
- broadcast "&6%player%&eが&6%arg-1%&eをミュートしました%nl%&e期限: &7無期限"
- else if arg-2 is "temply":
- if arg-3 is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-4 is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-5 is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if arg-6 is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else:
- set {_days} to arg-3 parsed as integer
- set {_hours} to arg-4 parsed as integer
- set {_minutes} to arg-5 parsed as integer
- set {_seconds} to arg-6 parsed as integer
- set {_total} to {_days}*86400+{_hours}*3600+{_minutes}*60+{_seconds}
- if {_days} is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if {_hours} is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if {_minutes} is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if {_seconds} is not set:
- send "&cUsage: /mute <player> temply <days> <hours> <minutes> <seconds>"
- else if {_days} > 9999:
- send "&c入力した数値(%arg-3%)は大きすぎます! 9999以下にしてください"
- else if {_hours} > 23:
- send "&c入力した数値(%arg-4%)は大きすぎます! 23以下にしてください"
- else if {_minutes} > 59:
- send "&c入力した数値(%arg-5%)は大きすぎます! 59以下にしてください"
- else if {_seconds} > 59:
- send "&c入力した数値(%arg-6%)は大きすぎます! 59以下にしてください"
- else if {_days} < 0:
- send "&c入力した数値(%arg-3%)は小さすぎます! 0以上にしてください"
- else if {_hours} < 0:
- send "&c入力した数値(%arg-4%)は小さすぎます! 0以上にしてください"
- else if {_minutes} < 0:
- send "&c入力した数値(%arg-5%)は小さすぎます! 0以上にしてください"
- else if {_total} is 0:
- send "&c入力した数値(%arg-6%)は小さすぎます! 1以上にしてください"
- else if {_total} > 0:
- {_seconds} < 0
- send "&c入力した数値(%arg-6%)は小さすぎます! 0以上にしてください"
- set {mute::%UUID of arg-1%} to 1
- set {mutedplayername.%UUID of arg-1%} to "%arg-1%"
- set {unmutetime.%UUID of arg-1%} to floor(unix timestamp of now)+{_days}*86400+{_hours}*3600+{_minutes}*60+{_seconds}
- set {_muteperiod} to "%{unmutetime.%UUID of arg-1%}-floor(unix timestamp of now)%" parsed as integer
- broadcast "&6%player%&eが&6%arg-1%&eをミュートしました%nl%&e期限: &7%getPeriodFromSeconds({_muteperiod})%"
- command /unmute [<offline player>] [<text>]:
- permission: sk.command.mute
- permission message: &4このコマンドを実行する権限がありません!
- trigger:
- if arg-2 is set:
- send "&cUsage: /unmute <player>"
- else if arg-1 is not set:
- send "&cUsage: /unmute <player>"
- else if arg-1 is set:
- if {mute::%UUID of arg-1%} is not set:
- send "&c%arg-1%はミュートされていません!"
- else if {mute::%UUID of arg-1%} is 1:
- delete {mute::%UUID of arg-1%}
- delete {unmutetime.%UUID of arg-1%}
- delete {mutedplayername.%UUID of arg-1%}
- send "&6%arg-1%&eのミュートを解除しました"
- command /mutelist:
- permission: sk.command.mute
- permission message: &4このコマンドを実行する権限がありません!
- trigger:
- if {mute::*} is not set:
- send "&cミュートされているプレイヤーはいません"
- else if {mute::*} is set:
- loop {mute::*}:
- if {unmutetime.%loop-index%} is set:
- set {_muteperiod} to "%{unmutetime.%loop-index%}-floor(unix timestamp of now)%" parsed as integer
- send "&eプレイヤー: &7%{mutedplayername.%loop-index%}% &eUUID: &7%loop-index% &e期限: &7%getPeriodFromSeconds({_muteperiod})%"
- else if {unmutetime.%loop-index%} is not set:
- send "&eプレイヤー: &7%{mutedplayername.%loop-index%}% &eUUID: &7%loop-index% &e期限: &7無期限"
- on command:
- {mute::%UUID of player%} is 1
- command is "say" or "me" or "m" or "message" or "msg" or "r" or "reply" or "t" or "tell" or "w" or "lunachat:m" or "lunachat:message" or "lunachat:msg" or "lunachat:r" or "lunachat:reply" or "lunachat:t" or "lunachat:tell" or "lunachat:w" or "minecraft:msg" or "minecraft:tell" or "minecraft:w"
- cancel event
- if {unmutetime.%UUID of player%} is set:
- set {_muteperiod} to "%{unmutetime.%UUID of player%}-floor(unix timestamp of now)%" parsed as integer
- send "&cあなたはミュートされています!%nl%&c期限: &7%getPeriodFromSeconds({_muteperiod})%"
- else if {unmutetime.%UUID of player%} is not set:
- send "&cあなたはミュートされています!%nl%&c期限: &7無期限"
- on packet recieve:
- event-string is "PacketPlayInChat"
- set {_msg} to packet field "a"
- first 1 characters of {_msg} is not "/"
- {mute::%UUID of player%} is 1
- cancel event
- if {unmutetime.%UUID of player%} is set:
- set {_muteperiod} to "%{unmutetime.%UUID of player%}-floor(unix timestamp of now)%" parsed as integer
- send "&cあなたはミュートされています!%nl%&c期限: &7%getPeriodFromSeconds({_muteperiod})%"
- else if {unmutetime.%UUID of player%} is not set:
- send "&cあなたはミュートされています!%nl%&c期限: &7無期限"
- every second:
- loop {mute::*}:
- {unmutetime.%loop-index%} <= floor(unix timestamp of now)
- send "&eあなたのミュートが解除されました" to {mutedplayername.%loop-index%} parsed as player
- if {mutedplayername.%loop-index%} parsed as offline player is not online:
- set {unmutemessageflag.%loop-index%} to 1
- delete {mute::%loop-index%}
- delete {unmutetime.%loop-index%}
- delete {mutedplayername.%loop-index%}
- on join:
- if {unmutemessageflag.%UUID of player%} is 1:
- send "&eあなたのミュートが解除されました"
- delete {unmutemessageflag.%UUID of player%}
- on connect:
- {mute::%UUID of player%} is set
- {mutedplayername.%UUID of player%} is not "%player%"
- set {mutedplayername.%UUID of player%} to "%player%"
- on tab complete:
- set {_splits::*} to split event-string by " "
- if {_splits::1} is "/mute":
- if size of {_splits::*} is 3:
- delete completions
- add "never" and "temply" to completions
- if first 1 characters of {_splits::3} is "t":
- delete completions
- add "temply" to completions
- if first 1 characters of {_splits::3} is "n":
- delete completions
- add "never" to completions
- else if size of {_splits::*} > 3:
- cancel event
- if {_splits::1} is "/unmute":
- size of {_splits::*} > 2
- cancel event
- if {_splits::1} is "/mutelist":
- size of {_splits::*} > 1
- cancel event
Add Comment
Please, Sign In to add comment