Behr's Interactive Color Palette Command

Share scripts you wrote for Denizen-Bukkit here!
Post Reply
User avatar
Posts: 4
Joined: January 26th, 2019, 2:39 pm

Behr's Interactive Color Palette Command

Post by bear » September 13th, 2019, 10:20 pm

Do you hate typing color codes? They can be hard to keep track of, especially if you like particularly colorful messages, especially if you need to reapply formats. This script allows you to shift-click the colors you need straight from the chat box to insert them directly into your chat box without erasing the rest of your message or forcing you to look at a reference to verify you have the right color code.

Here's an example of how it works:
Simply type /ccolors and shift-click the colors you want.

Here's the script, in a haste:

As well as right here in the thread:

Code: Select all

    type: command 
    name: ccolors 
    debug: false 
    description: Lists the colors in a click-menu 
    usage: /ccolors 
        - define Colors <list[&0|&1|&2|&3|&4|&5|&6|&7|&8|&9|&a|&b|&c|&d|&e|&f]> 
        - narrate "<&2>+<element[<&a>Shift-Click To Insert].pad_left[28].with[-]><&2>-----+"" 
        - repeat 2: 
            - define Text<[value]> li@ 
            - foreach <[Colors].get[<[value].add[<[value].sub[1].mul[7]>]>].to[<[value].add[<[value].sub[1].mul[8]>].add[7]>]> as:Color: 
                - define Text<[value]> '<[Text<[value]>].include[{"text":"<[Color].parse_color><[Color]>", "hoverEvent":{"action":"show_text","value":"<&a>Shift click to insert"},"insertion":"<[Color]>"},]>' 
            - execute as_op 'tellraw @p ["",<[Text<[value]>].separated_by[{"text":"<&sp><&sp>"},]>""]' 

        - define formats "<List[&k/tacos|&l/Bold|&M/Strike|&r/ Reset|&o/Italic|&n/Underline]>" 
        - repeat 3: 
            - define Text<[value].add[2]> li@ 
            - foreach <[Formats].get[<[value].mul[2].sub[1]>].to[<[value].mul[2]>]> as:Format: 
                - define Text<[value].add[2]> '<[Text<[value].add[2]>].include[{"text":"<&r><[Format].split[/].get[1]> <[Format].replace[/].with[].parse_color><&r>", "hoverEvent":{"action":"show_text","value":"<&a>Shift click to insert"},"insertion":"<[Format].split[/].get[1]>"},]>' 
            - execute as_op 'tellraw @p ["",<[Text<[value].add[2]>].separated_by[{"text":"<&sp><&sp><&sp><&sp>"},]>""]' 
        - narrate "<&8>[<&7>Note<&8>]<&7>: Color before Formats!<&nl><&2>+<element[].pad_left[22].with[-]><&2>-----+"

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest