miyasoku

【skript】便利そうなやつw

Jan 2nd, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. #内容: 鯖内からpastebinでのconfig編集
  2. #plugins内は編集できるようになっている
  3. #必要plugin: Skript, SkUtilities
  4. #Skript 2.3.6, SkUtilities 0.9.2で動作を確認済
  5. #コマンド達:
  6. # /listfile <フォルダ名>
  7. # フォルダの中身を見る
  8. # 例: /listfile CrackShot/weapons
  9. #
  10. # /createfile <ファイル名>
  11. # ファイルを作る
  12. # 例: /createfile Skript/scripts/EditFile.sk
  13. #
  14. # /deletefile <ファイル名>
  15. # 消す。 最終確認用の認証コードが出ます(ランダムな4桁)
  16. # 例: /deletefile CrackShot/weapons/unBalance.yml
  17. # ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
  18. # /deletefile Skript/scripts/KillNightMoon.sk 5372
  19. #
  20. # /editfile <ファイル名> <pastebin(rawにして)>
  21. # 編集する
  22. # pastebin内の全ての空白は \ (バックスラッシュ)に置き換え
  23. # 全ての改行箇所に <ind> と書いて下さい このように→ https://pastebin.com/WcgivM6t
  24. # 例: /editfile Skript/scripts/EditFile.sk https://pastebin.com/raw/NBSshDGh
  25. #
  26. # 必要な権限は全て sk.file です
  27. # サーバーを所有している人が居なくてもconfig弄れるのが利点です
  28.  
  29. command listfile <text>:
  30. usage: listfile <folder>
  31. permission: sk.file
  32. trigger:
  33. if file "plugins/%arg%" exists:
  34. loop directory "plugins/%arg%"'s files:
  35. send "%loop-value%" to player
  36. else:
  37. send "&7That folder doesn't exists." to player
  38. command createfile <text>:
  39. usage: createfile <file-name>
  40. permission: sk.file
  41. trigger:
  42. if file "plugins/%arg%" exists:
  43. send "That file-name has already used." to player
  44. else:
  45. create file "plugins/%arg%"
  46. send "File ""%arg%"" has just created." to player
  47. command deletefile <text> [<integer>]:
  48. usage: deletefile <file-name> [<pass>]
  49. permission: sk.file
  50. trigger:
  51. if file "plugins/%arg 1%" exists:
  52. if arg 2 is not {delf.pass%player%}:
  53. send "&4Are you sure you want to delete this file?" to player
  54. set {delf.pass%player%} to random integer between 1111 and 9999
  55. send "&7Pass: &6%{delf.pass%player%}%" to player
  56. stop
  57. if arg 2 is {delf.pass%player%}:
  58. delete file "plugins/%arg 1%"
  59. delete {delf.pass%player%}
  60. send "&7File ""plugins/%arg 1%"" has just deleted." to player
  61. else:
  62. send "That file doesn't exist." to player
  63. command editfile <text> <text>:
  64. usage: editfile <file-name> <raw-pastebin>
  65. permission: sk.file
  66. trigger:
  67. if file "plugins/%arg 1%" exists:
  68. if {editingfile} is not set:
  69. set {editingfile} to 1
  70. set file contents of "plugins/%arg 1%" to ""
  71. add text from arg 2 split by "<ind>" to {_l::*}
  72. wait 2 ticks
  73. loop size of {_l::*} times:
  74. if first character of {_l::%loop-number%} is " ":
  75. set {_l::%loop-number%} to subtext of {_l::%loop-number%} from characters 2 to (length of {_l::%loop-number%})
  76. replace every "\" with " " in {_l::*}
  77. wait 2 tick
  78. set {_a} to 0
  79. broadcast "&7File editing. Sorry for lag."
  80. loop size of {_l::*} times:
  81. write "%{_l::%loop-number%}%" at line loop-number to file "plugins/%arg 1%"
  82. add 1 to {_a}
  83. add 1 to {_b}
  84. if {_a} is 10:
  85. wait 2 ticks
  86. remove 10 from {_a}
  87. if {_b} is 100:
  88. add 1 to {_c}
  89. send "&7%{_c} * 100%lines loaded."
  90. remove 100 from {_b}
  91. send "File ""plugins/%arg 1%""'s contents has just set to ""<url:%arg 2%>%arg 2%""" to player
  92. broadcast "&7Finished editing file. Thank you for your cooperation."
  93. delete {editingfile}
  94. if {editingfile} is 1:
  95. send "&7Editing other file now. Please wait."
  96. else:
  97. send "That file doesn't exist." to player
Add Comment
Please, Sign In to add comment