Date: 2016/11/30 20:05:01 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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
#NoPlotsMe v7 by Brennan
noplotsme:
type: world
events:
on player breaks block:
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
#names the chunk location for reference later ^
- if <server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
{
- yaml "load:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
- define uuid <yaml[<def[chunkspot]>].read[uuid]>
}
#loads the chunk data if it exists ^
#lowwave v any scenario v
- if <player.in_group[tourist].world[global]> || <player.in_group[dumbass].world[global]>
{
- determine passively cancelled
}
#vaporwave v if the chunk is already defined v
- if <player.in_group[player].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid]> != <player.uuid>
{
- determine passively cancelled
- if <server.has_file[database/NPMbasics/<player.uuid>.yml]>
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, please use your own chunk."
}
else
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, find some free land."
}
}
}
#if the chunk isn't defined v
else
{
- if <server.has_file[database/NPMbasics/<player.uuid>.yml]>
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, please use your own chunk."
- determine passively cancelled
}
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
- yaml create id:<player.uuid>
- yaml id:<player.uuid> set chunkspot:<def[chunkspot]>
- yaml "savefile:database/NPMbasics/<player.uuid>.yml" id:<player.uuid>
- narrate "<&5><&l><<>NoPlotsMe<>>This chunk is now yours, /NPM help for help."
- flag player chunkreset duration:1w
- execute as_op "speed fly <player> 1"
}
}
}
#midwave v if the chunk is already defined v
- if <player.in_group[player+].world[global]> || <player.in_group[builder].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid].as_player.in_group[player].world[global]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You cannot build here,this is a PLAYER chunk."
}
}
#if the chunk isn't defined v
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
#highwave v if the chunk is defined v
- if <player.in_group[architect].world[global]> || <player.in_group[pro].world[global]> || <player.in_group[champion].world[global]> || <player.in_group[1htb38vn28v8vn10b8al].world[global]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid].as_player.in_group[player].world[global]>
{
- if !<player.has_flag[highvaportimer]>
{
- narrate "<&5><<>NoPlotsMe<>>You are building in a PLAYER chunk."
- flag <player> highvaportimer duration:10m
}
}
}
#if the chunk isn't defined v
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
#------------------------------------------------------------------------------------------------------------------------------------------------------------
on player places block:
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
#names the chunk location for reference later ^
- if <server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
{
- yaml "load:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
- define uuid <yaml[<def[chunkspot]>].read[uuid]>
}
#loads the chunk data if it exists ^
#lowwave v any scenario v
- if <player.in_group[tourist].world[global]> || <player.in_group[dumbass].world[global]>
{
- determine passively cancelled
}
#vaporwave v if the chunk is already defined v
- if <player.in_group[player].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid]> != <player.uuid>
{
- determine passively cancelled
- if <server.has_file[database/NPMbasics/<player.uuid>]>
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, please use your own chunk."
}
else
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, find some free land."
}
}
}
#if the chunk isn't defined v
else
{
- if <server.has_file[database/NPMbasics/<player.uuid>.yml]>
{
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, please use your own chunk."
- determine passively cancelled
}
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
- yaml create id:<player.uuid>
- yaml id:<player.uuid> set chunkspot:<def[chunkspot]>
- yaml "savefile:database/NPMbasics/<player.uuid>.yml" id:<player.uuid>
- narrate "<&5><&l><<>NoPlotsMe<>>This chunk is now yours, /NPM help for help."
- flag player chunkreset duration:1w
}
}
}
#midwave v if the chunk is already defined v
- if <player.in_group[player+].world[global]> || <player.in_group[builder].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid].as_player.in_group[player].world[global]>
{
- determine passively cancelled
- narrate "<&5><<>NoPlotsMe<>>You cannot build here,this is a PLAYER chunk."
}
}
#if the chunk isn't defined v
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
#highwave v if the chunk is defined v
- if <player.in_group[architect].world[global]> || <player.in_group[pro].world[global]> || <player.in_group[champion].world[global]> || <player.in_group[1htb38vn28v8vn10b8al].world[global]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi].world[global]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- if <def[uuid].as_player.in_group[player].world[global]>
{
- if !<player.has_flag[highvaportimer]>
{
- narrate "<&5><<>NoPlotsMe<>>You are building in a PLAYER chunk."
- flag <player> highvaportimer duration:10m
}
}
}
#if the chunk isn't defined v
else
{
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
#------------------------------------------------------------------------------------------------------------------------------------------------------------
on system time 12:00:
#initiate reboot ^ reboot v
- announce "<&4>THE SERVER IS RESTARTING"
- wait 2s
- foreach <server.list_players.filter[in_group[player]]>
{
- if !<player.has_flag[chunkreset]>
{
- if <server.has_file[database/NPMbasics/<player.uuid>]>
{
- yaml "load:database/NPMbasics/<player.uuid>" id:<player.uuid>
- adjust server delete_file:database/NPMbasics/<player.uuid>.yml
- adjust server delete_file:database/NPMchunks/<yaml[<player.uuid>].read[chunkspot]>.yml
- adjust <yaml[<player.uuid>].read[chunkspot]> regenerate
}
}
}
- announce "<&c>THE SERVER IS RESTARTING"
- wait 2s
- execute as_server "save-all"
- announce "<&d>THE SERVER IS RESTARTING"
- wait 2s
- foreach <server.list_players.filter[in_group[player].not]>
{
- if <server.has_file[database/NPMbasics/<player.uuid>]>
{
- adjust server delete_file:database/NPMbasics/<player.uuid>.yml
}
}
- announce "<&5>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&1>THE SERVER IS RESTARTING"
- wait 2s
- define chunkspot <context.chunk.x>,<context.chunk.z>,<context.chunk.world>
- foreach <server.list_worlds>
{
- define world <def[value]>
- foreach <def[value].loaded_chunks>
{
- define chunkspot <def[value].x>,<def[value].y>,<def[world]>
- if <yaml.list.contains[<def[chunkspot]>]>
{
- define uuid <yaml[<def[chunkspot]>].read[uuid]>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
- yaml unload id:<def[chunkspot]>
- if <def[uuid].as_player.in_group[player]>
{
- yaml "savefile:database/NPMbasics/<def[uuid]>.yml" id:<def[uuid]>
- yaml unload id:<def[uuid]>
}
}
}
- announce "<&9>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&3>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&2>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&a>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&e>THE SERVER IS RESTARTING"
- wait 2s
- announce "<&6>THE SERVER IS RESTARTING"
- kick <server.list.players> reason:<&d><&l><&o>Average reboot time: ~25 seconds
- execute as_server "stop"
#------------------------------------------------------------------------------------------------------------------------------------------------------------
on chunk unloads:
- define chunkspot <context.chunk.x>,<context.chunk.z>,<context.chunk.world>
- if <server.has_file[database/NPMchunks/<def[chunkspot]>.yml]>
{
- if <yaml.list.contains[<def[chunkspot]>]>
{
- define uuid <yaml[<def[chunkspot]>].read[uuid]>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>" id:<def[chunkspot]>
- yaml unload id:<def[chunkspot]>
- if <def[uuid].as_player.in_group[player]>
{
- yaml "savefile:database/NPMbasics/<def[uuid]>" id:<def[uuid]>
- yaml unload id:<def[uuid]>
}
}
}
#------------------------------------------------------------------------------------------------------------------------------------------------------------
#------------------------------------------------------------------------------------------------------------------------------------------------------------
noplotsmecmd1:
type: command
name: domain
description: Gives the domain of the chunk you're in
usage: /domain
script:
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
- if <server.has_file[database/NPMchunks/<def[chunkspot]>.yml>
{
- define uuid <yaml[<def[chunkspot]>].read[uuid]>
- if <def[uuid].as_player.in_group[player].world[global]>
{
- narrate "<&5><<>NoPlotsMe<>>This is a PLAYER chunk owned by <def[uuid].as_player>."
}
else
{
- narrate "<&5><<>NoPlotsMe<>>This is a PUBLIC chunk."
}
}
else
{
- narrate "<&5><<>NoPlotsMe<>>This chunk is unowned."
}
#------------------------------------------------------------------------------------------------------------------------------------------------------------
noplotsmecmd2:
type: command
name: 123
description: Starting up, the shield!
usage: /123
script:
- if <player.in_group[tourist].world[global]>
{
- execute as_op "promote <player>"
- execute as_op "speed fly <player> 10"
-
#------------------------------------------------------------------------------------------------------------------------------------------------------------
#------------------------------------------------------------------------------------------------------------------------------------------------------------
noplotsmewehook:
type: command
name: domain
description: WorldEdit hook
usage: /setdomain
script:
- if <player.in_group[builder].world[global]> || <player.in_group[architect].world[global]> || <player.in_group[pro].world[global]> || <player.in_group[champion].world[global]> || <player.in_group[1htb38vn28v8vn10b8al].world[global]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi].world[global]>
{
- define selection <player.selected_region.list_partial_chunks>
- define selectionsize <player.selected_region.list_partial_chunks.list>
- define player <player.uuid>
- if <player.in_group[builder].world[global]>
{
- if <def[selectionsize]> >= 50
{
- foreach <def[selection]>
{
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
else
{
- narrate "<&5><<>NoPlotsMe<>>Your selection is too large."
}
}
- if <player.in_group[architect].world[global]>
{
- if <def[selectionsize]> >= 50
{
- foreach <def[selection]>
{
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
else
{
- narrate "<&5><<>NoPlotsMe<>>Your selection is too large."
}
}
- if <player.in_group[pro].world[global]>
{
- if <def[selectionsize]> >= 50
{
- foreach <def[selection]>
{
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
else
{
- narrate "<&5><<>NoPlotsMe<>>Your selection is too large."
}
}
- if <player.in_group[champion].world[global]> || <player.in_group[1htb38vn28v8vn10b8al].world[global]> || <player.in_group[4mv8b0vm18bv03m8vm10bjene8gi].world[global]>
{
- foreach <def[selection]>
{
- define chunkspot <context.location.chunk.x>,<context.location.chunk.z>,<context.location.world>
- yaml create id:<def[chunkspot]>
- yaml id:<def[chunkspot]> set uuid:<player.uuid>
- yaml "savefile:database/NPMchunks/<def[chunkspot]>.yml" id:<def[chunkspot]>
}
}
}