Paste #38115: Untitled Paste

Date: 2016/12/03 14:32:14 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


noplotsmewehook:
    type: command
    name: setdomain
    description: WorldEdit hook
    usage: /setdomain
    script:
    - define selection <player.selected_region.list_partial_chunks>
    - define selectionsize <player.selected_region.list_partial_chunks.list>
    - define player <player.uuid>
        - if <player.in_group[builder].world[global]>
            {
            - if <def[selectionsize]> >= 50
                {
                - foreach <def[selection]>
                    {
                    - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                    - if !<server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
                        {
                        - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                        - yaml create id:<def[chunkspot]>
                        - yaml id:<def[chunkspot]> set uuid:<player.uuid>
                        - yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
                        - narrate "<&5><&lt>NoPlotsMe<&gt>This chunk is now in PUBLIC domain."
                        }
                   }
                }
            else
                {
                - narrate "<&5><&lt>NoPlotsMe<&gt>Your selection is too large."
                }
            }
        else if <player.in_group[architect].world[global]>
            {
            - if <def[selectionsize]> >= 50
                {
                - foreach <def[selection]>
                    {
                    - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                    - if !<server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
                        {
                        - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                        - yaml create id:<def[chunkspot]>
                        - yaml id:<def[chunkspot]> set uuid:<player.uuid>
                        - yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
                        - narrate "<&5><&lt>NoPlotsMe<&gt>This chunk is now in PUBLIC domain."
                        }
                   }
                }
            else
                {
                - narrate "<&5><&lt>NoPlotsMe<&gt>Your selection is too large."
                }
            }
        else if <player.in_group[pro].world[global]>
            {
            - if <def[selectionsize]> >= 50
                {
                - foreach <def[selection]>
                    {
                    - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                    - if !<server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
                        {
                        - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                        - yaml create id:<def[chunkspot]>
                        - yaml id:<def[chunkspot]> set uuid:<player.uuid>
                        - yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
                        - narrate "<&5><&lt>NoPlotsMe<&gt>This chunk is now in PUBLIC domain."
                        }
                   }
                }
            else
                {
                - narrate "<&5><&lt>NoPlotsMe<&gt>Your selection is too large."
                }
            }
        else if <player.in_group[champion].world[global]> || <player.in_group[1htb38vn28v8vn10b8al].world[global]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi].world[global]>
            {
            - narrate InCS
            - foreach <def[selection]>
               {
                - narrate defining
                - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                - if !<server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
                    {
                    - narrate ifnewchunk
                    - define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
                    - yaml create id:<def[chunkspot]>
                    - yaml id:<def[chunkspot]> set uuid:<player.uuid>
                    - yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
                    - narrate "<&5><&lt>NoPlotsMe<&gt>This chunk is now in PUBLIC domain."
                    }
                }
            }
        else
            {
            - narrate "<&5><&lt>NoPlotsMe<&gt>This command requires WorldEdit!"
            }