Behr's Interactive Color Palette Command

Scripts that are ready to be just dropped-in and used! Exclusively high-quality scripts selected by the Denizen team.
Post Reply
User avatar
bear
Regular
Regular
Posts: 12
Joined: January 26th, 2019, 2:39 pm

Behr's Interactive Color Palette Command

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

Last Edited: 2020-05-13
Just implemented the new tags:
<&hover[HoverText]>/<&end_hover> | Returns a special chat code that makes the following text display the input hover text when the mouse is left over it!
<&insertion[InsertText]>/<&end_insertion> | Returns a special chat code that makes the following text insert the input message to chat when shift-clicked!

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: https://streamable.com/mvoll
Simply type /ccolors and shift-click the colors you want.

Here's the latest script, in a haste:
https://one.denizenscript.com/haste/68947

As well as right here in the thread:
Spoiler!

Code: Select all

CColors_Command:
    type: command
    name: ccolors
    debug: false
    description: Lists the colors in a click-menu
    usage: /ccolors
    script:
        #@ Verify args
        - if <context.args.size> != 0:
            - narrate "<&c>Invalid usage! Just type<&2>: <&6>/<&e>ccolors"
            - stop

        #@ Create color lists
        - define Colors <list[&0|&1|&2|&3|&4|&5|&6|&7|&8|&9|&a|&b|&c|&d|&e|&f]>
        - foreach <list[1|2]> as:Line:
            - define Math1 <[Loop_Index].add[<[Loop_Index].sub[1].mul[7]>]>
            - define Math2 <[Loop_Index].add[<[Loop_Index].sub[1].mul[8]>].add[7]>
            - foreach <[Colors].get[<[Math1]>].to[<[Math2]>]> as:Color:
                - define Hover "<&a>Shift<&2>-<&a>Click to Insert<&2>:<&nl><[Color].parse_color>This Color!"
                - define Text <[Color].parse_color><[Color]>
                - define Insert <[Color]>
                - define Key<[Loop_Index]> <&hover[<[Hover]>]><&insertion[<[Insert]>]><[Text]><&end_insertion><&end_hover>
                - define List<[Line]>:->:<[Key<[Loop_Index]>]>

        #@ Create format lists
        - define formats "<List[&k/tacos|&l/Bold|&M/Strike|&r/ Reset|&o/Italic|&n/Underline]>"
        - foreach <list[3|4|5]> as:line:
            - define Math1 <[Loop_Index].mul[2].sub[1]>
            - define Math2 <[Loop_Index].mul[2]>
            - foreach <[Formats].get[<[Math1]>].to[<[Math2]>]> as:Format:
                - define Hover "<&a>Shift<&2>-<&a>Click to Insert<&2>:<&nl><&e><[Format].before[/].parse_color><[Format].after[/]>!"
                - define Text <[Format].before[/].parse_color><[Format].after[/]><&sp><&sp><&sp>
                - define Insert <[Format].before[/]>
                - define Key<[Loop_Index]> <&hover[<[Hover]>]><&insertion[<[Insert]>]><[Text]><&end_insertion><&end_hover>
                - define List<[Line]>:->:<[Key<[Loop_Index]>]>

        #@ Narrate
        - narrate "<&2>+<element[<&a>Shift-Click To Insert].pad_left[28].with[-]><&2>-----+"
        - repeat 5:
            - narrate <&sp><&sp><[List<[Value]>].separated_by[<&sp><&sp>]>
        - narrate "<&8>[<&7>Note<&8>]<&7>: Color before Formats!<&nl><&2>+<element[].pad_left[22].with[-]><&2>-----+"
Last edited by bear on May 13th, 2020, 9:09 am, edited 3 times in total.

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 267
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Behr's Interactive Color Palette Command

Post by mcmonkey » November 24th, 2019, 1:32 am

You should update this to the new formatted text systems in Denizen! :D
Denizen lead developer. On Discord as mcmonkey#6666.

User avatar
bear
Regular
Regular
Posts: 12
Joined: January 26th, 2019, 2:39 pm

Re: Behr's Interactive Color Palette Command

Post by bear » March 25th, 2020, 6:05 pm

mcmonkey wrote:
November 24th, 2019, 1:32 am
You should update this to the new formatted text systems in Denizen! :D
Thanks! I've updated it, and even threw in some extra pizzazz on the hover text messages, showing the color in a better example than just the character-code :}

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 267
Joined: August 5th, 2016, 7:27 pm
Location: Los Angeles, California, USA
Contact:

Re: Behr's Interactive Color Palette Command

Post by mcmonkey » May 12th, 2020, 10:26 pm

Bot check: Image
Denizen lead developer. On Discord as mcmonkey#6666.

User avatar
bear
Regular
Regular
Posts: 12
Joined: January 26th, 2019, 2:39 pm

Re: Behr's Interactive Color Palette Command

Post by bear » May 13th, 2020, 9:10 am

mcmonkey wrote:
May 12th, 2020, 10:26 pm
Bot check:
Updated and removed those pointless quotes - thanks monkey!

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests