Date: 2017/09/18 13:55:02 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
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
gpa_com_skularr_trash_landfill_inv_1:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 1'
size: 54
definitions:
n: 'i@slime_ball[display_name=&ssa&sslNext Page;lore=&ss0|&ss7Click to go to the next page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
b: 'i@white_stained_glass_pane[display_name=&sscNo more pages!]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[1].to[45]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [b] [x] [x] [x] [n] [x] [x]'
gpa_com_skularr_trash_landfill_inv_2:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 2'
size: 54
definitions:
n: 'i@slime_ball[display_name=&ssa&sslNext Page;lore=&ss0|&ss7Click to go to the next page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
p: 'i@slime_ball[display_name=&ssa&sslPrevious Page;lore=&ss0|&ss7Click to go to the previous page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[46].to[90]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [p] [x] [x] [x] [n] [x] [x]'
gpa_com_skularr_trash_landfill_inv_3:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 3'
size: 54
definitions:
n: 'i@slime_ball[display_name=&ssa&sslNext Page;lore=&ss0|&ss7Click to go to the next page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
p: 'i@slime_ball[display_name=&ssa&sslPrevious Page;lore=&ss0|&ss7Click to go to the previous page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[91].to[135]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [p] [x] [x] [x] [n] [x] [x]'
gpa_com_skularr_trash_landfill_inv_4:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 4'
size: 54
definitions:
n: 'i@slime_ball[display_name=&ssa&sslNext Page;lore=&ss0|&ss7Click to go to the next page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
p: 'i@slime_ball[display_name=&ssa&sslPrevious Page;lore=&ss0|&ss7Click to go to the previous page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[136].to[180]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [p] [x] [x] [x] [n] [x] [x]'
gpa_com_skularr_trash_landfill_inv_5:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 5'
size: 54
definitions:
n: 'i@slime_ball[display_name=&ssa&sslNext Page;lore=&ss0|&ss7Click to go to the next page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
p: 'i@slime_ball[display_name=&ssa&sslPrevious Page;lore=&ss0|&ss7Click to go to the previous page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[181].to[225]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [p] [x] [x] [x] [n] [x] [x]'
gpa_com_skularr_trash_landfill_inv_6:
type: inventory
debug: false
inventory: CHEST
title: '<&3><&l>Landfill<&r> <&8>Page 6'
size: 54
definitions:
p: 'i@slime_ball[display_name=&ssa&sslPrevious Page;lore=&ss0|&ss7Click to go to the previous page;enchantments=DAMAGE_ALL,1;flags=HIDE_ENCHANTS]'
x: 'i@black_stained_glass_pane[display_name=&ss0]'
b: 'i@white_stained_glass_pane[display_name=&sscNo more pages!]'
procedural items:
- define litems <server.flag[gpa.com.skularr.trash.landfill].as_list.reverse||li@>
- determine '<def[litems].get[226].to[270]||li@>'
slots:
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[] [] [] [] [] [] [] [] []'
- '[x] [x] [p] [x] [x] [x] [b] [x] [x]'
gpa_com_skularr_trash_cmd:
type: command
debug: false
name: trash
description: 'Sends items to the landfill. See /landfill (#)'
aliases:
- skutrash
- strash
- skularrtrash
usage: /trash
allowed help:
- determine <player.has_permission[sku.trash.use]||<player.is_op||<context.server>>>
script:
- if <context.server> {
- narrate '<&c>This is an in-game command!' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- if !<player.has_permission[sku.trash.trash]||<player.is_op||true>> {
- narrate '<&c>Sorry! You can<&sq>t use this command!' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- if <player.has_flag[gpa.com.skularr.trash.trash_cmd_cool]||false> {
- narrate '<&c>You need to wait <player.flag[gpa.com.skularr.trash.trash_cmd_cool].expiration.in_seconds.round_up>s before reusing this command!' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- inventory open 'd:in@generic[title=<&3><&l>Trash Bin;size=18]'
- if !<player.has_permission[sku.trash.cooldown]||<player.is_op||true>> {
- flag <player>
}
gpa_com_skularr_trash_landfill_cmd:
type: command
debug: false
name: landfill
description: 'Lists all trashed items. Use the number argument to open a specific landfill page.'
aliases:
- skulandfill
- slandfill
- skularrlandfill
usage: /landfill (number)
allowed help:
- determine <player.has_permission[sku.trash.landfill]||<player.is_op||<context.server>>>
script:
- if <context.server> {
- narrate '<&c>This is an in-game command!' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- if !<player.has_permission[sku.trash.landfill]||<player.is_op>> {
- narrate '<&c>Sorry! You can<&sq>t use this command!' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- if <context.args.size||0> > 1 {
- narrate '<&c>Too many arguments. There is only one argument for this command, which is an integer from 1 to 6.' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- if <context.args.get[1].is[MATCHES].to[number].not||false> {
- narrate '<&c>You must specify an integer.' format:gpa_com_skularr_trash_chat_format
- queue clear
}
- inventory open 'd:in@gpa_com_skularr_trash_landfill_inv_<context.args.get[1].as_decimal.max[1].min[6].round_down||1>'
- flag player 'gpa.com.skularr.trash.in_landfill'
gpa_com_skularr_trash_landfill_evt:
type: world
debug: false
events:
on player closes inventory:
- if <context.inventory.title> == '<&3><&l>Trash Bin' {
- if <context.inventory.list_contents.filter[is[EQUALS].to[i@air].not].is_empty> {
- queue clear
}
- define t '<context.inventory.list_contents.filter[is[EQUALS].to[i@air].not]>'
- define ta 'li@'
- foreach <def[t]> {
- define l '<def[value].lore||li@>'
- adjust <def[value]> 'lore:<def[l].include[&sp|&ss7Trashed by <player.name>|&ss7Click to claim]>' save:n
- define ta '<def[ta].include[<entry[n].result>]>'
}
- flag server 'gpa.com.skularr.trash.landfill:|:<def[ta]>'
- define s '<server.flag[gpa.com.skularr.trash.landfill].as_list.size||0>'
- if <def[s]> > 270 {
- flag server 'gpa.com.skularr.trash.landfill:<server.flag[gpa.com.skularr.trash.landfill].as_list.get[<def[s].sub[270]>].to[<def[s]>].separated_by[|].as_list>'
}
- foreach <server.get_online_players_flagged[gpa.com.skularr.trash.in_landfill]> {
- inventory open d:<def[value].open_inventory> player:<def[value]>
}
- narrate '<&f>Successfully sent trash to the landfill!' format:gpa_com_skularr_trash_chat_format
}
- wait 1t
- if <context.inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]> && !<player.open_inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]> {
- flag player 'gpa.com.skularr.trash.in_landfill:!'
- queue clear
}
on player clicks in inventory:
- if !<context.inventory.starts_with[in@gpa_com_skularr_trash_landfill_inv_]> {
- queue clear
}
- determine passively 'CANCELLED'
- define n '<context.inventory.after_last[_]>'
- if <context.item.material> == m@slime_ball {
- if <context.raw_slot> == 48 {
- inventory open d:in@gpa_com_skularr_trash_landfill_inv_<def[n].sub_int[1]>
- queue clear
}
else if <context.raw_slot> == 52 {
- inventory open d:in@gpa_com_skularr_trash_landfill_inv_<def[n].add_int[1]>
- queue clear
}
}
- if <context.raw_slot> <= 45 && <context.item> != i@air {
#### REORDER NOT WORKING
##########
##########
- define fs '<server.flag[gpa.com.skularr.trash.landfill].as_list.size>'
- define rem_num '<context.slot.add[<el@45.mul[<def[n].sub[1]>]>].round_down>'
- define new_li '<server.flag[gpa.com.skularr.trash.landfill].as_list.reverse.remove[<def[rem_num]>]>'
- define new_li '<def[new_li].reverse>'
- flag server 'gpa.com.skularr.trash.landfill:<def[new_li].as_element.replace[firstregex:li@]>'
- narrate '<def[new_li].as_list>'
- adjust <context.item> lore:<context.item.lore.remove[last].remove[last].remove[last]> save:i
- give <entry[i].result>
- inventory open d:<context.inventory>
- queue clear
}
- wait 1t
- inventory update
gpa_com_skularr_trash_chat_format:
type: format
debug: false
format: <&3><&l>Sku<&sq>s Trash Bin<&r><&7><&co> <text>