Paste #73270: Untitled Paste

Date: 2020/07/28 03:31:43 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Chat Formatter:
    type: world
    debug: false
    events:
        on player joins:
        - flag <player> channel:default
        - if <player.has_permission[novachat.staffc]> == true:
            - flag <player> staffchat:allow
        on player chats:
        - determine passively cancelled
        - choose <player.flag[channel]>:
            - case trade:
                - narrate "<&5>Trade <&d>» <&d><player.name> <&7>» <&d><context.message>" targets:<server.online_players>
                - announce to_console "<&5>Trade <&d>» <&d><player.name> <&7>» <&d><context.message>"
            - case towny:
                - narrate "<&c>Boop!"
            - case nation:
                - narrate "<&b>Boop!"
            - case staff:
                - narrate "<&e><&a>Staff Chat<&e> » <&f><player.name> <&e>» <&a><context.message>" targets:<server.online_players_flagged[staffchat].filter[flag[staffchat].is[==].to[allow]]>
            - case default:
                - narrate "<Player.chat_prefix.parse_color><player.name><Player.chat_suffix.parse_color> » <context.message>" targets:<server.online_players>
                - announce to_console "<Player.chat_prefix.parse_color><player.name><Player.chat_suffix.parse_color> » <context.message>"
        on player quits:
        - flag <player> channel:!


# <server.online_players_flagged[channel].filter[flag[channel].is[==].to[trade]]> # Old Channel checker, may use in the future.


Change_Channel:
    type: command
    name: channel
    description: Changes your current chat channel.
    usage: /channel <&lt>channel<&gt>
    aliases:
    - ch
    script:

# Picks an argument and runs the code for that argument. "Choose an argument and if the case is x then do x.y"
        - choose <context.args.get[1]||None>:
            - case trade tr:
                - flag <player> channel:trade
                - narrate "Channel switched to <&5>Trade"

            - case towny t:
                - narrate "<&c>Sorry, this command is currently disabled."

            - case nation n:
                - narrate "<&c>Sorry, this command is currently disabled."

            - case staff sc s:
                - flag <player> channel:staff
                - narrate "Channel switched to <&e>Staff"
            - case global general g:
                - flag <player> channel:default
                - narrate "Channel switched to <&a>General"
            - default:
                - narrate "<&c>Channel not found! Available channels are<&nl><&a>Global<&c>, <&5>Trade<&c>, <&6>Town<&c>, and <&b>Nation<&c>."

whisper:
    type: command
    name: whisper
    debug: false
    description:
    usage:
    aliases:
    - w
    - pm
    - wh
    - dm
    - msg
    allowed help:
    script:
    - if !<server.online_players.contains[<server.match_player[<context.args.get[1]>]>]>:
        - narrate '<&c>You need to specify a person!'
    - narrate '<&7>From: <&a><player.name> <&7>»<&f><context.raw_args.after[<context.args.get[1]>]>' targets:<server.match_player[<context.args.get[1]>]>


# v--v-- Staff Commands --v--v #
Pause Chat:
    type: command
    name: pausechat
    description: Stops players from chatting
    usage: /pausechat
    aliases:
    - pc
    - chatpause
    - pause
    - silence
    script:
    - narrate "<&c>This command is currently disabled or you do not have permission."