Paste #34335: Edit of P#34332 - Untitled Paste

Date: 2016/06/18 16:41:42 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# Ridic
  flag_generic-string:
    - define colorMap 'li@r/c|R/4|y/e|Y/6|g/a|G/2|c/b|C/3|b/9|B/1|p/d|P/5|0/0|1/8|2/7|w/f|k/k|l/l|m/m|n/n|o/o|x/r'
    - define string '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>'
    - define pchar ''
    - define final 'li@'
    - foreach '<def[string].to_list>':
      - define char '%value%'
      - if '%pchar%' == '&' {
        - foreach '%colorMap%' {
          - if <def[value].before[/].equals_case_sensitive[%char%]> {
            - define final '<def[final].include[<def[value].after[/]>]>'
            - foreach stop
            }
          }
        }
        else {
        - define final '<def[final].include[%char%]>'
        }
      - define pchar '%char%'
    - define string '<def[final].separated_by[]>'
    - yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:%string%' 'id:dRegions_%world%_import'

#Regex
  flag_generic-string:
    - define colorMap 'li@r/c|R/4|y/e|Y/6|g/a|G/2|c/b|C/3|b/9|B/1|p/d|P/5|0/0|1/8|2/7|w/f|k/k|l/l|m/m|n/n|o/o|x/r'
    - define string '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>'
    - foreach '%colorMap%':
      - define string '<def[string].replace[regex:&<def[value].before[/]>].with[&<def[value].after[/]>]>'
    - yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:%string%' 'id:dRegions_%world%_import'