Paste #30413: Diff note for paste #30412

Date: 2016/02/15 15:31:36 UTC-08:00
Type: Diff Report

View Raw Paste Download This Paste
Copy Link


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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519


-market_assignment:
+/
-  type: assignment
-  debug: false
-  actions:
-    on click:
-    - if <player.is_sneaking.not> {
-      - inventory open d:in@market_interface
-      } else {
-      - run market_get_offers instantly
-      }
-market_event_handlers:
-  type: world
-  debug: false
-  events:
-    on player joins:
-    - wait 7s
-    - if <player.has_flag[give_market_update]> {
-      - flag give_market_update:!
-      - narrate "<&2>One of your global market offers updated."
-      - playsound sound:level_up %value% pitch:0.6
-      }
-    on player clicks in market_offer_listing:
-    - determine cancelled passively
-    - if <context.item||i@air> == i@air queue clear
-    - foreach <li@11|13|15|17|29|31|33|35.reverse> {
-      - if !<yaml[MARKETSAVES].contains[live_offers.<player>.%value%]||false> {
-        - define slot %value%
-        }
-      }
-    - playsound sound:click pitch:0.9 <player>
-    - if <def[slot].exists.not> {
-      - narrate "<&c>You have no offer slots available."
-      - queue clear
-      }
-    - narrate "<&2>Building your offer."
-    - flag market_slot_used:%slot%
-    - define path <player.flag[market_auto_offer_data_<context.raw_slot>]||none>
-    - if <yaml[MARKETSAVES].read[live_offers.%path%.type]||none> == sell {
-      - run market_set_offer_item_buying instantly def:<yaml[MARKETSAVES].read[live_offers.%path%.item]||none>
-      - run market_set_offer_price_buying instantly def:<yaml[MARKETSAVES].read[live_offers.%path%.price]||0>
-      - run market_set_offer_quantity_buying instantly def:<yaml[MARKETSAVES].read[live_offers.%path%.quantity].as_int.sub[<yaml[MARKETSAVES].read[live_offers.%path%.progress].as_int>].as_int||0>
-      } else {
-      - adjust <yaml[MARKETSAVES].read[live_offers.%path%.item]||none> quantity:1 save:item
-      - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.item:<entry[item].result>
-      - run market_set_offer_item_selling instantly def:<yaml[MARKETSAVES].read[live_offers.%path%.item]||none>
-      - run market_set_offer_price_selling instantly def:<yaml[MARKETSAVES].read[live_offers.%path%.price]||0>
-      }
-    on player clicks in market_interface:
-    - if <context.raw_slot> < 46 {
-      - determine cancelled passively
-      }
-    - wait 1t
-    - if li@11|13|15|17|29|31|33|35 contains <context.raw_slot> {
-      - playsound sound:click pitch:0.9 <player>
-      - if <yaml[MARKETSAVES].contains[live_offers.<player>.<context.raw_slot>]||false> {
-        - if <context.action> == move_to_other_inventory {
-          - inject locally path:market_abort
-          } else {
-          - inject locally path:market_collect
-          }
-        } else {
-        - if <context.cursor_item||i@air> == i@air {
-          - inject locally path:make_buy_offer
-          } else {
-          - inject locally path:make_sell_offer
-          }
-        }
-      }
-    on player clicks in market_selling_interface:
-    - if <context.raw_slot> < 10 {
-      - determine cancelled passively
-      }
-    - playsound sound:click pitch:0.9 <player>
-    - if <context.raw_slot> == 9 {
-      - inject locally path:cancel_offer
-      } else if <context.raw_slot> == 1 {
-      - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.type:sell
-      - inject locally path:confirm_offer
-      } else if <context.raw_slot> == 7 {
-      - inject locally path:change_selling_offer_quantity
-      } else if <context.raw_slot> == 3 {
-      - inject locally path:change_selling_offer_price
-      }
-    on player clicks in market_buying_interface:
-    - if <context.raw_slot> < 10 {
-      - determine cancelled passively
-      }
-    - playsound sound:click pitch:0.9 <player>
-    - if <context.raw_slot> == 9 {
-      - inject locally path:cancel_offer
-      } else if <context.raw_slot> == 1 {
-      - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.type:buy
-      - inject locally path:confirm_offer
-      } else if <context.raw_slot> == 7 {
-      - inject locally path:change_buying_offer_quantity
-      } else if <context.raw_slot> == 5 {
-      - inject locally path:change_buying_offer_item
-      } else if <context.raw_slot> == 3 {
-      - inject locally path:change_buying_offer_price
-      }
-    on player drops item:
-    - if <player.has_flag[market_sell_item_drop]> determine cancelled
-  market_collect:
-    - if <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.type]> == buy {
-      - if <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress]||0> > <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0> {
-        - give <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.item]||0> qty:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0>]||0>
-        - narrate "<&A>You collected <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0>].as_int||0> of <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.item].display||<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.item].as_item.formatted||0>>."
-        - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>.collected:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress]||0>
-        } else {
-        - narrate "<&c>Nothing left to collect."
-        }
-      } else {
-      - if <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress]||0> > <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0> {
-        - give money qty:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0>].mul[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.price]||0>].add[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.excess]||0>]||0>
-        - narrate "<&A>You collected <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0>].mul[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.price]||0>].add[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.excess]||0>].as_int||0> gold coins."
-        - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>.collected:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress]||0>
-        - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>.excess:0
-        } else {
-        - narrate "<&c>Nothing left to collect."
-        }
-      }
-    - if <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.collected]||0> >= <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.quantity]||0> {
-      - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>:!
-      }
-    - flag <player> market_sell_item_drop duration:5t
-    - inventory open d:in@market_interface
-  market_abort:
-    - inject locally path:market_collect
-    - if <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.type]> == sell {
-      - give <yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.item]||0> qty:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.quantity].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress]||0>]||0>
-      - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>:!
-      } else {
-      - give money qty:<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.quantity].mul[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.price]||0>].sub[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.progress].mul[<yaml[MARKETSAVES].read[live_offers.<player>.<context.raw_slot>.price]||0>]>]||0>
-      - yaml id:MARKETSAVES set live_offers.<player>.<context.raw_slot>:!
-      }
-    - narrate "<&c>You aborted the rest of your offer."
-    - flag <player> market_sell_item_drop duration:5t
-    - inventory open d:in@market_interface 
-  confirm_offer:
-    - if <yaml[MARKETSAVES].contains[offer_constructor.<player>.<player.flag[market_slot_used]>.item].not> {
-      - narrate "<&c>Specify a valid item!"
-      - queue clear
-      }
-    - if <yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.type]> == sell {
-      - if <player.inventory.contains[<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.item]>].quantity[<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]||1>]> {
-        - take <yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.item]> qty:<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]||1>
-        } else {
-        - narrate "<&c>You don't have this many items!"
-        - queue clear
-        }
-      } else {
-      - if <player.money> >= <yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.price].mul[<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]>]||0> {
-        - take money qty:<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.price].mul[<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]>]||0>
-        } else {
-        - narrate "<&c>You don't have this much money!"
-        - queue clear
-        }
-      }
-    - flag <player> market_sell_item_drop duration:5t
-    - inventory open d:in@market_interface
-    - narrate "<&2>Offer confirmed."
-    - if !<yaml[MARKETSAVES].contains[offer_constructor.<player>.<player.flag[market_slot_used]>.price]> {
-      - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.price:1
-      }
-    - if !<yaml[MARKETSAVES].contains[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]> {
-      - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.quantity:1
-      }
-    - foreach <yaml[MARKETSAVES].list_keys[offer_constructor.<player>.<player.flag[market_slot_used]>]> {
-      - yaml id:MARKETSAVES set live_offers.<player>.<player.flag[market_slot_used]>.%value%:<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.%value%]>
-      }
-    - inventory open d:in@market_interface
-    - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>:!
-    - run market_offer_completer delay:2s
-  cancel_offer:
-    - flag <player> market_sell_item_drop duration:5t
-    - inventory open d:in@market_interface
-    - narrate "<&c>Offer cancelled."
-    - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>:!
-  make_buy_offer:
-  - narrate "<&a>Making a buy offer."
-  - flag <player> market_sell_item_drop duration:5t
-  - flag <player> market_slot_used:<context.raw_slot>
-  - inventory open d:in@market_buying_interface
-  make_sell_offer:
-  - define item <context.cursor_item>
-  - if <def[item].durability||0> != 0 {
-    - narrate "<&c>You can't sell damaged goods!"
-    - flag <player> market_sell_item_drop duration:5t
-    - inventory open d:in@market_interface
-    - queue clear
-    }
-  - adjust %item% quantity:1 save:item
-  - narrate "<&a>Making a sell offer."
-  - flag <player> market_slot_used:<context.raw_slot>
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<context.raw_slot>.item:<entry[item].result>
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<context.raw_slot>.quantity:<player.inventory.quantity[<entry[item].result>].add[<context.cursor_item.quantity>].as_int||1>
-  - if <yaml[MARKETSAVES].contains[statistics.averages.<entry[item].result>]> {
-    - define average <yaml[MARKETSAVES].read[statistics.averages.<entry[item].result>.value].div[<yaml[MARKETSAVES].read[statistics.averages.<entry[item].result>.amount]>].as_int||1>
-    - yaml id:MARKETSAVES set offer_constructor.<player>.<context.raw_slot>.price:<def[average].as_int>
-    }
-  - flag <player> market_sell_item_drop duration:5t
-  - inventory open d:in@market_selling_interface
-  change_selling_offer_quantity:
-  - narrate "<&a>Write down your new quantity."
-  - run open_sign_input def:market_set_offer_quantity_selling instantly
-  change_selling_offer_price:
-  - narrate "<&a>Write down your new price."
-  - run open_sign_input def:market_set_offer_price_selling instantly
-  change_buying_offer_quantity:
-  - narrate "<&a>Write down your new quantity."
-  - run open_sign_input def:market_set_offer_quantity_buying instantly
-  change_buying_offer_price:
-  - narrate "<&a>Write down your new price."
-  - run open_sign_input def:market_set_offer_price_buying instantly
-  change_buying_offer_item:
-  - narrate "<&a>Write down your item of choice."
-  - run open_sign_input def:market_set_offer_item_buying instantly
-#
-#
-# SIGN INPUT RETURNS
-#
-market_set_offer_quantity_selling:
-  type: task
-  debug: false
-  speed: 1t
-  script:
-  - if <def[1].is[matches].to[number].not> {
-    - narrate "<&c>Please specify a valid quantity."
-    - queue clear
-    }
-  - narrate "<&a>Set new quantity to %1%"
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.quantity:%1%
-  - inventory open d:in@market_selling_interface
-market_set_offer_price_selling:
-  type: task
-  debug: false
-  speed: 1t
-  script:
-  - if <def[1].is[matches].to[number].not> {
-    - narrate "<&c>Please specify a valid price."
-    - queue clear
-    }
-  - narrate "<&a>Set new price to %1%"
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.price:%1%
-  - inventory open d:in@market_selling_interface
-market_set_offer_quantity_buying:
-  type: task
-  debug: false
-  speed: 1t
-  script:
-  - if <def[1].is[matches].to[number].not> {
-    - narrate "<&c>Please specify a valid quantity."
-    - queue clear
-    }
-  - narrate "<&a>Set new quantity to %1%"
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.quantity:%1%
-  - inventory open d:in@market_buying_interface
-market_set_offer_price_buying:
-  type: task
-  debug: false
-  speed: 1t
-  script:
-  - if <def[1].is[matches].to[number].not> {
-    - narrate "<&c>Please specify a valid price."
-    - queue clear
-    }
-  - narrate "<&a>Set new price to %1%"
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.price:%1%
-  - inventory open d:in@market_buying_interface
-market_set_offer_item_buying:
-  type: task
-  debug: false
-  speed: 1t
-  script:
-  - if <def[1].as_item||none> == none {
-    - narrate "<&c>Please specify a valid item."
-    - queue clear
-    }
-  - if <yaml[MARKETSAVES].contains[statistics.averages.<def[1].as_item>]> {
-    - define average <yaml[MARKETSAVES].read[statistics.averages.<def[1].as_item>.value].div[<yaml[MARKETSAVES].read[statistics.averages.<def[1].as_item>.amount]>].as_int||1>
-    - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.price:<def[average].as_int>
-    } else {
-    - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.price:1
-    }
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.quantity:1
-  - narrate "<&a>Set new item to %1%"
-  - yaml id:MARKETSAVES set offer_constructor.<player>.<player.flag[market_slot_used]>.item:<def[1].as_item>
-  - inventory open d:in@market_buying_interface
-#
-#
-#
-# MAIN INTERFACE
-#
-market_interface: 
-  debug: false
-  type: inventory 
-  inventory: CHEST
-  title: <&2>Your Offers
-  size: 45
-  definitions: 
-    div: i@black_stained_glass_pane[display_name=<&0><&sp>]
-  slots: 
-    - "[div] [div] [div] [div] [div] [div] [div] [div] [div]"
-    - "[div] [<proc[market_interface_slot].context[11]>] [div] [<proc[market_interface_slot].context[13]>] [div] [<proc[market_interface_slot].context[15]>] [div] [<proc[market_interface_slot].context[17]>] [div]"
-    - "[div] [div] [div] [div] [div] [div] [div] [div] [div]"
-    - "[div] [<proc[market_interface_slot].context[29]>] [div] [<proc[market_interface_slot].context[31]>] [div] [<proc[market_interface_slot].context[33]>] [div] [<proc[market_interface_slot].context[35]>] [div]"
-    - "[div] [div] [div] [div] [div] [div] [div] [div] [div]"
-market_interface_slot:
-  type: procedure
-  debug: false
-  script:
-  - if <yaml[MARKETSAVES].contains[live_offers.<player>.%1%]> {
-    - define item <yaml[MARKETSAVES].read[live_offers.<player>.%1%.item]>
-    - define percentage <yaml[MARKETSAVES].read[live_offers.<player>.%1%.progress].div[<yaml[MARKETSAVES].read[live_offers.<player>.%1%.quantity]>].mul[12].as_int||0>
-    - if %percentage% == 12 {
-      - define col a
-      } else {
-      - define col e
-      }
-    - define progressbar "<&%col%><el@============.substring[1,%percentage%]><&8><el@============.substring[<def[percentage].add[1]>,12]>"
-    - adjust %item% "lore:li@<&b><yaml[MARKETSAVES].read[live_offers.<player>.%1%.type].to_uppercase>ING|<&f>|<&2>Quantity<&co><&a> <yaml[MARKETSAVES].read[live_offers.<player>.%1%.quantity]>|<&2>Price per<&co><&a> <yaml[MARKETSAVES].read[live_offers.<player>.%1%.price]>|<&f>|<&6>Completed<&co> <yaml[MARKETSAVES].read[live_offers.<player>.%1%.progress].as_int||0>/<yaml[MARKETSAVES].read[live_offers.<player>.%1%.quantity].as_int||0>|%progressbar%|<&f>|<&7>Click to collect.|<&7>Sneak click to abort." save:item
-    - determine "<entry[item].result>"
-    } else {
-    - determine "i@chest[display_name=<&a>Make an offer!;lore=li@<&7>Click to make a buy offer.|<&7>Click an item on here to make a sell offer.]"
-    }
-#
-#
-# BUY OFFER INTERFACE
-#
-market_buying_interface: 
-  debug: false
-  type: inventory 
-  inventory: CHEST
-  title: <&2>Buying Interface
-  size: 9
-  definitions: 
-    div: i@black_stained_glass_pane[display_name=<&0><&sp>]
-    offer: <proc[market_Buying_interface_offer]>
-    price: <proc[market_Buying_interface_price]>
-    quantity: <proc[market_Buying_interface_quantity]>
-  slots: 
-    - "[i@lime_dye[display_name=<&a>Confirm]] [div] [price] [div] [offer] [div] [quantity] [div] [i@barrier[display_name=<&c>Cancel]]"
-market_Buying_interface_offer:
-  type: procedure
-  debug: false
-  script:
-  - if <yaml[MARKETSAVES].contains[offer_constructor.<player>.<player.flag[market_slot_used]>.item]> {
-    - define item <yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.item]>
-    - adjust %item% "display_name:<&2>Click to change item." save:item
-    - determine "<entry[item].result>"
-    } else {
-    - determine "i@item_frame[display_name=<&2>Click to change item.]"
-    }
-market_Buying_interface_price:
-  type: procedure
-  debug: false
-  script:
-  - determine "i@sign[display_name=<&6>Change Price;lore=li@<&2>Current price<&co> <&a><yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.price]||1>]"
-market_Buying_interface_quantity:
-  type: procedure
-  debug: false
-  script:
-  - determine "i@sign[display_name=<&6>Change Quantity;lore=li@<&2>Current quantity<&co> <&a><yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]||1>]"
-
-#
-#
-# SELL OFFER INTERFACE
-#
-market_selling_interface: 
-  debug: false
-  type: inventory 
-  inventory: CHEST
-  title: <&2>Selling Interface
-  size: 9
-  definitions: 
-    div: i@black_stained_glass_pane[display_name=<&0><&sp>]
-    offer: <proc[market_selling_interface_offer]>
-    price: <proc[market_selling_interface_price]>
-    quantity: <proc[market_selling_interface_quantity]>
-  slots: 
-    - "[i@lime_dye[display_name=<&a>Confirm]] [div] [price] [div] [offer] [div] [quantity] [div] [i@barrier[display_name=<&c>Cancel]]"
-market_selling_interface_offer:
-  type: procedure
-  debug: false
-  script:
-  - determine "<yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.item]||i@barrier[display_name=<&4>Error.;lore=li@<&c>Something went wrong.]>"
-market_selling_interface_price:
-  type: procedure
-  debug: false
-  script:
-  - determine "i@sign[display_name=<&6>Change Price;lore=li@<&2>Current price<&co> <&a><yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.price]||1>]"
-market_selling_interface_quantity:
-  type: procedure
-  debug: false
-  script:
-  - determine "i@sign[display_name=<&6>Change Quantity;lore=li@<&2>Current quantity<&co> <&a><yaml[MARKETSAVES].read[offer_constructor.<player>.<player.flag[market_slot_used]>.quantity]||1>]"
-#
-#
-# MARKET OFFERS LISTING
-#
-#
-market_get_offers:
-  type: task
-  debug: false
-  script:
-  - define items li@
-  - foreach <yaml[MARKETSAVES].list_keys[live_offers]||none> {
-    - define player %value%
-    - if <yaml[MARKETSAVES].list_keys[live_offers.%player%].size||0> > 0 {
-      - foreach <yaml[MARKETSAVES].list_keys[live_offers.%player%]> {
-        - define offer_id %value%
-        - define amount <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.quantity].sub[<yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.progress]||0>]>
-        - if %amount% > 0 {
-          - define item <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.item]>
-          - adjust %item% "lore:li@<&b><yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.type].to_uppercase||none>ING|<&2>Amount<&co> <&a><def[amount].as_int>|<&2>Price per<&co> <&a><yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.price]||none>|<&7>By <def[player].name>" save:item
-          - flag market_auto_offer_data_<def[items].size.add[1].as_int>:%player%.%offer_id%
-          - define items "%items%<entry[item].result>|"
-          }
-        }
-      }
-    }
-  - note "in@generic[size=99;title=<&2>Market Offer Listing;contents=<def[items]>]" as:market_offer_listing
-  - inventory open d:in@market_offer_listing
-#
-#
-#
-# CHECK FOR MATCHING OFFERS
-#
-#
-market_offer_completer_initiator:
-  type: world
-  debug: false
-  events:
-    on system time minutely:
-    - if <context.minute.mod[15]> != 0 queue clear
-    - announce to_console "<&7>force running market offer completer"
-    - run market_offer_completer delay:2s
-market_offer_completer:
-  type: task
-  speed: 2t
-  debug: false
-  script:
-  - foreach <yaml[MARKETSAVES].list_keys[live_offers].random[9999]||none> {
-    - wait 2t
-    - define player %value%
-    - foreach <yaml[MARKETSAVES].list_keys[live_offers.%player%]||none> {
-      - define offer_ID %value%
-      - if <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.type]||none> == sell {
-        - foreach <yaml[MARKETSAVES].list_keys[live_offers].random[9999]||none> {
-          - wait 2t
-          - define player2 %value%
-          - foreach <yaml[MARKETSAVES].list_keys[live_offers.%player2%]||none> {
-            - define offer_ID2 %value%
-            - if <yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.type]||none> == buy {
-              - if <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.item]||none> == <yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.item]||none2> {
-                - if <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.price]||none> <= <yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.price]||none> {
-                  - define transfer_amount <yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.quantity].sub[<yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.progress]||0>].min[<yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.quantity].sub[<yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.progress]||0>]>]>
-                  - if %transfer_amount% > 0 {
-                    - yaml id:MARKETSAVES set live_offers.%player%.%offer_ID%.progress:+:%transfer_amount%
-                    - yaml id:MARKETSAVES set live_offers.%player2%.%offer_ID2%.progress:+:%transfer_amount%
-                    - define excess <yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.price].sub[<yaml[MARKETSAVES].read[live_offers.%player%.%offer_ID%.price]>]||0>
-                    - if %excess% > 0 {
-                      - yaml id:MARKETSAVES set live_offers.%player%.%offer_ID%.excess:+:<def[excess].mul[%transfer_amount%]>
-                      }
-                    - define item <yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.item]>
-                    - yaml id:MARKETSAVES set statistics.averages.%item%.amount:+:%transfer_amount%
-                    - yaml id:MARKETSAVES set statistics.averages.%item%.value:+:<yaml[MARKETSAVES].read[live_offers.%player2%.%offer_ID2%.price].mul[%transfer_amount%]>
-                    - foreach li@%player%|%player2% {
-                      - if <def[value].is_online> {
-                        - narrate "<&2>One of your global market offers updated." target:%value%
-                        - playsound sound:level_up %value% pitch:0.6
-                        - if <def[value].open_inventory.title||none> == "<&2>Your Offers" {
-                          - flag %value% market_sell_item_drop duration:5t
-                          - inventory open d:in@market_interface player:%value%
-                          } else {
-                          - flag %value% give_market_update
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-#
-#
-#
-# YAML SAVES HANDLING
-#
-#
-market_saves_yaml_handler:
-  type: world
-  debug: false
-  events:
-    on server start:
-    - if <server.has_file[/MARKET_SAVES/marketsaves.yml]> {
-      - yaml "load:/MARKET_SAVES/marketsaves.yml" id:marketsaves
-      } else {
-      - yaml create id:marketsaves
-      - yaml "savefile:/MARKET_SAVES/marketsaves.yml" id:marketsaves
-      }
-    on shutdown:
-    - yaml "savefile:/MARKET_SAVES/marketsaves.yml" id:marketsaves
-    on system time minutely:
-    - if <context.minute.mod[10]> == 0 run marketsaves_autosave
-marketsaves_autosave:
-  type: task
-  debug: false
-  script:
-  - yaml "savefile:/MARKET_SAVES/marketsaves.yml" id:marketsaves
-  - announce to_ops "<&7>Saving market data."