· 9 years ago · Feb 28, 2017, 04:40 PM
1script options:
2 $ db url jdbc:mysql://xxx.xx.x.x:xxxx/-*-*-
3 $ db username -*-*-
4 $ db password -*-*-
5options:
6 p: &8[&3&lStats&8] &7
7on join:
8 set {_kills} to yaml value "kills" from file "../../GG-KitPvP/Stats/%uuid of player%.yml"
9 set {_killstreak} to yaml value "killstreak" from file "../../GG-KitPvP/Stats/%uuid of player%.yml"
10 set {_death} to yaml value "death" from file "../../GG-KitPvP/Stats/%uuid of player%.yml"
11 if {_kills} is not set:
12 set yaml value "kills" from file "../../GG-KitPvP/Stats/%uuid of player%.yml" to 0
13 if {_death} is not set:
14 set yaml value "death" from file "../../GG-KitPvP/Stats/%uuid of player%.yml" to 0
15 if {_killstreak} is not set:
16 set yaml value "killstreak" from file "../../GG-KitPvP/Stats/%uuid of player%.yml" to 0
17on load:
18 update "CREATE TABLE IF NOT EXISTS `stats` (`UUID` varchar(255),`kills` mediumint(255),`death` mediumint(255))"
19 update "CREATE TABLE IF NOT EXISTS `icosa` (`UUID` varchar(255),`icosa` mediumint(255))"
20command /topkills:
21 trigger:
22 message "{@p}Henter Top kills..."
23 set {_id0::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 0"
24 $ thread
25 set {_id1::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 1"
26 $ thread
27 set {_id2::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 2"
28 $ thread
29 set {_id3::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 3"
30 $ thread
31 set {_id4::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 4"
32 $ thread
33 set {_id5::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 5"
34 $ thread
35 set {_id6::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 6"
36 $ thread
37 set {_id7::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 7"
38 $ thread
39 set {_id8::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 8"
40 $ thread
41 set {_id9::*} to objects in column "uuid" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 9"
42 $ thread
43 set {_statsn0::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 0"
44 $ thread
45 set {_statsn1::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 1"
46 $ thread
47 set {_statsn2::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 2"
48 $ thread
49 set {_statsn3::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 3"
50 $ thread
51 set {_statsn4::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 4"
52 $ thread
53 set {_statsn5::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 5"
54 $ thread
55 set {_statsn6::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 6"
56 $ thread
57 set {_statsn7::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 7"
58 $ thread
59 set {_statsn8::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 8"
60 $ thread
61 set {_statsn9::*} to objects in column "kills" from result of query "SELECT * FROM `stats` ORDER BY `kills` DESC LIMIT 1 OFFSET 9"
62 send "&8&m----------&8=( &6&lTop 10 Kills&r &8)=&m----------&r"
63 set {_n} to 0
64 loop 10 times:
65 set {_navn} to "Ingen..."
66 set {_kills::*} to 0
67 set {_navn} to yaml value "navn" from file "../../GG-KitPvP/uuid/%{_id%{_n}%::*}%.yml"
68 set {_kills::*} to {_statsn%{_n}%::*}
69 add 1 to {_n}
70 send "&8[&a%{_n}%&8] &6%{_navn}% &8» &c%{_kills::*}%"
71command /icosatop:
72 trigger:
73 message "{@p}Henter Top icosa..."
74 set {_id0::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 0"
75 $ thread
76 set {_id1::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 1"
77 $ thread
78 set {_id2::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 2"
79 $ thread
80 set {_id3::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 3"
81 $ thread
82 set {_id4::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 4"
83 $ thread
84 set {_id5::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 5"
85 $ thread
86 set {_id6::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 6"
87 $ thread
88 set {_id7::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 7"
89 $ thread
90 set {_id8::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 8"
91 $ thread
92 set {_id9::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 9"
93 $ thread
94 set {_statsn0::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 0"
95 $ thread
96 set {_statsn1::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 1"
97 $ thread
98 set {_statsn2::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 2"
99 $ thread
100 set {_statsn3::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 3"
101 $ thread
102 set {_statsn4::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 4"
103 $ thread
104 set {_statsn5::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 5"
105 $ thread
106 set {_statsn6::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 6"
107 $ thread
108 set {_statsn7::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 7"
109 $ thread
110 set {_statsn8::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 8"
111 $ thread
112 set {_statsn9::*} to objects in column "icosa" from result of query "SELECT * FROM `icosa` ORDER BY `icosa` DESC LIMIT 1 OFFSET 9"
113 send "&8&m----------&8=( &6&lTop 10 Icosa&r &8)=&m----------&r"
114 set {_n} to 0
115 loop 10 times:
116 set {_navn} to "Ingen..."
117 set {_kills::*} to 0
118 set {_navn} to yaml value "navn" from file "../../GG-KitPvP/uuid/%{_id%{_n}%::*}%.yml"
119 set {_kills::*} to {_statsn%{_n}%::*}
120 add 1 to {_n}
121 send "&8[&a%{_n}%&8] &6%{_navn}% &8» &c%{_kills::*}%"
122
123command /stats [<offlineplayer>]:
124 trigger:
125 if arg-1 is not set:
126 set {_p} to "%uuid of player%"
127 set {_p1} to player
128 else:
129 set {_p1} to arg-1
130 if arg-1 is online:
131 set {_p} to "%uuid of arg-1%"
132 else:
133 set {_p} to yaml value "uuid" from file "../../GG-KitPvP/uuid/%arg-1%.yml"
134 set {_icosa} to yaml value "icosa" from file "../../GG-KitPvP/Stats/%{_p}%.yml"
135 set {_kills} to yaml value "kills" from file "../../GG-KitPvP/Stats/%{_p}%.yml"
136 set {_death} to yaml value "death" from file "../../GG-KitPvP/Stats/%{_p}%.yml"
137 set {_killstreak} to yaml value "killstreak" from file "../../GG-KitPvP/Stats/%{_p}%.yml"
138 if {_kills} is not set:
139 set {_kills} to 0
140 if {_icosa} is not set:
141 set {_icosa} to 0
142 if {_death} is not set:
143 set {_death} to 0
144 if {_killstreak} is not set:
145 set {_killstreak} to 0
146 set {_kdr} to {_kills} / {_death}
147 message "&8&m---&8=( &6&l%{_p1}%'s Stats &8)=&m----"
148 message "&6Kills&8: &c%{_kills}%"
149 message "&6Deaths&8: &c%{_death}%"
150 if {_death} is more than 0:
151 {_kills} is more than 0
152 message "&aKDR&8: &c%{_kdr} rounded to 2 decimal place%"
153 message "&6Killstreak&8: &c%{_killstreak}%"
154 message "&6Icosakills&8: &c%{_icosa}%"
155 message "&8&m----------------------"
156
157on join:
158 $ thread
159 set {_loop::*} to objects in column "uuid" from result of query "SELECT * FROM `stats`" and close
160 loop {_loop::*}:
161 add 1 to {_w}
162 loop-value is uuid of player:
163 set {_created} to true
164 exit loop
165 if {_w} is 100:
166 wait 1 ticks
167 if {_created} is true:
168 stop
169 $ thread
170 update "INSERT INTO `stats` (`uuid`, `kills`, `death`) VALUES ('%uuid of player%', '0', '0')"
171 $ thread
172 delete {_loop::*}
173 delete {_w}
174 delete {_created}
175on join:
176 set {_loop::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa`" and close
177 loop {_loop::*}:
178 add 1 to {_w}
179 loop-value is uuid of player:
180 set {_created} to true
181 exit loop
182 if {_w} is 100:
183 wait 1 ticks
184 if {_created} is true:
185 stop
186 $ thread
187 update "INSERT INTO `icosa` (`uuid`, `icosa`) VALUES ('%uuid of player%', '0')"
188command /mysqladdall:
189 permission: ggpvp.admin
190 trigger:
191 update "CREATE TABLE IF NOT EXISTS `stats` (`UUID` varchar(255),`kills` mediumint(255),`death` mediumint(255))"
192 $ thread
193 update "CREATE TABLE IF NOT EXISTS `icosa` (`UUID` varchar(255),`icosa` mediumint(255))"
194 $ thread
195 loop all players:
196 set {_loop::*} to objects in column "uuid" from result of query "SELECT * FROM `stats`" and close
197 $ thread
198 loop {_loop::*}:
199 add 1 to {_w}
200 loop-value-2 is uuid of loop-player:
201 set {_created} to true
202 exit loop
203 if {_w} is 100:
204 wait 1 ticks
205 {_created} is not true
206 send "%loop-player% added to STATS..." to all ops
207 $ thread
208 update "INSERT INTO `stats` (`uuid`, `kills`, `death`) VALUES ('%uuid of loop-player%', '0', '0')"
209 wait 3 ticks
210 delete {_loop::*}
211 delete {_w}
212 delete {_created}
213 loop all players:
214 send "test" to all ops
215 set {_loop::*} to objects in column "uuid" from result of query "SELECT * FROM `icosa`" and close
216 $ thread
217 loop {_loop::*}:
218 add 1 to {_w}
219 loop-value-2 is uuid of loop-player:
220 set {_created} to true
221 exit loop
222 if {_w} is 100:
223 wait 1 ticks
224 {_created} is not true
225 send "%loop-player% added to ICOSA" to all ops
226 $ thread
227 update "INSERT INTO `icosa` (`uuid`, `icosa`) VALUES ('%uuid of loop-player%', '0')"
228 wait 3 ticks
229 message " "
230 message "&c&lDONE"
231 message " "
232
233on death:
234 if attacker is a player:
235 set {_kills} to yaml value "kills" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml"
236 set {_killstreak} to yaml value "killstreak" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml"
237 set {_death} to yaml value "death" from file "../../GG-KitPvP/Stats/%uuid of victim%.yml"
238 set {_icosa} to yaml value "icosa" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml"
239 if {_kills} is not set:
240 set {_kills} to 0
241 if {_icosa} is not set:
242 set {_icosa} to 0
243 if {_death} is not set:
244 set {_death} to 0
245 if {_killstreak} is not set:
246 set {_killstreak} to 0
247 set {_uuid.vic::*} to uuid of victim
248 set {_uuid.att::*} to uuid of attacker
249 add 1 to {_killstreak}
250 add 1 to {_kills}
251 add 1 to {_death}
252 set yaml value "kills" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml" to {_kills}
253 set yaml value "killstreak" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml" to {_killstreak}
254 set yaml value "killstreak" from file "../../GG-KitPvP/Stats/%uuid of victim%.yml" to 0
255 set yaml value "death" from file "../../GG-KitPvP/Stats/%uuid of victim%.yml" to {_death}
256 $ thread
257 update "UPDATE `stats` SET `death` = '%{_death}%' WHERE `stats`.`uuid` ='%{_uuid.vic::*}%'"
258 $ thread
259 update "UPDATE `stats` SET `kills` = '%{_kills}%' WHERE `stats`.`uuid` ='%{_uuid.att::*}%'"
260 $ thread
261 update "UPDATE `icosa` SET `icosa` = '%{_icosa}%' WHERE `icosa`.`uuid` ='%uuid of attacker%'"
262
263on death of a player:
264 attacker is a player
265 add 1 to {icosa::%uuid of attacker%}
266 set {icosa.tid::%uuid of attacker%} to 10
267 if {icosa::%uuid of attacker%} is 2:
268 send "&a&lDOUBLE KILL (2)" to attacker
269 remove speed from the attacker
270 wait 1 ticks
271 apply speed 2 to attacker for 10 seconds
272 stop
273 if {icosa::%uuid of attacker%} is 3:
274 send "&a&lTRIPLE KILL (3)" to attacker
275 remove speed from the attacker
276 wait 1 ticks
277 apply speed 2 to attacker for 10 seconds
278 stop
279 if {icosa::%uuid of attacker%} is 4:
280 send "&a&lQUADRA KILL (4)" to attacker
281 remove speed from the attacker
282 wait 1 ticks
283 apply speed 2 to attacker for 10 seconds
284 if {icosa::%uuid of attacker%} is 5:
285 send "&a&lPENTA KILL (5)" to attacker
286 remove speed from the attacker
287 wait 1 ticks
288 apply speed 2 to attacker for 10 seconds
289 stop
290 if {icosa::%uuid of attacker%} is 6:
291 send "&a&lHEXA KILL (6)" to attacker
292 remove speed from the attacker
293 wait 1 ticks
294 apply speed 2 to attacker for 10 seconds
295 stop
296 if {icosa::%uuid of attacker%} is 7:
297 send "&a&lSEPTA KILL (7)" to attacker
298 remove speed from the attacker
299 wait 1 ticks
300 apply speed 2 to attacker for 10 seconds
301 stop
302 if {icosa::%uuid of attacker%} is 8:
303 send "&a&lOCTA KILL (8)" to attacker
304 remove speed from the attacker
305 wait 1 ticks
306 apply speed 2 to attacker for 10 seconds
307 stop
308 if {icosa::%uuid of attacker%} is 9:
309 send "&a&lNONA KILL (9)" to attacker
310 remove speed from the attacker
311 wait 1 ticks
312 apply speed 2 to attacker for 10 seconds
313 stop
314 if {icosa::%uuid of attacker%} is 10:
315 send "&a&lDECA KILL (10)" to attacker
316 remove speed from the attacker
317 wait 1 ticks
318 apply speed 2 to attacker for 10 seconds
319 stop
320 if {icosa::%uuid of attacker%} is 11:
321 send "&a&lHENDECA KILL (11)" to attacker
322 remove speed from the attacker
323 wait 1 ticks
324 apply speed 2 to attacker for 10 seconds
325 stop
326 if {icosa::%uuid of attacker%} is 12:
327 send "&a&lDODECA KILL (12)" to attacker
328 remove speed from the attacker
329 wait 1 ticks
330 apply speed 2 to attacker for 10 seconds
331 stop
332 if {icosa::%uuid of attacker%} is 13:
333 send "&a&lTRIDECA KILL (13)" to attacker
334 remove speed from the attacker
335 wait 1 ticks
336 apply speed 2 to attacker for 10 seconds
337 stop
338 if {icosa::%uuid of attacker%} is 14:
339 send "&a&lQUADECA KILL (14)" to attacker
340 remove speed from the attacker
341 wait 1 ticks
342 apply speed 2 to attacker for 10 seconds
343 stop
344 if {icosa::%uuid of attacker%} is 15:
345 send "&a&lPENDECA KILL (15)" to attacker
346 remove speed from the attacker
347 wait 1 ticks
348 apply speed 2 to attacker for 10 seconds
349 stop
350 if {icosa::%uuid of attacker%} is 16:
351 send "&a&lHEXDECA KILL (16)" to attacker
352 remove speed from the attacker
353 wait 1 ticks
354 apply speed 2 to attacker for 10 seconds
355 stop
356 if {icosa::%uuid of attacker%} is 17:
357 send "&a&lSEPDECA KILL (17)" to attacker
358 remove speed from the attacker
359 wait 1 ticks
360 apply speed 2 to attacker for 10 seconds
361 stop
362 if {icosa::%uuid of attacker%} is 18:
363 send "&a&lOCTDECA KILL (18)" to attacker
364 remove speed from the attacker
365 wait 1 ticks
366 apply speed 2 to attacker for 10 seconds
367 stop
368 if {icosa::%uuid of attacker%} is 19:
369 send "&a&lNONDECA KILL (19)" to attacker
370 remove speed from the attacker
371 wait 1 ticks
372 apply speed 2 to attacker for 10 seconds
373 stop
374 if {icosa::%uuid of attacker%} is 20:
375 remove speed from the attacker
376 wait 1 ticks
377 apply speed 2 to attacker for 10 seconds
378 play "WITHER_DEATH" to player at volume 0.5
379 broadcast "&8[&3&lGGPVP&8] &6&l%attacker% &a&lHar fået &c&lICOSAKILL!"
380 set {_icosa} to yaml value "icosa" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml"
381 add 1 to {_icosa}
382 set yaml value "icosa" from file "../../GG-KitPvP/Stats/%uuid of attacker%.yml" to {_icosa}
383 $ thread
384 update "UPDATE `icosa` SET `icosa` = '%{_icosa}%' WHERE `icosa`.`uuid` ='%uuid of attacker%'"
385 loop 3 times:
386 launch creeper firework colored red at player timed 0.5
387 launch creeper firework colored red at player timed 0
388 launch creeper firework colored red at player timed 1
389 wait 15 tick
390command /giveicosa <player>:
391 permission: ggpvp.admin
392 trigger:
393 remove speed from the arg-1
394 wait 1 ticks
395 apply speed 2 to arg-1 for 10 seconds
396 play "WITHER_DEATH" to player at volume 0.5
397 broadcast "&8[&3&lGGPVP&8] &6&l%arg-1% &a&lHar fået &c&lICOSAKILL!"
398 set {_icosa} to yaml value "icosa" from file "../../GG-KitPvP/Stats/%uuid of arg-1%.yml"
399 add 1 to {_icosa}
400 set yaml value "icosa" from file "../../GG-KitPvP/Stats/%uuid of arg-1%.yml" to {_icosa}
401 $ thread
402 update "UPDATE `icosa` SET `icosa` = '%{_icosa}%' WHERE `icosa`.`uuid` ='%uuid of arg-1%'"
403 loop 3 times:
404 launch creeper firework colored red at player timed 0.5
405 launch creeper firework colored red at player timed 0
406 launch creeper firework colored red at player timed 1
407 wait 15 tick
408
409every 2 second:
410 loop all players:
411 wait 0.5 tick
412 if {icosa.tid::%uuid of loop-player%} is more than 1:
413 remove 2 from {icosa.tid::%uuid of loop-player%}
414 else:
415 delete {icosa::%uuid of loop-player%}
416on skript load:
417 delete {icosa.tid::*}
418 delete {icosa::*}