MisterBasic

Untitled

Feb 18th, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.53 KB | None | 0 0
  1. # titleAPI by Bryce/vexio
  2. # Resource Page: https://forums.skunity.com/resources/206/
  3. options:
  4. debug: false
  5. function title(t: text, in: number, stay: number, out: number, p: text):
  6. set {_t} to coloured {_t}
  7. set {_in} to {_in} * 20
  8. set {_stay} to {_stay} * 20
  9. set {_out} to {_out} * 20
  10. if {_p} = "*" or "@a":
  11. loop all players:
  12. if "%minecraft version%" contains "1.8":
  13. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  14. console command "/title %loop-player% title {text:""%{_t}%""}"
  15. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  16. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  17. console command "/title %loop-player% title {""text"":""%{_t}%""}"
  18. else:
  19. if "%minecraft version%" contains "1.8":
  20. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  21. console command "/title %{_p}% title {text:""%{_t}%""}"
  22. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  23. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  24. console command "/title %{_p}% title {""text"":""%{_t}%""}"
  25. {@debug} = true:
  26. send "&8&o[TitleAPI] &7&o(Sent &7`title` &7&ofunction to &7%{_p}%&7&o)" to all ops
  27. function subtitle(t: text, in: number, stay: number, out: number, p: text):
  28. set {_t} to coloured {_t}
  29. set {_in} to {_in} * 20
  30. set {_stay} to {_stay} * 20
  31. set {_out} to {_out} * 20
  32. if {_p} = "*" or "@a":
  33. loop all players:
  34. if "%minecraft version%" contains "1.8":
  35. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  36. console command "/title %loop-player% subtitle {text:""%{_t}%""}"
  37. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  38. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  39. console command "/title %loop-player% subtitle {""text"":""%{_t}%""}"
  40. else:
  41. if "%minecraft version%" contains "1.8":
  42. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  43. console command "/title %{_p}% subtitle {text:""%{_t}%""}"
  44. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  45. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  46. console command "/title %{_p}% subtitle {""text"":""%{_t}%""}"
  47. {@debug} = true:
  48. send "&8&o[TitleAPI] &7&o(Sent &7`subtitle` &7&ofunction to &7%{_p}%&7&o)" to all ops
  49. function simpleTitle(t: text, in: number, stay: number, out: number, p: text):
  50. set {_t} to coloured {_t}
  51. set {_in} to {_in} * 20
  52. set {_stay} to {_stay} * 20
  53. set {_out} to {_out} * 20
  54. set {_titles::*} to {_t} split at "||"
  55. if {_p} = "*" or "@a":
  56. loop all players:
  57. if "%minecraft version%" contains "1.8":
  58. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  59. console command "/title %loop-player% title {text:""%{_titles::1}%""}"
  60. console command "/title %loop-player% subtitle {text:""%{_titles::2}%""}"
  61. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  62. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  63. console command "/title %loop-player% title {""text"":""%{_titles::1}%""}"
  64. console command "/title %loop-player% subtitle {""text"":""%{_titles::2}%""}"
  65. else:
  66. if "%minecraft version%" contains "1.8":
  67. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  68. console command "/title %{_p}% title {text:""%{_titles::1}%""}"
  69. console command "/title %{_p}% subtitle {text:""%{_titles::2}%""}"
  70. else if "%minecraft version%" contains "1.9", "1.10", "1.11" or "1.12":
  71. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  72. console command "/title %{_p}% title {""text"":""%{_titles::1}%""}"
  73. console command "/title %{_p}% subtitle {""text"":""%{_titles::2}%""}"
  74. {@debug} = true:
  75. send "&8&o[TitleAPI] &7&o(Sent &7`simpleTitle` &7&ofunction to &7%{_p}%&7&o)" to all ops
  76. function actionBar(t: text, in: number, stay: number, out: number, p: text):
  77. set {_t} to coloured {_t}
  78. set {_in} to {_in} * 20
  79. set {_stay} to {_stay} * 20
  80. set {_out} to {_out} * 20
  81. if "%minecraft version%" contains "1.12":
  82. if {_p} = "*" or "@a":
  83. loop all players:
  84. console command "/title %loop-player% times %{_in}% %{_stay}% %{_out}%"
  85. console command "/title %loop-player% actionbar {""text"":""%{_t}%""}"
  86. else:
  87. console command "/title %{_p}% times %{_in}% %{_stay}% %{_out}%"
  88. console command "/title %{_p}% actionbar {""text"":""%{_t}%""}"
  89. {@debug} = true:
  90. send "&8&o[TitleAPI] &7&o(Sent &7`actionBar` &7&ofunction to &7%{_p}%&7&o)" to all ops
  91. else:
  92. send "&4[ERROR]&c The function `actionBar` is not supported in any versions below 1.12" to all ops
  93. #! COMMANDS
  94. #For the lazy bums out there
  95. command /sendTitle [<text>] [<integer>] [<integer>] [<integer>] [<text>]:
  96. permission: command.sendTitle
  97. permission message: &cInvalid permission.
  98. trigger:
  99. if arg 1 is set:
  100. if arg 2 is set:
  101. if arg 3 is set:
  102. if arg 4 is set:
  103. if arg 5 is set:
  104. #send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  105. simpleTitle("%arg-5%", arg-2, arg-3, arg-4, "%arg-1%")
  106. else:
  107. send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  108. else:
  109. send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  110. else:
  111. send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  112. else:
  113. send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  114. else:
  115. send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  116. command /sendActionbar [<text>] [<integer>] [<integer>] [<integer>] [<text>]:
  117. permission: command.sendActionbar
  118. permission message: &cInvalid permission.
  119. trigger:
  120. if arg 1 is set:
  121. if arg 2 is set:
  122. if arg 3 is set:
  123. if arg 4 is set:
  124. if arg 5 is set:
  125. #send "&cUsage: /sendTitle [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  126. actionBar("%arg-5%", arg-2, arg-3, arg-4, "%arg-1%")
  127. else:
  128. send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  129. else:
  130. send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  131. else:
  132. send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  133. else:
  134. send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
  135. else:
  136. send "&cUsage: /sendActionbar [target] [fadeInTime] [stayTime] [fadeOutTime] [message]"
Advertisement
Add Comment
Please, Sign In to add comment