-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
util.dscript
61 lines (48 loc) · 1.79 KB
/
util.dscript
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
# /dTime Command
_util_dtime_command:
type: world
events:
on dtime command:
- if !<player.is_op> queue clear
- flag 'ddtc_time:<context.args>'
- if <flag.p:ddtc_time> > 24
queue clear
else narrate 'Changing time to <flag.p:ddtc_time>:00.'
- if <flag.p:ddtc_time> == 24
execute as_op 'time set 6000'
- flag ddtc_time:-:6
- if <flag.p:ddtc_time> >= 0
execute as_op 'time set <flag.p:ddtc_time.asint>000'
- flag ddtc_time:+:12
- if <flag.p:ddtc_time> < 12
execute as_op 'time set <flag.p:ddtc_time.asint>000'
- flag ddtc_time:!
- determine cancelled
# Generic Looper (GL)
"loop through":
type: task
speed: 0
context: task|flag|type
script:
- runtask '_depend generic loop process'
"context:<context.task>|<context.flag>|<context.type>|<util.random.uuid>"
"_util_gl":
type: task
speed: 0
context: task|flag|type
script:
- runtask '_depend generic loop process'
"context:<context.task>|<context.flag>|<context.type>|<util.random.uuid>"
"_depend generic loop process":
type: task
speed: 0
context: task|flag|type|id
script:
- ^if "<flag.g:Iterator <context.id>.size || 0>" == 0
flag global "Iterator <context.id>:|:<flag.<context.type>:<context.flag>.aslist>"
- ^runtask "<context.task>" "context:<flag.g:Iterator <context.id>[1]>"
- ^flag global "Iterator <context.id>:<-:<flag.g:Iterator <context.id>[1]>"
- ^if "<flag.g:Iterator <context.id>.size || 0>" > 0
runtask '_depend Generic Loop Process'
"context:<context.task>|<context.flag>|<context.type>|<context.id>"
else flag global "Iterator <context.id>:!"