Date: 2019/01/06 17:29:26 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
# ████████████████████████████████████████████████████
# ██ Formatting
# ██
# ██▓▓▒▒░░
# ███ [ Chat Format ] ███
cf:
type: format
debug: false
format: <&2>[<&a>B<&d>e<&a>hrShop<&2>] <&f><&o><text>
# ███ [ Item Format ] ███
if:
type: format
debug: false
format: <text>
# ████████████████████████████████████████████████████
# ██ Commands
# ██
# ██▓▓▒▒░░
# ███ [ Open GUI Command Basic ] ███
InventoryGUI_Command:
type: command
name: behrtest
aliases:
- behrt
script:
- if <player.name> != Behr_Riley:
- narrate "<&c>You are not Behr. This command is <&4>Developmental<&c>"
- determine fulfilled
- else:
- Narrate format:cf "Success."
- inventory open d:in@ShopGUI
# ████████████████████████████████████████████████████
# ██ GUI
# ██
# ██▓▓▒▒░░
ShopGUI:
type: inventory
title: Shop GUI
size: 54
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank] [Blank]"
- "[PM1] [PM2] [PM3] [PM4] [Blank] [TPI] [TPD] [Blank] [Close]"
# ████████████████████████████████████████████████████
# ██ Items
# ██
# ██▓▓▒▒░░
# ███ [ General GUI Buttons ] ███
# TPI | TogglePriceIncrease
# TPD | TogglePriceDecrease
TPI:
type: item
material: player_head[skull_skin=UUID|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2VkZDIwYmU5MzUyMDk0OWU2Y2U3ODlkYzRmNDNlZmFlYjI4YzcxN2VlNmJmY2JiZTAyNzgwMTQyZjcxNiJ9fX0]
display name: "<&6>[<&2><&l> +<&r> <&6>] <&l><&e>Price Increase Tools"
lore:
- <&e> Toggle the <&a>Item Price Increase <&e>price tools.
TPD:
type: item
material: player_head[skull_skin=UUID|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ4YTk5ZGIyYzM3ZWM3MWQ3MTk5Y2Q1MjYzOTk4MWE3NTEzY2U5Y2NhOTYyNmEzOTM2Zjk2NWIxMzExOTMifX19]
display name: "<&6>[<&4><&l> -<&r> <&6>] <&l><&e>Price Decrease Tools"
lore:
- <&e> Toggle the <&a>Item Price Decrease <&e>price tools.
Blank:
type: item
material: black_stained_glass_pane
display name: " "
no-id: true
Close:
type: item
material: barrier
display name: "<&6>[<&4><&l> X<&r> <&6>] <&l><&e>Close"
lore:
- <&e> Closes the shop.
# ███ [ Price Modifier Items ] ███
PM1:
type: item
material: iron_block
display name: "<&6>[<&2>$1<&6>]<&f> <&e><&l>Price Modifier"
lore:
- <&a> Modifies item price by <&6>[<&2>$1<&6>]<&f>.
PM2:
type: item
material: gold_block
display name: "<&6>[<&2>$10<&6>]<&f> <&e><&l>Price Modifier"
lore:
- <&a> Modifies item price by <&6>[<&2>$10<&6>]<&f>
PM3:
type: item
material: diamond_block
display name: "<&6>[<&2>$100<&6>]<&f> <&e><&l>Price Modifier"
lore:
- <&a> Modifies item price by <&6>[<&2>$100<&6>]<&f>
PM4:
type: item
material: emerald_block
display name: "<&6>[<&2>$1,000<&6>]<&f> <&e><&l>Price Modifier"
lore:
- <&a> Modifies item price by <&6>[<&2>$1,000<&6>]<&f>.
# ████████████████████████████████████████████████████
# ██ Handlers
# ██
# ██▓▓▒▒░░
ShopGUI_Handlers:
type: world
debug: true
events:
# Raw_Slot Reference
# 1 2 3 4 5 6 7 8 9 above glass bar
# 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 glass bar
# 46 47 48 49 50 51 52 53 54 buttons
# - - - - - - - - -
# 55 56 57 58 59 60 61 62 63 player inv
# 64 65 66 67 68 69 70 71 72 player inv
# 73 74 75 76 77 78 79 80 81 player inv
# - - - - - - - - -
# 82 83 84 85 86 87 88 89 90 player inv
# ███ [ GUI Button Handlers ] ███
# ███ [ RAW SLOT TESTER ] ███
on player clicks in ShopGUI with PM1:
- if <context.raw_slot> >= 55:
- narrate "Raw Slot is <context.raw_slot>"
- narrate "And this determined cancelled"
- determine cancelled
- else:
- narrate "<context.raw_slot>"
- narrate "else"
#end script
#nothing past this
# PM1 | Price Modifier $1
on player clicks PM1 in ShopGUI:
- flag player PM1
# PM2 | Price Modifier $10
on player clicks PM2 in ShopGUI:
# PM3 | Price Modifier $100
on player clicks PM3 in ShopGUI:
# PM4 | Price Modifier $1,000
on player clicks PM4 in ShopGUI:
# TPIMode | Toggle Price Increase Mode
on player clicks TPI in ShopGUI:
- if <player.has_flag[TPDMode]>:
- flag player TPDMode:!
- else
- flag player TPIMode
- flag player TPIMode
- determine cancelled
# TPDMode | Toggle Price Decrease Mode
on player clicks TPD in ShopGUI:
- if <player.has_flag[TPIMode]>:
- flag player TPIMode:!
- else
- flag player TPDMode
- determine cancelled
# Close Shop | Remove Modes
on player clicks Close in ShopGUI:
- inventory close d:<context.inventory>
- ^determine cancelled
on player clicks Blank in ShopGUI:
- ^determine cancelled
# ███ [ GUI Misc Event Handlers ] ███
on player clicks in ShopGUI:
-
on player closes inventory:
- flag player TPIMode|TPDMode:!
# - if <context.inventory.replace[<player.uuid>].starts_with[in@pvault].not||true>:
# - queue clear
# - define vault_id <context.inventory.after[_]>
# - define dvlist <context.inventory.list_contents>
# - yaml set id:pvaultkey "<player.uuid>.<def[vault_id]>:<def[dvlist]>"
# - yaml "savefile:data/pvault/pvaultkey.yml" "id:pvaultkey"
# - define id "<player.uuid>pvault_<def[vault_id]>"
# - note remove as:<def[id]>
# ████████████████████████████████████████████████████
# ██ YAML Handlers
# ██
# ██▓▓▒▒░░
# [ Example ]
# - narrate format:f "<script.yaml_key[a1]>"
# - wait 1s
# -^ narrate format:cf "This is delayed for after the previous completes"
# -^ narrate format:cf "This will also be formated via cf in Format section"
# ████████████████████████████████████████████████████
# ██ YAML Keys
# ██
# ██▓▓▒▒░░
# [ Example ]
# a1: "This is dialog via YAML Key."
# FR | FlagResponse
# IR | InputResponse
fr1: "You currently have a shop set up"