Date: 2017/11/15 10:16:04 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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]>
- choose <s@PlatformYaml.yaml_key[setups.<def[setup]>.platforms.<def[value]>.shape.type]>:
- case cuboid:
- run s@PlatformsLoop d:<def[value]>|<s@PlatformYaml.yaml_key[setups.<def[setup]>.platforms.<def[value]>.delay]>|<s@PlatformYaml.list_keys[<def[filepath]>.path].size>|<def[filepath]>|cu instantly
- case ellipse:
- run s@PlatformsLoop d:<def[value]>|<s@PlatformYaml.yaml_key[setups.<def[setup]>.platforms.<def[value]>.delay]>|<s@PlatformYaml.list_keys[<def[filepath]>.path].size>|<def[filepath]>|ellipsoid instantly
PlatformsLoop:
type: task
debug: true
speed: 0
script:
- define <def[1]>_locations li@
- define <def[1]>_materials li@
- repeat <def[3]>:
- define <def[1]>_locations <def[<def[1]>_locations].include[<escape:<def[5]>@<s@PlatformYaml.yaml_key[<def[4]>.path.<def[value]>.location].as_location.add[<s@PlatformYaml.yaml_key[<def[4]>.shape.add]>].replace[l@]>|<s@PlatformYaml.yaml_key[<def[4]>.path.<def[value]>.location].as_location.sub[<s@PlatformYaml.yaml_key[<def[4]>.shape.sub]>].replace[l@]>>]>
- define <def[1]>_materials <def[<def[1]>_materials].include[<s@PlatformYaml.yaml_key[<def[4]>.path.<def[value]>.material]>]>
- if <s@PlatformYaml.yaml_key[<def[4]>.reverse]> == true {
- define <def[1]>_locations <def[<def[1]>_locations].include[<def[<def[1]>_locations].reverse.remove[first].remove[last]>]>
- define <def[1]>_materials <def[<def[1]>_materials].include[<def[<def[1]>_materials].reverse.remove[first].remove[last]>]>
- define size <def[<def[1]>_locations].size>
}
else {
- define size <def[3]>
}
- while true:
- repeat <def[size]>:
- modifyblock <unescape:<def[<def[1]>_locations].get[<def[value]>]>> <def[<def[1]>_materials].get[<def[value]>]>
- wait <def[2]>
- modifyblock <unescape:<def[<def[1]>_locations].get[<def[value]>]>> air
PlatformsCommand:
type: command
debug: false
name: platforms
description: start or stop the platforms
usage: /platforms (start|stop)
script:
- choose <context.args.size>:
- case 1:
- choose <context.args.get[1]>:
- case start:
- run s@Platforms instantly
- narrate "<&b>Platforms started!"
- case stop:
- foreach <queue.list.filter[contains_any[platforms_]]>:
- queue clear <def[value]>
- narrate "<&b>Platforms stopped!"
- default:
- narrate "<&c>Usage<&co> /platforms (start<&pipe>stop)"
########################
### CONFIG BELOW ###
########################
PlatformYaml:
type: yaml data
setups:
Garden:
platforms:
red:
shape:
type: cuboid
add: 2,0,2
sub: 2,0,2
reverse: false
delay: 11t
path:
1:
location: -55,24,-1,Garden
material: 155,0
2:
location: -54,24,-1,Garden
material: 155,0
3:
location: -53,24,-1,Garden
material: 155,0
4:
location: -52,24,-1,Garden
material: 155,0
5:
location: -51,24,-1,Garden
material: 155,0
6:
location: -50,24,-1,Garden
material: 155,0
7:
location: -49,24,-1,Garden
material: 155,0
8:
location: -48,24,-1,Garden
material: 155,0
9:
location: -47,24,-1,Garden
material: 155,0
10:
location: -46,24,-1,Garden
material: 155,0
11:
location: -45,24,-1,Garden
material: 155,0