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 - define symbols - define linkstart - definemap words: discord: https://is.gd/cdiscord].custom_color[discord]> Orbis: Moraira: Ituria: Projektwelt: Regeln: - foreach as:word: # test if the word is a link (definition used for now with list of linkstarts) - if <[linkstart].filter_tag[<[word].starts_with[<[filter_value]>]>].any>: # if the last letter of the word/link is a symbol - if <[word].to_list.last.contains_any_text[<[symbols]>]>: # save the last letter, flag the server with it, remove the letter from the word # and later readd it via definition (sym). # necessary because without it will also highlight the symbols like ?,! - define sym <[word].to_list.last> - define wordex <[word].to_list.exclude[<[word].to_list.last>].separated_by[]> - define textrpl <[textrpl].replace[<[word]>].with[<[wordex]>].custom_color[link]><[sym]>]> - else: # if the word/link does not end with a symbol, just highlight it as usual - define textrpl <[textrpl].replace[<[word]>].with[<[word]>].custom_color[link]>]> - foreach next # loop through every key in map "words" - foreach <[words].keys> as:replaceable: # if substring (length) of the currently indexed word matches with currently indexed key from words map - if <[word].substring[0,<[replaceable].length>]> == <[replaceable]>: - define textrpl <[textrpl].replace[<[word].substring[0,<[replaceable].length>]>].with[<[words.<[replaceable]>]>]> - foreach stop - define text "<&f><&co> <[textrpl]>"