Paste #43103: Untitled Paste

Date: 2017/07/19 22:30:28 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


dRegions_ConfigFileGenerator:
  type: task
  debug: false
  definitions: readID|writeID|readPath|writePath|update
  script:
    - ^define keylist '<yaml[%readID%].list_keys[%readPath%]||null>'
    - ^if '%keylist%' != 'null' {
      - if '%keylist%' == 'li@' {
        - yaml set '%writePath%:|:' 'id:%writeID%'
        }
        else {
        - inject locally p:foreachKeylist instantly
        }
      }
      else {
      - define entry '<yaml[%readID%].read[%readPath%]>'
      - if <yaml[%readID%].is_list[%readPath%]> {
        - foreach '%entry%' {
          - if <yaml[%writeID%].read[%writePath%].contains[%value%].not||true> || %update% {
            - yaml set '%writePath%:->:%value%' 'id:%writeID%'
            }
          }
        }
        else {
        - if '<yaml[%writeID%].contains[%writePath%].not>' || '%update%' {
          - yaml set '%writePath%:%entry%' 'id:%writeID%'
          }
        }
      }

  foreachKeylist:
    - foreach '%keylist%' {
      - run s@dRegions_ConfigFileGenerator 'def:%readID%|%writeID%|%readPath%.%value%|%writePath%.%value%|%update%' instantly
      }



dRegions_Configurations:
  type: yaml data

  config:
    version: 0.32
    clear_cache_on_restart: false
    language: us
    stats:
      About: This allows sending basic dRegions usage info to the Script Tracker system created by BlackCoyote. Doing this helps me focus my development efforts. Please enable webget in the Denizen config.yml file and here to participate.
      useStats: true
    regions:
      enable: true
      invincibility-removes-mobs: false
      invincibility-confuses-mobs: false
      wand: drg_wand
      ownerOnDefine: false
      claim:
        max-volume: 0
        only-inside-existing-regions: true
        max-region-count-per-player:
          default: 7
    spread:
      water: true
      water-list: []
      lava: true
      lava-list: []
      mycel: true
      grass: true
      mushroom: true
      vines: true