iku55

skdocs 1.0 2.3.7~

Apr 29th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.36 KB | None | 0 0
  1. # skdocs 1.0
  2. # by iku55
  3. #
  4. # skript 2.3.7以降で動作します
  5. # skript 2.3.6以下のスクリプトはこちらからダウンロードしてください:https://github.com/iku55/Skhelp/releases/
  6. options:
  7. # skdocsのバージョンです。変更しないでください。
  8. version: 1.0
  9. # デバッグログを表示するかの設定です。デフォルト:false
  10. debug_logging: false
  11. # apiのURLです。デフォルト:http://iku55.starfree.jp/skdocs/api/
  12. api_url: http://iku55.starfree.jp/skdocs/api/
  13. on join:
  14. player is op
  15. if {skdocs::update::version} is not "{@version}":
  16. send formatted "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:<url:%{skdocs::update::link}%>%{skdocs::update::link}%<reset>&a)"
  17. command /skdocs [<text>] [<text>]:
  18. aliases: /skhelp
  19. trigger:
  20. message "&7[&askdocs&7] &f%player%(%uuid of player%)&aがコマンド&f/skdocs %arg-1% %arg-2%&aを実行しました" to console
  21. if arg-1 is "events":
  22. if arg-2 is set:
  23. set {_page} to arg-2 parsed as integer
  24. else:
  25. set {_page} to 1
  26. message "&aイベントリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::events::*}%&a)"
  27. loop {skdocs::events::*}:
  28. 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%":
  29. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  30. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  31. else if arg-1 is "conditions":
  32. if arg-2 is set:
  33. set {_page} to arg-2 parsed as integer
  34. else:
  35. set {_page} to 1
  36. message "&aコンディションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::conditions::*}%&a)"
  37. loop {skdocs::conditions::*}:
  38. 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%":
  39. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  40. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  41. else if arg-1 is "effects":
  42. if arg-2 is set:
  43. set {_page} to arg-2 parsed as integer
  44. else:
  45. set {_page} to 1
  46. message "&aエフェクトリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::effects::*}%&a)"
  47. loop {skdocs::effects::*}:
  48. 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%":
  49. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  50. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  51. else if arg-1 is "expressions":
  52. if arg-2 is set:
  53. set {_page} to arg-2 parsed as integer
  54. else:
  55. set {_page} to 1
  56. message "&aエクスプレッションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::expressions::*}%&a)"
  57. loop {skdocs::expressions::*}:
  58. 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%":
  59. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  60. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  61. else if arg-1 is "types":
  62. if arg-2 is set:
  63. set {_page} to arg-2 parsed as integer
  64. else:
  65. set {_page} to 1
  66. message "&aタイプリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::types::*}%&a)"
  67. loop {skdocs::types::*}:
  68. 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%":
  69. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  70. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  71. else if arg-1 is "functions":
  72. if arg-2 is set:
  73. set {_page} to arg-2 parsed as integer
  74. else:
  75. set {_page} to 1
  76. message "&aファンクションリスト(&f%{_page}%&a-&f%{_page} + 7%&a/&f%amount of {skdocs::functions::*}%&a)"
  77. loop {skdocs::functions::*}:
  78. 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%":
  79. send formatted "<ttp:%loop-value%><cmd:/skdocs id %loop-value%>%loop-value%<reset>"
  80. send formatted "<ttp:前のページ><cmd:/skdocs %arg-1% %{_page} - 8%>&6<--<reset> <ttp:次のページ><cmd:/skdocs %arg-1% %{_page} + 8%>&6--><reset>"
  81. else if arg-1 is "id":
  82. if arg-2 is set:
  83. message "&7[&askdocs&7] &aAPIから&f%arg-2%&aの情報を取得しています..."
  84. # set {_response} to text from "{@api_url}get_element/for-skript/?id=%arg-2%"
  85. send request to url "{@api_url}get_element/for-skript/?id=%arg-2%"
  86. set {_response} to last received response's body
  87. message "&7[&askdocs&7] &a情報を取得しました。"
  88. set {_responses::*} to {_response} split at "<br>"
  89. loop {_responses::*}:
  90. set {_res::*} to loop-value split at "[:]"
  91. set {_c} to 0
  92. loop {_res::*}:
  93. if {_c} is 0:
  94. message "&a&l%loop-value-2%"
  95. else:
  96. set {_resp::*} to loop-value-2 split at "[newline]"
  97. loop {_resp::*}:
  98. message loop-value-3
  99. set {_c} to {_c} + 1
  100. else:
  101. message "&c/skdocs id <id>"
  102. else if arg-1 is "reload":
  103. if player has permission "skdocs.reload":
  104. send "&f%script name%.sk&aを再読み込みしています"
  105. command "/skript:skript reload %script name%"
  106. send "&aスクリプトを再読み込みしました"
  107. else:
  108. send "&c権限&6skdocs.reload&cが必要です"
  109. else if arg-1 is not set:
  110. send formatted "&cヘルプ&r:<ttp:クリックで補完><sgt:/skdocs help>&c/skdocs help<reset>"
  111. else if arg-1 is "help":
  112. if arg-2 is not set:
  113. send "&aコマンド一覧"
  114. send "&aカーソル&fを合わすと説明が見れます &aクリック&fするとコマンドを補完します"
  115. send formatted "<ttp:&b/skdocs events%nl%&fイベントの一覧を表示します><sgt:/skdocs events>&c/skdocs events<reset>"
  116. send formatted "<ttp:&b/skdocs conditions%nl%&fコンディションの一覧を表示します><sgt:/skdocs conditions>&c/skdocs conditions<reset>"
  117. send formatted "<ttp:&b/skdocs effects%nl%&fエフェクトの一覧を表示します><sgt:/skdocs effects>&c/skdocs effects<reset>"
  118. send formatted "<ttp:&b/skdocs expressions%nl%&fエクスプレッションの一覧を表示します><sgt:/skdocs expressions>&c/skdocs expressions<reset>"
  119. send formatted "<ttp:&b/skdocs types%nl%&fタイプの一覧を表示します><sgt:/skdocs types>&c/skdocs types<reset>"
  120. send formatted "<ttp:&b/skdocs functions%nl%&fファンクションの一覧を表示します><sgt:/skdocs functions>&c/skdocs functions<reset>"
  121. send formatted "<ttp:&b/skdocs id <id>%nl%&f指定したIDの情報を表示します><sgt:/skdocs id >&c/skdocs id <id><reset>"
  122. send formatted "<ttp:&b/skdocs help [command]%nl%&fコマンドのヘルプを表示します><sgt:/skdocs help >&c/skdocs help [command]<reset>"
  123. send formatted "<ttp:&b/skdocs reload%nl%&c権限&6skdocs.reload&cが必要です%nl%&fスクリプト(%script name%.sk)を再読み込みします><sgt:/skdocs reload>&c/skdocs reload<reset>"
  124. else if arg-2 is "events":
  125. send "&b/skdocs events"
  126. send "&fイベントの一覧を表示します"
  127. send formatted "<cmd:/skdocs events>&aクリックでコマンドを実行<reset>"
  128. else if arg-2 is "conditions":
  129. send "&b/skdocs conditions"
  130. send "&fコンディションの一覧を表示します"
  131. send formatted "<cmd:/skdocs conditions>&aクリックでコマンドを実行<reset>"
  132. else if arg-2 is "effects":
  133. send "&b/skdocs effects"
  134. send "&fエフェクトの一覧を表示します"
  135. send formatted "<cmd:/skdocs effects>&aクリックでコマンドを実行<reset>"
  136. else if arg-2 is "expressions":
  137. send "&b/skdocs expressions"
  138. send "&fエクスプレッションの一覧を表示します"
  139. send formatted "<cmd:/skdocs expressions>&aクリックでコマンドを実行<reset>"
  140. else if arg-2 is "types":
  141. send "&b/skdocs types"
  142. send "&fタイプの一覧を表示します"
  143. send formatted "<cmd:/skdocs types>&aクリックでコマンドを実行<reset>"
  144. else if arg-2 is "functions":
  145. send "&b/skdocs functions"
  146. send "&fファンクションの一覧を表示します"
  147. send formatted "<cmd:/skdocs functions>&aクリックでコマンドを実行<reset>"
  148. else if arg-2 is "id":
  149. send "&b/skdocs id <id>"
  150. send "&f指定したのIDを表示します"
  151. send formatted "<sgt:/skdocs id >&aクリックでコマンドを実行<reset>"
  152. else if arg-2 is "help":
  153. send "&b/skdocs help [command]"
  154. send "&fコマンドのヘルプを表示します"
  155. send formatted "<cmd:/skdocs help>&aクリックでコマンドを実行<reset>"
  156. else if arg-2 is "reload":
  157. send "&b/skdocs reload"
  158. send "&c権限&6skdocs.reload&cが必要です"
  159. send "&fスクリプト(%script name%.sk)を再読み込みします"
  160. send formatted "<cmd:/skdocs reload>&aクリックでコマンドを実行<reset>"
  161. else:
  162. send "&cコマンドは見つかりませんでした"
  163. else:
  164. send "&cコマンドは見つかりませんでした ヘルプ:<ttp:クリックで補完><sgt:/skdocs help>/skdocs help<reset>"
  165. on script load:
  166. clear {skdocs::*}
  167. message "&7[&askdocs&7] &aAPIから情報を取得しています..." to console
  168. send request to url "{@api_url}skript/"
  169. set {_response} to last received response's body
  170. set {_a::*} to {_response} split at "<br>"
  171. set {_c} to 0
  172. loop {_a::*}:
  173. if {_c} is 0:
  174. set {skdocs::update::version} to loop-value
  175. else:
  176. set {skdocs::update::link} to loop-value
  177. set {_c} to {_c} + 1
  178.  
  179. send request to url "{@api_url}get_all/for-skript/"
  180. set {_response} to last received response's body
  181. set {_types::*} to {_response} split at "<hr>"
  182. loop {_types::*}: #loop-value
  183. set {_res::*} to loop-value split at "<br>"
  184. loop {_res::*}: #loop-value-2
  185. set {_a::*} to loop-value-2 split at ":"
  186. add {_a::2} to {skdocs::%{_a::1}%::*}
  187. if "{@debug_logging}" is "true":
  188. message "&7[&askdocs&7] &a%{_a::2}%をskdocs::%{_a::1}%::*に追加しました" to console
  189. wait 1 tick
  190. if {skdocs::*} is set:
  191. message "&7[&askdocs&7] &a情報を取得しました。" to console
  192. if {skdocs::update::version} is not "{@version}":
  193. message "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:%{skdocs::update::link}%)" to console
  194.  
  195. stop
  196. else:
  197. message "&7[&askdocs&7] &c情報の取得に失敗しました。10秒後に再接続します。" to console
  198.  
  199. wait 10 seconds
  200.  
  201. clear {skdocs::*}
  202. send request to url "{@api_url}skript/"
  203. set {_response} to last received response's body
  204. set {_a::*} to {_response} split at "<br>"
  205. set {_c} to 0
  206. loop {_a::*}:
  207. if {_c} is 0:
  208. set {skdocs::update::version} to loop-value
  209. else:
  210. set {skdocs::update::link} to loop-value
  211. set {_c} to {_c} + 1
  212.  
  213. message "&7[&askdocs&7] &aAPIから情報を取得しています..." to console
  214. set {_response} to text from "{@api_url}get_all/for-skript/"
  215. set {_types::*} to {_response} split at "<hr>"
  216. loop {_types::*}: #loop-value
  217. set {_res::*} to loop-value split at "<br>"
  218. loop {_res::*}: #loop-value-2
  219. #message loop-value-2 to console
  220. set {_a::*} to loop-value-2 split at ":"
  221. add {_a::2} to {skdocs::%{_a::1}%::*}
  222. if "{@debug_logging}" is "true":
  223. message "&7[&askdocs&7] &a%{_a::2}%をskdocs::%{_a::1}%::*に追加しました" to console
  224. wait 1 tick
  225. if {skdocs::*} is set:
  226. message "&7[&askdocs&7] &a情報を取得しました。" to console
  227. if {skdocs::update::version} is not "{@version}":
  228. message "&7[&askdocs&7] &a新しいバージョン%{skdocs::update::version}%があります!(リンク:%{skdocs::update::link}%)" to console
  229. else:
  230. message "&7[&askdocs&7] &c情報の取得に失敗しました。" to console
  231. message "&7[&askdocs&7] &cAPIのURLが合っていないまたはAPI/サーバー側でエラーが発生している可能性があります。" to console
  232. message "&7[&askdocs&7] &cエラーログを表示します。改善しない場合はDiscord ik##3078までご報告ください。" to console
  233. message "&7[&askdocs&7] &cエラー:&6API_RESPONSE_IS_NOTSET" to console
  234.  
  235. message "&7[&askdocs&7] &cAPIのURL:&6{@api_url}" to console
  236. message "&7[&askdocs&7] &c接続したURL:&6{@api_url}get_all/for-skript/" to console
  237. message "&7[&askdocs&7] &c発生時刻:&6%now%" to console
  238. message "&7[&askdocs&7] &cサーバーのバージョン:&6%bukkit version%&c(&6MC v.%minecraft version%&c)" to console
  239. message "&7[&askdocs&7] &cSkriptのバージョン:&6%skript version%" to console
Add Comment
Please, Sign In to add comment