Paste #45565: Untitled Paste

Date: 2017/11/15 13:56:47 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Platforms:
  type: task
  debug: true
  script:
  - define setup <server.flag[votedmap]||s@PlatformYaml.list_keys[setups].get[1]>
  - foreach <s@PlatformYaml.list_keys[setups.<def[setup]>.platforms]>:
    - define filepath setups.<def[setup]>.platforms.<def[value]>
    - run s@PlatformsSetup d:<s@PlatformYaml.yaml_key[<def[filepath]>.delay]>|<s@PlatformYaml.list_keys[<def[filepath]>.path].size>|<def[filepath]> instantly
PlatformsSetup:
  type: task
  debug: true
  speed: 0
  script:
  - define locations li@
  - define schematics li@
  - define paste li@
  - repeat <def[2]>:
    - define locations <def[locations].include[<s@PlatformYaml.yaml_key[<def[3]>.path.<def[value]>.location].as_location>]>
    - define schematics <def[schematics].include[<s@PlatformYaml.yaml_key[<def[3]>.path.<def[value]>.schematic]>]>
    - define paste <def[paste].include[<s@PlatformYaml.yaml_key[<def[3]>.path.<def[value]>.paste]>]>
  - if <s@PlatformYaml.yaml_key[<def[3]>.reverse]> == true {
    - define locations <def[locations].include[<def[locations].reverse.remove[first].remove[last]>]>
    - define schematics <def[schematics].include[<def[schematics].reverse.remove[first].remove[last]>]>
    - define paste <def[paste].include[<def[paste].reverse.remove[first].remove[last]>]>
    - define size <def[locations].size>
    }
    else {
    - define size <def[2]>
    }
  - run s@PlatformsLoop d:<def[locations]>|<def[schematics]>|<def[paste]>|<def[size]>|<def[1]>
PlatformsLoop:
  type: task
  debug: true
  speed: 0
  script:
  - choose <def[3].remove[air].is_empty>:
    - case true:
      - while true:
        - repeat <def[4]>:
          - modifyblock <def[1].get[<def[value]>]> <def[2].get[<def[value]>]>
          - wait <def[5]>
          - modifyblock <def[1].get[<def[value]>]> air
    - case false:
      - while true:
        - repeat <def[4]>:
          - modifyblock <def[1].get[<def[value]>]> <def[2].get[<def[value]>]>
          - wait <def[5]>
          - modifyblock <def[1].get[<def[value]>]> <def[3].get[<def[value]>]>