Date: 2017/02/21 16:37:42 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
"purchase_timer":
type: world
debug: minimal
events:
on system time minutely:
- if <context.minute.mod[2]> == 0 queue clear
- foreach <server.list_online_players> {
- narrate target:<def[value]> "<&6>2분마다 실행함"
}
- run warehouse_Purchase_start
on npc flag timeout expires:
- foreach <server.list_online_players> {
- narrate target:<def[value]> "<&6>flag 만료"
}
- run warehouse_Purchase_start
on reload scripts:
- wait 5t
- foreach <server.get_spawned_npcs_flagged[warehousekeeper]> {
- define flagged_npc <def[value]>
}
- bossbar remove test_bar
- bossbar create test_bar players:<server.list_online_players> "title:HI GUYS" color:red progress:0.2
on system time minutely:
- wait 5t
- bossbar update test_bar progress:<math:<<def[flagged_npc]>.flag[timeout].duration.in_second>/60>
warehouse_Purchase_start:
type: task
debug: minimal
script:
- foreach <server.list_online_players> {
- narrate target:<def[value]> "<util.date>< ><util.date.time> <s@purchaselist.yaml_key[purchase]>"
- narrate target:<def[value]> "<s@purchaselist.yaml_key[purchase.granite]>"
- narrate target:<def[value]> "<server.get_spawned_npcs_flagged[warehousekeeper]>"
- define target <def[value]>
}
- foreach <server.get_spawned_npcs_flagged[warehousekeeper]> {
- flag <def[value]> total_limit:100000
- flag <def[value]> timeout:<util.date.time> duration:50s
- flag <def[value]> purchase:<yaml[purchase].list_deep_keys[purchase_list].random[1]>
- narrate target:<def[target]> "<def[value].flag[total_limit]>"
- narrate target:<def[target]> "<script.yaml_key[PurchaseList].random>"
}