Date: 2015/04/16 12:03:13 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
#------------------------#
#dvchest #
#Author:zozer_firehood #
# _______ #
# / \ #
# / ____ \ #
#| / ___ | #
#| / / __ | #
# \ / / / #
# \_______/ #
#------------------------#
dvchest:
type: world
events:
on dvchest command:
# the following is a command that the console needs to run in order to 1. allow a player to use dvchest and 2. add rows to the dvchest.
- define arg1 <c.args.get[1]>
- if <c.server||false> && <def[arg1].is[==].to[addLimit]> {
- define player <c.args.get[2].as_player||false>
- if <def[player].is[==].to[false]> {
- announce 'format:dvchest_format' "<&c>That is not a valid player!" to_console
- queue clear
}
- flag %player% 'dvchestLimit:++:1'
- narrate 'format:dvchest_format' "<&6>You can now have <&f><def[player].flag[dvchestLimit].as_int> <&6>lines in your dvchest!" 'targets:%player%'
- announce 'format:dvchest_format' "<&a><def[player].name> line limit set to <def[player].flag[dvchestLimit]>" to_console
- queue clear
}
- determine passively fulfilled
- if <def[arg1].is[==].to[about]> {
- determine passively fulfilled
- narrate "<green>#-----------------------------#"
- narrate "<green>#<&4><&l>Dv<&8>chest<red> #"
- narrate "<green>#Author:<red>zozer_firehood #"
- narrate "<green>#<red> _______ #"
- narrate "<green>#<red> / \ #"
- narrate "<green>#<red> / ____ \ #"
- narrate "<green>#<red>| / ___ | #"
- narrate "<green>#<red>| / / __ | #"
- narrate "<green>#<red> \ / / / #"
- narrate "<green>#<red> \_______/ #"
- narrate "<green>#-----------------------------#"
- narrate format:dvchest_format "by utilising 4th dimension space,dvchest allows you to have a safe inventory that you can access at anytime"
- narrate format:dvchest_format "to access it, just type <&6>/dvchest"
- narrate format:dvchest_format "disclaimer: we are not responsible for any infestation that may apear in your dvchest."
- narrate format:dvchest_format "this includes, but not limited to: square bacteriaum, time travling rats,random broken glass, and gophers"
- queue clear
- if !<player.has_permission[dvchest]> && !<c.server> && %arg1% == null {
- narrate 'format:dvchest_format' "<red>you havn't unlocked dvchest!"
- queue clear
}
- if !<c.server> && %arg1% != about {
- narrate format:dvchest_format "<red> use <yellow>/dvchest <red> to open your dvchest"
- narrate format:dvchest_format "or <yellow>/dvchest about <red> for information about dvchest"
- determine passively fulfilled
- inject locally loadYAML
- define lines <player.flag[dvchestLimit]>
- define dvchest <player.uuid>dvchest
- note in@generic[title=<&c>dv<&9>Chest;size=<def[lines].mul_int[9]>;] 'as:%dvchest%'
- inventory add 'd:in@%dvchest%' 'o:<yaml[dvchestkey].read[<player.uuid>]>'
- inventory open 'd:in@%dvchest%'
on player clicks in inventory:
- if <context.inventory.replace[<player.uuid>].is[!=].to[in@dvchest]> queue clear
- if <context.inventory.replace[dvchest].is[!=].to[in@<player.uuid>]> {
- inventory close 'd:in@<player.uuid>dvchest'
}
on player closes inventory:
- if <context.inventory.replace[<player.uuid>].is[!=].to[in@dvchest]> queue clear
- define dvlist <c.inventory.list_contents>
- yaml set 'id:dvchestkey' <player.uuid>:%dvlist%
- yaml 'savefile:dvchest/dvchestkey.yml' 'id:dvchestkey'
loadYAML:
- if !<yaml.list.contains[dvchestkey]> {
- if !<server.has_file[dvchest/dvchestkey.yml]> {
- yaml create 'id:dvchestkey'
- yaml 'savefile:dvchest/dvchestkey.yml' 'id:dvchestkey'
}
else {
- yaml 'load:dvchest/dvchestkey.yml' 'id:dvchestkey'
}
}
dvchest_format:
type: format
format: <&4><&l>Dv<&8>chest <text>