Date: 2016/10/26 06:00:07 UTC-07: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
PD_Proc:
type: procedure
debug: false
definitions: path|type|player
script:
- if <def[path].exists.not||true> {
- queue clear
}
# - determine <yaml[<def[player].uuid||<player.uuid>>].read[<def[path]>]||null>
- if <def[type].exists.not||true> {
- define type read
}
- if <def[player].exists.not||true> {
- define player <player>
}
- if <yaml.list.contains[<def[player].uuid||<player.uuid>>].not> {
- if <server.has_file[<s@PlayerData_Data.yaml_key[config.save_path]><def[player].uuid||<player.uuid>>.yml].not||true> {
- determine 0
}
- yaml "load:<s@PlayerData_Data.yaml_key[config.save_path]><def[player].uuid||<player.uuid>>.yml" id:<def[player].uuid||<player.uuid>>
}
- if <def[type]> == list {
- defnie outcome <yaml[<def[player].uuid||<player.uuid>>].list_keys[<def[path]>]||0>
}
else if <def[type]> == has {
- define outcome <yaml[<def[player].uuid||<player.uuid>>].contains[<def[path]>]||false>
}
else {
- define outcome <yaml[<def[player].uuid||<player.uuid>>].read[<def[path]>]||0>
}
- if <def[player].is_online.not> {
- if <yaml.list.contains[<def[player].uuid||<player.uuid>>]> {
- yaml id:<def[player].uuid||<player.uuid>> "savefile:<s@PlayerData_Data.yaml_key[config.save_path]><def[player].uuid||<player.uuid>>.yml"
- yaml unload id:<def[player].uuid||<player.uuid>>
}
}
- determine <def[outcome]>