chat_formatting: type: world debug: true enabled: true events: on player chats flagged:!player.chat.busy: - determine cancelled passively ################## highlight player names, server locations and links # TODO: move this to a task script with data containers - define linkstart - define linkend - define locations - define serverwords - define misc - define symbols - define textrpl # loop through each word of the message and highlight links - foreach as:arg: - if <[linkstart].filter_tag[<[arg].starts_with[<[filter_value]>]>].any> || <[linkend].filter_tag[<[arg].ends_with[<[filter_value]>]>].any>: - define textrpl <[textrpl].replace[<[arg]>].with[<&n><[arg]><&r>]> # filter out symbols like ?,:,! - if <[symbols].filter_tag[<[arg].ends_with[<[filter_value]>]>].any>: - define textrpl <[textrpl].replace[<[arg].to_list.last>].with[<&f><[arg].to_list.last><&r>]> # highlitght predefined locations - if <[locations].filter_tag[<[arg].starts_with[<[filter_value]>]>].any>: - define textrpl <[textrpl].replace[<[arg]>].with[<&c><[arg]><&r>]> # highlight server words - if <[serverwords].filter_tag[<[arg].starts_with[<[filter_value]>]>].any>: - define textrpl <[textrpl].replace[<[arg]>].with[<&color[]><[arg]><&r>]> # higlight player names - foreach ].include[]> as:player: - define name <[player].name> - if <[arg].starts_with[<[name]>]>: - define textrpl <[textrpl].replace[<[arg]>].with[<&a><[name]><&r>]> - if <[player].is_online>: - playsound <[player]> sound:block_bell_use # highlight and replace misc words - if <[misc].filter_tag[<[arg].starts_with[<[filter_value]>]>].any>: - foreach <[misc]> as:misc: - choose <[misc]>: - case Discord: - define textrpl <[textrpl].replace_text[].with[<&color[]>Discord<&co> <&n>https://is.gd/cdiscord<&r>]> - case Regeln: - define textrpl <[textrpl].replace[].with[]><&n>Regeln].on_click[/regeln].on_hover[Klicken, um Regeln aufzurufen]><&r>]> - case Hilfe: - define textrpl <[textrpl].replace[].with[]><&n>Hilfe].on_click[/hilfe].on_hover[Klicken, um Hilfe aufzurufen]><&r>]> - case Support: - define textrpl <[textrpl].replace[].with[]><&n>Support].on_click[/support].on_hover[Klicken, um Support aufzurufen]><&r>]> ################### build the text - define text "<&f><&co> <[textrpl]>"