Paste #72403: Untitled Paste

Date: 2020/07/17 23:06:14 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


channel:
  type: world
  events:
    on server start:
    - if !<yaml[channel].list_keys[]||null> == null:
      - yaml create id:channel
      - yaml id:channel set general:->:general
    - yaml load:channel.yml id:channel
    on player chats:
    - determine passively cancelled
    - narrate <green><player.name>:<aqua><context.message> targets:<server.flag[<player.flag[channel]>]>
    on player joins:
    - if !<player.has_flag[channelpermission]>:
      - flag <player> channelpermission:general
    - flag <player> channel:general
    - flag server <player.flag[channel]>:->:<player>
    on player quits:
    - flag server <player.flag[channel]>:<-:<player>
    on channel_select command:
    - flag server <player.flag[channel]>:<-:<player>
    - flag <player> channel:<context.args.get[1]>
    - flag server <player.flag[channel]>:->:<player>
    - narrate "<green>joined:<aqua><context.args.get[1]> <green>channel"
    - determine fulfilled
change_channel:
  type: command
  name: channel
  debug: true
  description:
  usage:
  allowed help: false
  script:
  - foreach <player.flag[channelpermission]> as:perms:
    - foreach <yaml[channel].read[<[perms]>]> as:channels:
      - narrate "<element[<blue>click here:<green><[channels]>].on_click[/channel_select <[channels]>]>"
      - wait 10t
create_channel:
  type: command
  name: create_channel
  debug: true
  description:
  usage:
  allowed help:
  - if <player.is_op>:
    - narrate "args as follows /create_channel level_of_permission channel_name"
  script:
  - if <player.is_op>:
    - if !<yaml[channel].list_keys[]||null> == null:
      - yaml create id:channel
    - yaml id:channel set <context.args.get[2]>:->:<context.args.get[1]>
    - yaml savefile:channel.yml id:channel
channel_perm:
  type: command
  name: channel_perm
  debug: false
  description:
  usage:
  allowed help:
  script:
  - if <player.is_op>:
    - flag  <server.match_player[<context.args.get[1]>]> channelpermission:->:<context.args.get[2]>
whisper:
  type: command
  name: whisper
  debug: false
  description:
  usage:
  allowed help:
  script:
  - narrate <green>from<&sp><player.name>:<red><context.raw_args.after[<context.args.get[1]>]> targets:<server.match_player[<context.args.get[1]>]>