Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rainbow(input: string, saturation: number = 1, lightness: number = 0.5) :: string:
- set {_l} to 280 / (length of {_input})
- loop (length of {_input}) times:
- set {_r} to "%{_r} ? """"%%rgbToHex(hslToRgb((loop-number * ({_l} if loop-number != 1, else 1)), {_saturation}, {_lightness}))%%subtext of {_input} from indices loop-number to loop-number%"
- return colored {_r}
- function hslToRgb(h: number, s: number, l: number) :: integers: #
- set {_h} to {_h}/360
- if {_s} = 0:
- set {_r}, {_g} and {_b} to {_l}
- else:
- set {_q} to (({_l} * ({_s} + 1)) if {_l} < 0.5, else ({_l} + {_s} - {_l} * {_s}))
- set {_p} to (2 * {_l}) - {_q}
- set {_r} to hueToRgb({_p}, {_q}, {_h} + 1 / 3)
- set {_g} to hueToRgb({_p}, {_q}, {_h})
- set {_b} to hueToRgb({_p}, {_q}, {_h} - 1 / 3)
- return round(min(255, (255 * {_r}))), round(min(255, (255 * {_g}))) and round(min(255, (255 * {_b})))
- function hueToRgb(p: number, q: number, t: number) :: number:
- add 1 to {_t} if {_t} < 0
- remove 1 from {_t} if {_t} > 1
- return {_p} + ({_q} - {_p}) * 6 * {_t} if {_t} < 1 / 6
- return {_q} if {_t} < 1/2
- return {_p} + ({_q} - {_p}) * (2 / 3 - {_t}) * 6 if {_t} < 2 / 3
- return {_p}
- on load:
- set {hex::*} to split "&0|&1|&2|&3|&4|&5|&6|&7|&8|&9|&a|&b|&c|&d|&e|&f" at "|"
- function rgbToHex(values: numbers) :: string:
- loop {_values::*}:
- set {_r} to "%{_r} ? ""&x""%%{hex::%((loop-value - mod(loop-value, 16)) / 16 + 1)%} ? """"%%{hex::%mod(loop-value, 16) + 1%} ? """"%"
- return {_r}
- function gradient(input: string, color-from: integers, color-to: integers) :: string:
- loop {_color-from::*}:
- set {_i::%loop-index%} to round(({_color-to::%loop-index%} - loop-value) / length of {_input})
- loop length of {_input} times:
- set {_r} to "%{_r} ? """"%%rgbToHex({_color-from::*})%%subtext of {_input} from indices loop-number to loop-number%"
- set {_color-from::*} to ({_color-from::1} + {_i::1}), ({_color-from::2} + {_i::2}) and ({_color-from::3} + {_i::3})
- return colored {_r}
- on chat:
- {rainbowchat::%player's uuid%} is true:
- set {_d} to rainbow("%message%", 1, 0.725)
- {silver-goldchat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (179, 220, and 252), (234, 192, and 80))
- {chromechat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (142, 141, and 141), (190, 192, and 194))
- {janluchat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (245, 178, and 44), (82, 84, and 204))
- {nxoichat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (36, 35, and 35), (255, 255, and 255))
- {redchat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (255, 0, and 0), (250, 0, and 0))
- {jackchat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (213, 255, and 46), (147, 36, and 35))
- {zeechat::%player's uuid%} is true:
- set {_d} to gradient("%message%", (255, 255, and 102), (153, 255, and 102))
- {_d} is set
- set chat format to "%player's display name%: %{_d}%"
- on join:
- set {_d} to rainbow("Colors", 1, 0.725)
- set metadata tag "colors" of player to chest inventory with 5 rows named "%{_d}%"
- loop {gradientnames::*}:
- set {_d} to loop-index
- set {_d} to {_d} - 1
- set slot {_d} of metadata tag "colors" of player to any wool named "%loop-value%"
- command /creategradient <integer> <integer> <integer> <integer> <integer> <integer>:
- command /allcolors:
- trigger:
- open metadata tag "colors" of player to player
- command /redchat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to true
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {redchat::%player's uuid%} to false
- else:
- send "Use /redchat <on/off>"
- command /rainbowchat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to true
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {rainbowchat::%player's uuid%} to false
- else:
- send "Use /rainbowchat <on/off>"
- command /silver-goldchat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to true
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {silver-goldchat::%player's uuid%} to false
- else:
- send "Use /silver-goldchat <on/off>"
- command /chromechat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to true
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {chromechat::%player's uuid%} to false
- else:
- send "Use /chromechat <on/off>"
- command /janluchat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to true
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {janluchat::%player's uuid%} to false
- else:
- send "Use /janluchat <on/off>"
- command /nxoichat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to true
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {nxoichat::%player's uuid%} to false
- else:
- send "Use /nxoichat <on/off>"
- command /jackchat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to true
- set {zeechat::%player's uuid%} to false
- else if arg 1 is "off":
- set {jackchat::%player's uuid%} to false
- else:
- send "Use /jackchat <on/off>"
- command /zeechat [<text>]:
- permission: rainbowchat.use
- trigger:
- arg 1 is "on":
- set {redchat::%player's uuid%} to false
- set {rainbowchat::%player's uuid%} to false
- set {silver-goldchat::%player's uuid%} to false
- set {chromechat::%player's uuid%} to false
- set {janluchat::%player's uuid%} to false
- set {nxoichat::%player's uuid%} to false
- set {jackchat::%player's uuid%} to false
- set {zeechat::%player's uuid%} to true
- else if arg 1 is "off":
- set {zeechat::%player's uuid%} to false
- else:
- send "Use /jackchat <on/off>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement