· 9 years ago · Dec 12, 2016, 02:36 PM
1options:
2 Prefix: &3&l[&c&lJULEGAVE&3&l]&r
3
4# DATABASE
5script options:
6 $ init com.mysql.jdbc.Driver
7 $ db url jdbc:
8 $ db username
9 $ db password
10
11# SQL INFO:
12# EVENTS:
13# Lave en table:
14# update "CREATE TABLE table (colonne VARCHAR(250) NOT NULL PRIMARY KEY, colonne2 INTEGER NOT NULL)"
15# update "CREATE TABLE IF NOT EXISTS table (colonne VARCHAR(250) NOT NULL PRIMARY KEY, colonne2 INTEGER NOT NULL)"
16# Indsætte noget i en table:
17# update "INSERT INTO table (colonne, colonne2) VALUES ('data1','2')"
18# Ændre noget i en table:
19# update "UPDATE table SET colonne2='3' WHERE colonne='data1'"
20# Slette noget i en table:
21# update "DELETE FROM table WHERE colonne='data1'"
22# INFO:
23# Få ét stk. info:
24# set {_query} to the first element out of objects in column "colonne2" from result of query "SELECT colonne2 FROM table WHERE colonne='data1'" and close
25# FÃ¥ en liste med info:
26# add objects in column "colonne" from result of query "SELECT colonne FROM table" and close to {_query::*}
27aliases:
28 barrier = 166
29 enderchest = 130
30
31command /jk:
32 trigger:
33 invoke "jk-shop" from "%player%"
34
35sub "jk-shop":
36 set {_player} to "%parameter 1%" parsed as a player
37 set {_player_uuid} to "%{_player}'s uuid%"
38 if size of {temp_::shop::*} is between 25 and 999999999:
39 send "{@Prefix} &cFor at shoppen ikke bliver overbelastet, er der maksimum 25 der kan bruge shoppen adgangen!" to {_player}
40 stop
41 set {temp_::shop::%{_player_uuid}%} to true
42 $ thread
43 set {_temp} to the first element out of objects in column "points" from result of query "SELECT points FROM Points WHERE player='%{_player_uuid}%'" and close
44 set {_points} to "%{_temp}%" parsed as a number
45 if parameter 2 is "pakke1":
46 if {_points} < 1:
47 send "{@Prefix} &cDu har ikke nok points!" to {_player}
48 stop
49 remove 1 from {_points}
50 execute console command "/eco give %{_player}% 100"
51 $ thread
52 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
53 send "{@Prefix} &4&l1&4 point&c er blevet fjernet fra din konto!" to {_player}
54 stop
55 if parameter 2 is "pakke2":
56 if {_points} < 20:
57 send "{@Prefix} &cDu har ikke nok points!" to {_player}
58 stop
59 remove 20 from {_points}
60 execute console command "/cratekeys give %{_player}% op 4"
61 $ thread
62 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
63 send "{@Prefix} &4&l20&4 points&c er blevet fjernet fra din konto!" to {_player}
64 stop
65 if parameter 2 is "pakke3":
66 if {_points} < 39:
67 send "{@Prefix} &cDu har ikke nok points!" to {_player}
68 stop
69 remove 39 from {_points}
70 execute console command "/cratekeys give %{_player}% ultimate 1"
71 execute console command "/cratekeys give %{_player}% super 1"
72 $ thread
73 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
74 send "{@Prefix} &4&l39&4 points&c er blevet fjernet fra din konto!" to {_player}
75 stop
76 if parameter 2 is "pakke4":
77 if {_points} < 39:
78 send "{@Prefix} &cDu har ikke nok points!" to {_player}
79 stop
80 remove 39 from {_points}
81 execute console command "/give %{_player}% emerald 5"
82 $ thread
83 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
84 send "{@Prefix} &4&l39&4 points&c er blevet fjernet fra din konto!" to {_player}
85 stop
86 if parameter 2 is "pakke5":
87 if {_points} < 29:
88 send "{@Prefix} &cDu har ikke nok points!" to {_player}
89 stop
90 remove 29 from {_points}
91 execute console command "/ccrates give %{_player}% epiccosmetic 5"
92 execute console command "/ccrates give %{_player}% cosmetic 5"
93 $ thread
94 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
95 send "{@Prefix} &4&l39&4 points&c er blevet fjernet fra din konto!" to {_player}
96 stop
97 if parameter 2 is "pakke6":
98 if {_points} < 19:
99 send "{@Prefix} &cDu har ikke nok points!" to {_player}
100 stop
101 remove 19 from {_points}
102 execute console command "/pp user %{_player}% add essentials.fly all skyblock 7d"
103 $ thread
104 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
105 send "{@Prefix} &4&l19&4 points&c er blevet fjernet fra din konto!" to {_player}
106 stop
107 if parameter 2 is "pakke7":
108 if {_points} < 19:
109 send "{@Prefix} &cDu har ikke nok points!" to {_player}
110 stop
111 remove 19 from {_points}
112 execute console command "/pp user %{_player}% add essentials.god all skyblock 7d"
113 $ thread
114 update "UPDATE Points SET points='%{_points}%' WHERE player='%{_player_uuid}%'"
115 send "{@Prefix} &4&l19&4 points&c er blevet fjernet fra din konto!" to {_player}
116 stop
117 open chest with 5 rows named "&c&lJULE&f&lGAVER" to {_player}
118 wait 1 tick
119 if inventory name of {_player}'s current inventory is not "&c&lJULE&f&lGAVER":
120 stop
121 set {_item} to a emerald named "&3&l===&r &b&lPOINTS&r &3&l==="
122 set line 1 of {_item}'s lore to "&bDu har &3&l%{_points}%&b points!"
123 set line 3 of {_item}'s lore to "&cDu kan maks. have &4&l54&c points!"
124 format slot 0 of {_player} with {_item} to be unstealable
125
126#startfold --- PAKKER ---
127
128#subfold --- PAKKE #1 ---
129 if {_points} is 0:
130 set {_item} to a enderchest named "&e&lPakke &e##&l1"
131 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
132 set line 2 of {_item}'s lore to "&a-&r $100"
133 set line 4 of {_item}'s lore to "&6Pris:&e 1 point"
134 set line 6 of {_item}'s lore to "&c&m--------------"
135 set line 7 of {_item}'s lore to "&eDu har ikke råd endnu!"
136 set line 8 of {_item}'s lore to "&c&m--------------"
137 format slot 10 of {_player} with {_item} to be unstealable
138
139 if {_points} is between 1 and 999999999999999:
140 set {_item} to a gold nugget named "&e&lPakke &e##&l1"
141 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
142 set line 2 of {_item}'s lore to "&a-&r $100"
143 set line 4 of {_item}'s lore to "&6Pris:&e 1 point"
144 format slot 10 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke1"]
145
146#subfold --- PAKKE #2 ---
147 if {_points} is between 0 and 19:
148 set {_item} to a enderchest named "&e&lPakke &e##&l2"
149 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
150 set line 2 of {_item}'s lore to "&a-&r 4 OP case keys"
151 set line 4 of {_item}'s lore to "&6Pris:&e 20 points"
152 set line 5 of {_item}'s lore to "&7&oDisse keys bruges ved &8&o/warp case&7&o!"
153 set line 6 of {_item}'s lore to "&c&m--------------"
154 set line 7 of {_item}'s lore to "&eDu har ikke råd endnu!"
155 set line 8 of {_item}'s lore to "&c&m--------------"
156 format slot 12 of {_player} with {_item} to be unstealable
157
158 if {_points} is between 20 and 999999999999999:
159 set {_item} to a tripwire hook named "&e&lPakke &e##&l2"
160 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
161 set line 2 of {_item}'s lore to "&a-&r 4 OP case keys"
162 set line 4 of {_item}'s lore to "&6Pris:&e 20 points"
163 set line 5 of {_item}'s lore to "&7&oDisse keys bruges ved &8&o/warp case&7&o!"
164 format slot 12 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke2"]
165
166#subfold --- PAKKE #3 ---
167 if {_points} is between 0 and 38:
168 set {_item} to a enderchest named "&e&lPakke &e##&l3"
169 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
170 set line 2 of {_item}'s lore to "&a-&r 1 ultimate case keys"
171 set line 3 of {_item}'s lore to "&a-&r 1 super case keys"
172 set line 5 of {_item}'s lore to "&6Pris:&e 39 points"
173 set line 6 of {_item}'s lore to "&7&oDisse keys bruges ved &8&o/warp crate&7&o!"
174 set line 6 of {_item}'s lore to "&c&m--------------"
175 set line 7 of {_item}'s lore to "&eDu har ikke råd endnu!"
176 set line 8 of {_item}'s lore to "&c&m--------------"
177 format slot 14 of {_player} with {_item} to be unstealable
178
179 if {_points} is between 39 and 999999999999999:
180 set {_item} to a tripwire hook named "&e&lPakke &e##&l3"
181 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
182 set line 2 of {_item}'s lore to "&a-&r 1 ultimate case keys"
183 set line 3 of {_item}'s lore to "&a-&r 1 super case keys"
184 set line 5 of {_item}'s lore to "&6Pris:&e 39 points"
185 set line 6 of {_item}'s lore to "&7&oDisse keys bruges ved &8&o/warp crate&7&o!"
186 format slot 14 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke3"]
187
188#subfold --- PAKKE #4 ---
189 if {_points} is between 0 and 34:
190 set {_item} to a enderchest named "&e&lPakke &e##&l4"
191 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
192 set line 2 of {_item}'s lore to "&a-&r 5 Emeralder"
193 set line 4 of {_item}'s lore to "&6Pris:&e 39 points"
194 set line 5 of {_item}'s lore to "&c&m--------------"
195 set line 6 of {_item}'s lore to "&eDu har ikke råd endnu!"
196 set line 7 of {_item}'s lore to "&c&m--------------"
197 format slot 16 of {_player} with {_item} to be unstealable
198
199 if {_points} is between 39 and 999999999999999:
200 set {_item} to a emerald named "&e&lPakke &e##&l4"
201 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
202 set line 2 of {_item}'s lore to "&a-&r 5 Emeralder"
203 set line 4 of {_item}'s lore to "&6Pris:&e 39 points"
204 format slot 16 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke4"]
205
206#subfold --- PAKKE #5 ---
207 if {_points} is between 0 and 38:
208 set {_item} to a enderchest named "&e&lPakke &e##&l5"
209 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
210 set line 2 of {_item}'s lore to "&a-&r 5 &dEpic &rCosmetic Keys"
211 set line 3 of {_item}'s lore to "&a-&r 5 Cosmetic Keys"
212 set line 5 of {_item}'s lore to "&6Pris:&e 29 points"
213 set line 7 of {_item}'s lore to "&c&m--------------"
214 set line 8 of {_item}'s lore to "&eDu har ikke råd endnu!"
215 set line 9 of {_item}'s lore to "&c&m--------------"
216 format slot 29 of {_player} with {_item} to be unstealable
217
218 if {_points} is between 39 and 999999999999999:
219 set {_item} to a tripwire hook named "&e&lPakke &e##&l5"
220 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
221 set line 2 of {_item}'s lore to "&a-&r 5 &dEpic &rCosmetic Keys"
222 set line 3 of {_item}'s lore to "&a-&r 5 Cosmetic Keys"
223 set line 5 of {_item}'s lore to "&6Pris:&e 29 points"
224 format slot 29 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke5"]
225
226#subfold --- PAKKE #6 ---
227 if {_points} is between 0 and 38:
228 set {_item} to a enderchest named "&e&lPakke &e##&l6"
229 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
230 set line 2 of {_item}'s lore to "&a-&r Adgang til /fly"
231 set line 3 of {_item}'s lore to "&eDu har adgang i &d7 dage!"
232 set line 4 of {_item}'s lore to "&eKun i Skyblock verdenen!"
233 set line 6 of {_item}'s lore to "&6Pris:&e 19 points"
234 set line 8 of {_item}'s lore to "&c&m--------------"
235 set line 9 of {_item}'s lore to "&eDu har ikke råd endnu!"
236 set line 10 of {_item}'s lore to "&c&m--------------"
237 format slot 31 of {_player} with {_item} to be unstealable
238
239 if {_points} is between 39 and 999999999999999:
240 set {_item} to a feather named "&e&lPakke &e##&l6"
241 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
242 set line 2 of {_item}'s lore to "&a-&r Adgang til /fly"
243 set line 3 of {_item}'s lore to "&eDu har adgang i &d7 dage!"
244 set line 4 of {_item}'s lore to "&eKun i Skyblock verdenen!"
245 set line 6 of {_item}'s lore to "&6Pris:&e 19 points"
246 format slot 31 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke6"]
247
248#subfold --- PAKKE #7 ---
249 if {_points} is between 0 and 38:
250 set {_item} to a enderchest named "&e&lPakke &e##&l7"
251 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
252 set line 2 of {_item}'s lore to "&a-&r Adgang til /god"
253 set line 3 of {_item}'s lore to "&eDu har adgang i &d7 dage!"
254 set line 4 of {_item}'s lore to "&eKun i Skyblock verdenen!"
255 set line 6 of {_item}'s lore to "&6Pris:&e 19 points"
256 set line 8 of {_item}'s lore to "&c&m--------------"
257 set line 9 of {_item}'s lore to "&eDu har ikke råd endnu!"
258 set line 10 of {_item}'s lore to "&c&m--------------"
259 format slot 33 of {_player} with {_item} to be unstealable
260
261 if {_points} is between 39 and 999999999999999:
262 set {_item} to a diamond helmet named "&e&lPakke &e##&l7"
263 set line 1 of {_item}'s lore to "&aDenne gave giver dig:"
264 set line 2 of {_item}'s lore to "&a-&r Adgang til /god"
265 set line 3 of {_item}'s lore to "&eDu har adgang i &d7 dage!"
266 set line 4 of {_item}'s lore to "&eKun i Skyblock verdenen!"
267 set line 6 of {_item}'s lore to "&6Pris:&e 19 points"
268 format slot 33 of {_player} with {_item} to close then run [invoke "jk-shop" from "%{_player}%" and "pakke7"]
269
270on inventory close:
271 remove all emeralds named "&3&l===&r &b&lPOINTS&r &3&l===" from player's inventory
272 remove all enderchest named "&e&lPakke &e##&l1" from player's inventory
273 remove all enderchest named "&e&lPakke &e##&l2" from player's inventory
274 remove all enderchest named "&e&lPakke &e##&l3" from player's inventory
275 remove all enderchest named "&e&lPakke &e##&l4" from player's inventory
276 remove all enderchest named "&e&lPakke &e##&l5" from player's inventory
277 remove all enderchest named "&e&lPakke &e##&l6" from player's inventory
278 remove all enderchest named "&e&lPakke &e##&l7" from player's inventory
279 remove all gold nuggets named "&e&lPakke &e##&l1" from player's inventory
280 remove all tripwire hooks named "&e&lPakke &e##&l2" from player's inventory
281 remove all tripwire hooks named "&e&lPakke &e##&l3" from player's inventory
282 remove all wait disc named "&e&lPakke &e##&l4" from player's inventory
283 remove all diamond pickaxe named "&e&lPakke &e##&l5" from player's inventory
284 remove all diamond axe named "&e&lPakke &e##&l6" from player's inventory
285 remove all diamond spade named "&e&lPakke &e##&l7" from player's inventory
286 delete {temp_::shop::%player's uuid%}
287
288on quit:
289 delete {temp_::shop::%player's uuid%}
290
291on script load:
292 delete {temp_::*}