Date: 2016/09/16 21:28:30 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
noplotsme:
type: world
events:
on system time 24:03:
#When it's midnight
- foreach <server.list_players.filter[in_group[player]]>
#Runs this command to all online players (Group)
{
- if !<player.has_flag[chunkreset]>
{
- if <server.has_file[/database/NPMchunks/<player.uuid>.yml]>
{
- if !<yaml.list.contains[<player.uuid>]>
{
- yaml "load:/database/playerusers/<player.uuid>.yml" id:<player.uuid>
}
- define yamlbridgeone <yaml[<player.uuid>].read[chunkxy]>
- adjust server delete_file:/database/playerusers/<player.uuid>.yml
- adjust server delete_file:/database/NPMchunks/<def[yamlbridgeone]>.yml
}
}
}
- foreach <server.list_files[/database/playerusers/]>
#Deletes the player (group) data for higher ranks
{
- if !<player[<def[value.before[.yml>].in_group[player]>
{
- adjust server delete_file:/database/playerusers/<def[value]>
}
}
- narrate "<&4>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&c>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&d>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&5>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&1>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&9>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&3>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&2>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&a>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&e>THE SERVER IS RESTARTING"
- wait 10t
- narrate "<&6>THE SERVER IS RESTARTING"
- execute as_server "save-all"
- execute as_server "stop"
on player places block:
- if <server.has_file[/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml]>
{
- yaml "load:/scripts/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml" id:<context.location.chunk.x>,<context.location.chunk.y>
}
- define chunkxy <context.location.chunk.x>,<context.location.chunk.y>
- if <player.in_group[player]>
#Player
{
- if <yaml.list.contains[%chunkxy%]>
{
- define uuid <yaml[%chunkxy%].read[uuid]>
- if <def[uuid]> =! <player.uuid>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, find some free land instead."
}
else
{
- flag <player> chunkreset duration:1w
}
}
else if <server.has_file[/database/playerusers/<player.uuid>.yml]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You already own a chunk, rank up for more land."
}
else
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml create id:<player.uuid>
- yaml "savefile:/database/playerusers/<player.uuid>.yml" id:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<player.uuid> set chunkxy:->:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>This chunk is now yours, make some cool junk for the next rank!"
- narrate "<&5>-If your land is found too close to others it can be reset."
- narrate "<&5>-If you don't build in your land for a week it can be reset."
- narrate "<&5>-If your build is found to not be in effort for promotion it can be reset."
- flag <player> chunkreset duration:1w
}
}
- if <player.in_group[player+]> || <player.in_group[builder]>
#Player+, Builder
{
- if <yaml.list.contains[%chunkxy%]>
{
- yaml "load:" id:<player.uuid>
- define uuid2 <yaml[%chunkxy%].read[uuid]>
- if <<def[uuid2]>.in_group[player]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>This is a PLAYER chunk, use public land."
}
}
else
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>Chunk added to public domain."
}
}
- if <player.in_group[architect]> || <player.in_group[pro]> || <player.in_group[champion]> || <player.in_group[1htb38vn28v8vn10b8al]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi]>
#Architect, Pro, Champion, Staff, Wizard
{
- if !<yaml.list.contains[%chunkxy%]>
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>Chunk added to public domain."
}
}
- if <player.in_group[dumbass]>
{
- determine passively cancelled
}
on player breaks block:
- if <server.has_file[/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml]>
{
- yaml "load:/scripts/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml" id:<context.location.chunk.x>,<context.location.chunk.y>
}
- define chunkxy <context.location.chunk.x>,<context.location.chunk.y>
- if <player.in_group[player]>
{
- if <yaml.list.contains[%chunkxy%]>
{
- define uuid <yaml[%chunkxy%].read[uuid]>
- if <def[uuid]> =! <player.uuid>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, find some free land instead."
}
else
{
- flag <player> chunkreset duration:1w
}
}
else if <server.has_file[/database/playerusers/<player.uuid>.yml]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You already own a chunk, rank up for more land."
}
else
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml create id:<player.uuid>
- yaml "savefile:/database/playerusers/<player.uuid>.yml" id:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<player.uuid> set chunkxy:->:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>This chunk is now yours, make some cool junk for the next rank!"
- narrate "<&5>-If your land is found too close to others it can be reset."
- narrate "<&5>-If you don't build in your land for a week it can be reset."
- narrate "<&5>-If your build is found to not be in effort for promotion it can be reset."
- flag <player> chunkreset duration:1w
}
}
- if <player.in_group[player+]> || <player.in_group[builder]>
{
- if <yaml.list.contains[%chunkxy%]>
{
- yaml "load:" id:<player.uuid>
- define uuid2 <yaml[%chunkxy%].read[uuid]>
- if <<def[uuid2]>.in_group[player]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>This is a PLAYER chunk, use public land."
}
}
else
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>Chunk added to public domain."
}
}
- if <player.in_group[architect]> || <player.in_group[pro]> || <player.in_group[champion]> || <player.in_group[1htb38vn28v8vn10b8al]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi]>
{
- if !<yaml.list.contains[%chunkxy%]>
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set chunkxy:->:<player.uuid>
- yaml "savefile:/database/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>" id:<context.location.chunk.x>,<context.location.chunk.y>
- narrate "<&5><<>NoPlotsMe<>>Chunk added to public domain."
}
}
- if <player.in_group[dumbass]>
{
- determine passively cancelled
}