Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # skdocs 1.0
- # by iku55
- #
- # skript 2.3.7以降で動作します
- # skript 2.3.6以下のスクリプトはこちらからダウンロードしてください:https://github.com/iku55/Skhelp/releases/
- options:
- # skdocsのバージョンです。変更しないでください。
- version: 1.0
- # デバッグログを表示するかの設定です。デフォルト:false
- debug_logging: false
- # apiのURLです。デフォルト:http://iku55.starfree.jp/skdocs/api/
- api_url: http://iku55.starfree.jp/skdocs/api/
- on join:
- player is op
- if {skdocs::update::version} is not "{@version}":
- send formatted "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:<url:%{skdocs::update::link}%>%{skdocs::update::link}%<reset>&a)"
- command /skdocs [<text>] [<text>]:
- aliases: /skhelp
- trigger:
- message "&7[&askdocs&7] &f%player%(%uuid of player%)&aがコマンド&f/skdocs %arg-1% %arg-2%&aを実行しました" to console
- if arg-1 is "events":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aイベントリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::events::*}%&a)"
- loop {skdocs::events::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "conditions":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aコンディションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::conditions::*}%&a)"
- loop {skdocs::conditions::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "effects":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aエフェクトリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::effects::*}%&a)"
- loop {skdocs::effects::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "expressions":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aエクスプレッションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::expressions::*}%&a)"
- loop {skdocs::expressions::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "types":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aタイプリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::types::*}%&a)"
- loop {skdocs::types::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "functions":
- if arg-2 is set:
- set {_page} to arg-2 parsed as integer
- else:
- set {_page} to 1
- message "&aファンクションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::functions::*}%&a)"
- loop {skdocs::functions::*}:
- if loop-index is "%{_page}%" or "%{_page} + 1%" or "%{_page} + 2%" or "%{_page} + 3%" or "%{_page} + 4%" or "%{_page} + 5%" or "%{_page} + 6%" or "%{_page} + 7%":
- send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
- send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
- else if arg-1 is "id":
- if arg-2 is set:
- message "&7[&askdocs&7] &aAPIから&f%arg-2%&aの情報を取得しています..."
- # set {_response} to text from "{@api_url}get_element/for-skript/?id=%arg-2%"
- send request to url "{@api_url}get_element/for-skript/?id=%arg-2%"
- set {_response} to last received response's body
- message "&7[&askdocs&7] &a情報を取得しました。"
- set {_responses::*} to {_response} split at "<br>"
- loop {_responses::*}:
- set {_res::*} to loop-value split at "[:]"
- set {_c} to 0
- loop {_res::*}:
- if {_c} is 0:
- message "&a&l%loop-value-2%"
- else:
- set {_resp::*} to loop-value-2 split at "[newline]"
- loop {_resp::*}:
- message loop-value-3
- set {_c} to {_c} + 1
- else:
- message "&c/skdocs id <id>"
- else if arg-1 is "reload":
- if player has permission "skdocs.reload":
- send "&f%script name%.sk&aを再読み込みしています"
- command "/skript:skript reload %script name%"
- send "&aスクリプトを再読み込みしました"
- else:
- send "&c権限&6skdocs.reload&cが必要です"
- else if arg-1 is not set:
- send formatted "&cヘルプ&r:<ttp:クリックで補完><sgt:/skdocs help>&c/skdocs help<reset>"
- else if arg-1 is "help":
- if arg-2 is not set:
- send "&aコマンド一覧"
- send "&aカーソル&fを合わすと説明が見れます &aクリック&fするとコマンドを補完します"
- send formatted "<ttp:&b/skdocs events%nl%&fイベントの一覧を表示します><sgt:/skdocs events>&c/skdocs events<reset>"
- send formatted "<ttp:&b/skdocs conditions%nl%&fコンディションの一覧を表示します><sgt:/skdocs conditions>&c/skdocs conditions<reset>"
- send formatted "<ttp:&b/skdocs effects%nl%&fエフェクトの一覧を表示します><sgt:/skdocs effects>&c/skdocs effects<reset>"
- send formatted "<ttp:&b/skdocs expressions%nl%&fエクスプレッションの一覧を表示します><sgt:/skdocs expressions>&c/skdocs expressions<reset>"
- send formatted "<ttp:&b/skdocs types%nl%&fタイプの一覧を表示します><sgt:/skdocs types>&c/skdocs types<reset>"
- send formatted "<ttp:&b/skdocs functions%nl%&fファンクションの一覧を表示します><sgt:/skdocs functions>&c/skdocs functions<reset>"
- send formatted "<ttp:&b/skdocs id <id>%nl%&f指定したIDの情報を表示します><sgt:/skdocs id >&c/skdocs id <id><reset>"
- send formatted "<ttp:&b/skdocs help [command]%nl%&fコマンドのヘルプを表示します><sgt:/skdocs help >&c/skdocs help [command]<reset>"
- send formatted "<ttp:&b/skdocs reload%nl%&c権限&6skdocs.reload&cが必要です%nl%&fスクリプト(%script name%.sk)を再読み込みします><sgt:/skdocs reload>&c/skdocs reload<reset>"
- else if arg-2 is "events":
- send "&b/skdocs events"
- send "&fイベントの一覧を表示します"
- send formatted "<cmd:/skdocs events>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "conditions":
- send "&b/skdocs conditions"
- send "&fコンディションの一覧を表示します"
- send formatted "<cmd:/skdocs conditions>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "effects":
- send "&b/skdocs effects"
- send "&fエフェクトの一覧を表示します"
- send formatted "<cmd:/skdocs effects>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "expressions":
- send "&b/skdocs expressions"
- send "&fエクスプレッションの一覧を表示します"
- send formatted "<cmd:/skdocs expressions>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "types":
- send "&b/skdocs types"
- send "&fタイプの一覧を表示します"
- send formatted "<cmd:/skdocs types>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "functions":
- send "&b/skdocs functions"
- send "&fファンクションの一覧を表示します"
- send formatted "<cmd:/skdocs functions>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "id":
- send "&b/skdocs id <id>"
- send "&f指定したのIDを表示します"
- send formatted "<sgt:/skdocs id >&aクリックでコマンドを実行<reset>"
- else if arg-2 is "help":
- send "&b/skdocs help [command]"
- send "&fコマンドのヘルプを表示します"
- send formatted "<cmd:/skdocs help>&aクリックでコマンドを実行<reset>"
- else if arg-2 is "reload":
- send "&b/skdocs reload"
- send "&c権限&6skdocs.reload&cが必要です"
- send "&fスクリプト(%script name%.sk)を再読み込みします"
- send formatted "<cmd:/skdocs reload>&aクリックでコマンドを実行<reset>"
- else:
- send "&cコマンドは見つかりませんでした"
- else:
- send "&cコマンドは見つかりませんでした ヘルプ:<ttp:クリックで補完><sgt:/skdocs help>/skdocs help<reset>"
- on script load:
- clear {skdocs::*}
- message "&7[&askdocs&7] &aAPIから情報を取得しています..." to console
- send request to url "{@api_url}skript/"
- set {_response} to last received response's body
- set {_a::*} to {_response} split at "<br>"
- set {_c} to 0
- loop {_a::*}:
- if {_c} is 0:
- set {skdocs::update::version} to loop-value
- else:
- set {skdocs::update::link} to loop-value
- set {_c} to {_c} + 1
- send request to url "{@api_url}get_all/for-skript/"
- set {_response} to last received response's body
- set {_types::*} to {_response} split at "<hr>"
- loop {_types::*}: #loop-value
- set {_res::*} to loop-value split at "<br>"
- loop {_res::*}: #loop-value-2
- set {_a::*} to loop-value-2 split at ":"
- add {_a::2} to {skdocs::%{_a::1}%::*}
- if "{@debug_logging}" is "true":
- message "&7[&askdocs&7] &a%{_a::2}%をskdocs::%{_a::1}%::*に追加しました" to console
- wait 1 tick
- if {skdocs::*} is set:
- message "&7[&askdocs&7] &a情報を取得しました。" to console
- if {skdocs::update::version} is not "{@version}":
- message "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:%{skdocs::update::link}%)" to console
- stop
- else:
- message "&7[&askdocs&7] &c情報の取得に失敗しました。10秒後に再接続します。" to console
- wait 10 seconds
- clear {skdocs::*}
- send request to url "{@api_url}skript/"
- set {_response} to last received response's body
- set {_a::*} to {_response} split at "<br>"
- set {_c} to 0
- loop {_a::*}:
- if {_c} is 0:
- set {skdocs::update::version} to loop-value
- else:
- set {skdocs::update::link} to loop-value
- set {_c} to {_c} + 1
- message "&7[&askdocs&7] &aAPIから情報を取得しています..." to console
- set {_response} to text from "{@api_url}get_all/for-skript/"
- set {_types::*} to {_response} split at "<hr>"
- loop {_types::*}: #loop-value
- set {_res::*} to loop-value split at "<br>"
- loop {_res::*}: #loop-value-2
- #message loop-value-2 to console
- set {_a::*} to loop-value-2 split at ":"
- add {_a::2} to {skdocs::%{_a::1}%::*}
- if "{@debug_logging}" is "true":
- message "&7[&askdocs&7] &a%{_a::2}%をskdocs::%{_a::1}%::*に追加しました" to console
- wait 1 tick
- if {skdocs::*} is set:
- message "&7[&askdocs&7] &a情報を取得しました。" to console
- if {skdocs::update::version} is not "{@version}":
- message "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:%{skdocs::update::link}%)" to console
- else:
- message "&7[&askdocs&7] &c情報の取得に失敗しました。" to console
- message "&7[&askdocs&7] &cAPIのURLが合っていないまたはAPI/サーバー側でエラーが発生している可能性があります。" to console
- message "&7[&askdocs&7] &cエラーログを表示します。改善しない場合はDiscord ik##3078までご報告ください。" to console
- message "&7[&askdocs&7] &cエラー:&6API_RESPONSE_IS_NOTSET" to console
- message "&7[&askdocs&7] &cAPIのURL:&6{@api_url}" to console
- message "&7[&askdocs&7] &c接続したURL:&6{@api_url}get_all/for-skript/" to console
- message "&7[&askdocs&7] &c発生時刻:&6%now%" to console
- message "&7[&askdocs&7] &cサーバーのバージョン:&6%bukkit version%&c(&6MC v.%minecraft version%&c)" to console
- message "&7[&askdocs&7] &cSkriptのバージョン:&6%skript version%" to console
Add Comment
Please, Sign In to add comment