Paste #114918: Unnamed Denizen Script Paste

Date: 2023/09/07 12:38:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


chat_formatting:
  type: world
  debug: false
  enabled: true
  events:
    on player chats flagged:!player.chat.busy:
      - determine cancelled passively
      ################## highlight player names, server locations and links
      - define textrpl <context.message.parse_color>
      - define symbols <list[?|,|:|;|!|.]>
      - definemap words:
          discord: "<&color[#5865F2]>Discord<&co> <&n>https://is.gd/cdiscord<&r>"
          Orbis:  <&c>Orbis<&r>
          Moraira:  <&c>Orbis<&r>
          Ituria: <&c>Orbis<&r>
      - foreach <context.message.split> as:word:
        - foreach <[words].keys> as:replaceable:
          - if <[word].substring[0,<[replaceable].length>]> == <[replaceable]>:
            - define textrpl <[textrpl].replace[<[word].substring[0,<[replaceable].length>]>].with[<[words.<[replaceable]>]>]>
            - if <[symbols].filter_tag[<[word].ends_with[<[filter_value]>]>].any>:
              - define textrpl <[textrpl].replace[<[word].to_list.last>].with[<&f><[word].to_list.last><&r>]>
            - foreach stop
      - define text "<player.proc[player_name_format]><&f><&co> <[textrpl]>"