Advertisement
Mirage-Skripter

UniqueCommands

Dec 16th, 2019
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. options:
  2.  
  3. #prefixです。各メッセージの先頭に表示されます。
  4. pre: &7&l[&6Unique&dCommands&7&l]
  5.  
  6. #ユニークコマンドの登録最大数です。自由に変更できます。
  7. cmds: 100
  8.  
  9. command /uniquecommand [<text>] [<text>] [<text>] [<text>]:
  10. permission: mirage.skript.uc
  11. aliases: /uc
  12. trigger:
  13. if arg-1 is not set:
  14. send "{@pre} &caddかremoveかlistを記述してください。"
  15. send "{@pre} &aadd&7が追加 &cremove&7が削除 &dlist&7が一覧確認です。"
  16. else:
  17. if arg-1 is "add":
  18. if arg-2 is not set:
  19. send "{@pre} &c追加するコマンドを記入してください。"
  20. stop
  21. if arg-3 is not set:
  22. send "{@pre} &c実行元を&aplayer&cか&aconsole&cで指定してください。"
  23. stop
  24. if arg-3 is not "player":
  25. if arg-3 is not "console":
  26. send "{@pre} &c実行元を&aplayer&cか&aconsole&cで指定してください。"
  27. stop
  28. if arg-4 is not set:
  29. send "{@pre} &cコマンド&a%arg-2%&cに割り当てるコマンドを指定してください。"
  30. stop
  31. loop {@cmds} times:
  32. if {ucmd::%loop-number%} is not set:
  33. set {_num} to loop-number
  34. exit loop
  35. set {ucmd::%{_num}%} to arg-2
  36. set {ucmd::execute::%{_num}%} to arg-3
  37. set {ucmd::target::%{_num}%} to arg-4
  38. send "{@pre} &aユニークコマンドを追加しました。"
  39. else if arg-1 is "remove":
  40. if arg-2 is not set:
  41. send "{@pre} &cユニークコマンドのIDを指定してください。"
  42. stop
  43. if arg-2 parsed as number is not number:
  44. send "{@pre} &cIDは数字で指定してください。"
  45. stop
  46. if {ucmd::%arg-2 parsed as number%} is set:
  47. send "{@pre} &aユニークコマンド&7%{ucmd::%arg-2%}%&aを&c削除&aしました。"
  48. delete {ucmd::%arg-2%}
  49. delete {ucmd::execute::%arg-2%}
  50. delete {ucmd::target::%arg-2%}
  51. else:
  52. send "{@pre} &cそのIDにはユニークコマンドが割り当てられていません。"
  53. else if arg-1 is "list":
  54. loop {ucmd::*}:
  55. if loop-value is set:
  56. set {_value} to true
  57. if {_value} is not set:
  58. send "{@pre} &c作成済みのユニークコマンドはありません。"
  59. stop
  60. loop {@cmds} times:
  61. if {ucmd::%loop-number%} is set:
  62. send "{@pre} &5ID&d%loop-number% &a%{ucmd::%loop-number%}% &8--- &7%{ucmd::target::%loop-number%}% &8--- &afrom&e:&7%{ucmd::execute::%loop-number%}%"
  63. else:
  64. send "{@pre} &caddかremoveかlistを記述してください。"
  65. send "{@pre} &aadd&7が追加 &cremove&7が削除 &dlist&7が一覧確認です。"
  66.  
  67. on chat:
  68. set {_text} to message
  69. loop {@cmds} times:
  70. if {ucmd::%loop-number%} is {_text}:
  71. set {_num} to loop-number
  72. exit loop
  73. if {_num} is not set:
  74. stop
  75. cancel event
  76. set {_cmd} to {ucmd::target::%{_num}%}
  77. replace all "$player" with player's name in {_cmd}
  78. if {ucmd::execute::%{_num}%} is "player":
  79. execute player command "%{_cmd}%"
  80. else:
  81. execute console command "%{_cmd}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement