· 6 years ago · Aug 01, 2019, 04:18 AM
1#-ZAC-0.5
2
3#-----Table of Contents-----
4
5#-----1. Functions-----
6
7#-----2. Join Handlers----- (removed for now)
8
9#-----3. Staffmode Handler-----
10
11#-----4. AntiCheat-----
12
13#-----5. AutoClicker-----
14
15#-----6. AntiKockBackA-----
16
17#-----7. AntiKnockbackB-----
18
19#-----8. Reach-----
20
21#-----9. Flight-----
22
23#-----10. CommandHandler-----
24
25
26#function createConfig(n: number) :: number:
27# set "Config.prefix" to "&7[&e&lZAC&7]" in yaml file "plugins/ZAC/config.yml"
28# set "Config.Judgement-day" to "true" in yaml file "plugins/ZAC/config.yml"
29# set "Config.Tempban-Time" to "1800" in yaml file "plugins/ZAC/config.yml"
30# set "Config.Anti-Knockback.Delay" to "25" in yaml file "plugins/ZAC/config.yml"
31
32
33function auraCheck(p: player):
34 delete {fuck.list::*}
35 add "ZAC" to {fuck.list::*}
36 #add "ZAC420" to {fuck.list::*}
37 #add "ZAC920" to {fuck.list::*}
38 #add "ZAC911" to {fuck.list::*}
39 #add "ZAC619" to {fuck.list::*}
40 #add "ZAC555" to {fuck.list::*}
41 #add "ZAC666" to {fuck.list::*}
42 #add "ZAC819" to {fuck.list::*}
43 set {_name} to a random element of {fuck.list::*}
44 set {_number} to a random element of {numberz.list::*}
45 create a citizen named "%{_name}%" at location of {auracage}
46 loop all entities:
47 loop 1 times:
48 "%name of loop-entity%" is "%{_name}%"
49 if loop-entity is not {_p}:
50 hide loop-entity from all players
51 wait 1 tick
52 set {zac.kacheck.%{_p}%} to true
53 set {_pos} to position of block 3.2 meters above {_p}'s head
54 teleport loop-entity to {_pos}
55 reveal loop-entity to {_p}
56 wait 0.2 seconds
57 set {_pos} to position of block 2.7 meters above {_p}'s head
58 teleport loop-entity to {_pos}
59 wait 0.2 seconds
60 set {_pos} to position of block 2.5 meters above {_p}'s head
61 teleport loop-entity to {_pos}
62 wait 0.2 seconds
63 set {_pos} to position of block 2.5 meters above {_p}'s head
64 teleport loop-entity to {_pos}
65
66 wait 0.2 seconds
67 set {_pos} to position of block 2.5 meters above {_p}'s head
68 set {_posn} to position of block 1.5 meters north of {_pos}
69 teleport loop-entity to {_posn}
70 wait 0.2 seconds
71 set {_pos} to position of block 2.5 meters above {_p}'s head
72 set {_pose} to position of block 1.5 meters east of {_pos}
73 teleport loop-entity to {_pose}
74 wait 0.2 seconds
75 set {_pos} to position of block 2.5 meters above {_p}'s head
76 set {_poss} to position of block 1.5 meters south of {_pos}
77 teleport loop-entity to {_poss}
78 wait 0.2 seconds
79 set {_pos} to position of block 2.5 meters above {_p}'s head
80 set {_posw} to position of block 1.5 meters west of {_pos}
81 teleport loop-entity to {_posw}
82 wait 0.2 seconds
83 set {_pos} to position of block 2.5 meters above {_p}'s head
84 set {_posn} to position of block 1.5 meters north of {_pos}
85 teleport loop-entity to {_posn}
86 wait 0.2 seconds
87 set {_pos} to position of block 2.5 meters above {_p}'s head
88 teleport loop-entity to {_pos}
89 teleport loop-entity to {auracage}
90 hide loop-entity to all players
91 kill loop-entity
92 #execute command "npc remove all"
93
94function auraCheckNorth(p: player):
95 delete {fuck.list::*}
96 add "ZAC" to {fuck.list::*}
97 set {_name} to a random element of {fuck.list::*}
98 create a citizen named "%{_name}%" at location of {auracage}
99 loop all entities:
100 loop 1 times:
101 "%name of loop-entity%" is "%{_name}%"
102 if loop-entity is not {_p}:
103 hide loop-entity from all players
104 wait 1 tick
105 set {zac.kacheck.%{_p}%} to true
106 set {_pos} to position of block 3.2 meters above {_p}'s head
107 teleport loop-entity to {_pos}
108 reveal loop-entity to {_p}
109 wait 0.2 seconds
110 set {_pos} to position of block 2.7 meters above {_p}'s head
111 teleport loop-entity to {_pos}
112 wait 0.2 seconds
113 set {_pos} to position of block 2.5 meters above {_p}'s head
114 teleport loop-entity to {_pos}
115 wait 0.2 seconds
116 set {_pos} to position of block 2.7 meters above {_p}'s head
117 teleport loop-entity to {_pos}
118
119 wait 0.2 seconds
120 set {_pos} to position of block 2.7 meters above {_p}'s head
121 set {_posn} to position of block 1.5 meters north of {_pos}
122 teleport loop-entity to {_posn}
123 wait 0.1 seconds
124 set {_pos} to position of block 2.5 meters above {_p}'s head
125 set {_posn} to position of block 1.1 meters north of {_pos}
126 set {_posne} to position of block 1 meters east of {_posn}
127 teleport loop-entity to {_posne}
128 wait 0.1 seconds
129 set {_pos} to position of block 2.7 meters above {_p}'s head
130 set {_posn} to position of block 1.1 meters north of {_pos}
131 set {_posne} to position of block 1.5 meters east of {_posn}
132 teleport loop-entity to {_posne}
133 wait 0.1 seconds
134 set {_pos} to position of block 2.3 meters above {_p}'s head
135 set {_posn} to position of block 1.1 meters north of {_pos}
136 set {_posne} to position of block 2 meters east of {_posn}
137 teleport loop-entity to {_posne}
138
139 wait 0.1 seconds
140 set {_pos} to position of block 2.3 meters above {_p}'s head
141 set {_posn} to position of block 1.1 meters north of {_pos}
142 teleport loop-entity to {_posn}
143 wait 0.1 seconds
144 set {_pos} to position of block 2.3 meters above {_p}'s head
145 set {_posn} to position of block 1.1 meters north of {_pos}
146 set {_posnw} to position of block 1 meters west of {_posn}
147 teleport loop-entity to {_posnw}
148 wait 0.1 seconds
149 set {_pos} to position of block 2.3 meters above {_p}'s head
150 set {_posn} to position of block 1.1 meters north of {_pos}
151 set {_posnw} to position of block 1.5 meters west of {_posn}
152 teleport loop-entity to {_posnw}
153 wait 0.1 seconds
154 set {_pos} to position of block 2.3 meters above {_p}'s head
155 set {_posn} to position of block 1.1 meters north of {_pos}
156 set {_posnw} to position of block 2 meters west of {_posn}
157 teleport loop-entity to {_posnw}
158 wait 0.1 seconds
159 set {_pos} to position of block 2.3 meters above {_p}'s head
160 set {_posn} to position of block 1.1 meters north of {_pos}
161 set {_posnw} to position of block 2 meters west of {_posn}
162 teleport loop-entity to {_posnw}
163 wait 0.1 seconds
164 set {_pos} to position of block 2.3 meters above {_p}'s head
165 set {_posn} to position of block 1.1 meters north of {_pos}
166 set {_posnw} to position of block 2 meters west of {_posn}
167 teleport loop-entity to {_posnw}
168 teleport loop-entity to {auracage}
169 hide loop-entity to all players
170 kill loop-entity
171
172function createFiles(n: number) :: number:
173 if folder "plugins/ZAC" doesn't exists:
174 create folder "plugins/ZAC"
175
176 create folder "plugins/ZAC/logs"
177
178 create folder "plugins/ZAC/logs/alerts"
179 if file "plugins/ZAC/config.yml" doesn't exists:
180 create file "plugins/ZAC/config.yml"
181 #createConfig(1)
182 if folder "plugins/ZAC/logs" doesn't exists:
183
184 create folder "plugins/ZAC/logs"
185
186 if folder "plugins/ZAC/logs/alerts" doesn't exists:
187
188 create folder "plugins/ZAC/logs/alerts"
189
190 if file "plugins/ZAC/logs/alerts/Click.txt" doesn't exists:
191
192 create file "plugins/ZAC/logs/alerts/Click.txt"
193
194 if file "plugins/ZAC/judgement.txt" doesn't exists:
195
196 create file "plugins/ZAC/judgement.txt"
197
198 if file "plugins/ZAC/logs/history.txt" doesn't exists:
199
200 create file "plugins/ZAC/logs/history.txt"
201
202 if file "plugins/ZAC/logs/test.txt" doesn't exists:
203
204 create file "plugins/ZAC/logs/test.txt"
205
206 if file "plugins/ZAC/logs/alerts/Reach.txt" doesn't exists:
207
208 create file "plugins/ZAC/logs/alerts/Reach.txt"
209
210 if file "plugins/ZAC/logs/alerts/Knockback.txt" doesn't exists:
211
212 create file "plugins/ZAC/logs/alerts/Knockback.txt"
213
214 if file "plugins/ZAC/logs/alerts/Flight.txt" doesn't exists:
215
216 create file "plugins/ZAC/logs/alerts/Flight.txt"
217
218
219#function loadConfig(n: number) :: number:
220# set {_prefix} to yaml value "Config.Prefix" from "ZAC/config.yml"
221#
222# set {zac.config.prefix} to "%colored {_prefix}%"
223#
224# set {zac.config.judgementday} to yaml value "Config.Judgement-Day" from "ZAC/config.yml"
225#
226# set {zac.config.antikbdelay} to yaml value "Config.Anti-Knockback.Delay" from "ZAC/config.yml"
227#
228# set {zac.config.tempbantime} to yaml value "Config.Tempban-Time" from "ZAC/config.yml"
229
230
231options:
232 #checkinterval: {zac.config.antikbdelay}
233 checkinterval: 30
234 tempbantime: 1800
235 #tempbantime: {zac.config.tempbantime}
236 prefix: &7[&e&lZAC&7]
237 #judgementday: {zac.config.judgementday}
238 judgementday: true
239 clickdetectitem: diamond axe or diamond sword or air or wood axe or wood sword or stone axe or stone sword or golden axe or golden sword or iron axe or iron sword
240 #jumppadcheck: barrier or red carpet or cobblestone wall or slimeblock or slab or stair or fence or stone slab or stonebrick slab
241 #redstonecheck: slimeblock or red carpet or slab or stair cobblestone wall or fence os stone slab or stonebrick slab
242
243function isTempBanned(p: player):
244 kick {_p} due to "&eZAC %nl% &cTemporarily banned for Unfair Advantage. %nl% %nl% Date: %{zac.tban.%{_p}%.date}%"
245
246
247function loginHandler(p: player):
248 set {inspawn.%{_p}%} to {_p}'s location
249 set {zac.isSpeeding.%{_p}%} to 0
250 set {zac.didenderpearl.%{_p}%} to 0
251 set {zac.didwalkonjumppad.%{_p}%} to 0
252 set {zac.isFighting.%{_p}%} to 0
253 set {kbtimer.%{_p}%} to 0
254 set {zac.click.%{_p}%} to 0
255 set {logintimer.%{_p}%} to 30
256
257 wait 30 seconds
258
259 set {logintimer.%{_p}%} to 0
260
261
262
263function saveInventory(p: player):
264 delete {zac.helmet.%{_p}%}
265 delete {zac.chestplate.%{_p}%}
266 delete {zac.leggings.%{_p}%}
267 delete {zac.boots.%{_p}%}
268 wait 1 tick
269 set {zac.inventory.%{_p}%} to serialized contents of {_p}'s inventory
270 set {zac.helmet.%{_p}%} to {_p}'s helmet
271 set {zac.chestplate.%{_p}%} to {_p}'s chestplate
272 set {zac.leggings.%{_p}%} to {_p}'s leggings
273 set {zac.boots.%{_p}%} to {_p}'s boots
274 wait 1 tick
275
276
277function restoreInventory(p: player):
278 clear inventory of {_p}
279 set {_p}'s inventory's serialized contents to {zac.inventory.%{_p}%}
280 set {_p}'s helmet to {zac.helmet.%{_p}%}
281 set {_p}'s chestplate to {zac.chestplate.%{_p}%}
282 set {_p}'s leggings to {zac.leggings.%{_p}%}
283 set {_p}'s boots to {zac.boots.%{_p}%}
284
285
286function quitHandler(p: player):
287 delete {zac.%{_p}%.alerts}
288 set {zac.click.%{_p}%} to 0
289# if {zac.staffmode.%{_p}%} is true:
290# restoreInventory(_p)
291# set {zac.staffmode.%{_p}%} to false
292
293
294function sendAlert(t: text):
295 loop all players:
296 if loop-player has permission "zac.mod":
297 if {zac.%loop-player%.alerts} is set:
298 send "%{_t}%" to loop-player
299
300
301function staffAlert(t: text):
302 loop all players:
303 if loop-player has permission "zac.mod":
304 send "%{_t}%" to loop-player
305
306
307function viewCPS(p: player, p2: player):
308 add {_p2} to {zac.cpslist.%{_p}%::*}
309 send "{@prefix} CPS enabled" to {_p}
310
311
312function clearViolations(p: player):
313 set {improbable.%{_p}%} to 0
314 set {possibleimprobable.%{_p}%} to 0
315 set {combinedimprobable.%{_p}%} to 0
316 set {reachcombined.%{_p}%} to 0
317 set {reachpossible.%{_p}%} to 0
318 set {reachimprobable.%{_p}%} to 0
319 set {knockback.%{_p}%} to 0
320 set {knockbackb.%{_p}%} to 0
321 set {zac.fly.%{_p}%} to 0
322 set {zac.speedA.%{_p}%} to 0
323 #send "{@prefix} Violations cleared for %{_p}%" to {_p}
324
325
326function viewViolations(p: player, p2: player):
327 send "{@prefix} &a%{_p2}%" to {_p}
328 send "{@prefix} &aSwing SpeedA: %{improbable.%{_p2}%}%" to {_p}
329 send "{@prefix} &aSwing SpeedB: %{possibleimprobable.%{_p2}%}%" to {_p}
330 send "{@prefix} &aSwing SpeedC: %{combinedimprobable.%{_p2}%}%" to {_p}
331 send "{@prefix} &aReachA: %{reachimprobable.%{_p2}%}%" to {_p}
332 send "{@prefix} &aReachB: %{reachcombined.%{_p2}%}%" to {_p}
333 send "{@prefix} &aReachC: %{reachpossible.%{_p2}%}%" to {_p}
334 send "{@prefix} &aKnockBackA: %{knockback.%{_p2}%}%" to {_p}
335 send "{@prefix} &aKnockBackB: %{knockbackb.%{_p2}%}%" to {_p}
336 send "{@prefix} &aFlyA: %{zac.fly.%{_p2}%}%" to {_p}
337 send "{@prefix} &aSpeedA: %{zac.speedA.%{_p}%}%" to {_p}
338
339
340function broadcast(t: text):
341 loop all players:
342 send "%{_t}%" to loop-player
343
344
345function saveViolations(p: player):
346 wf "[%now%] %{_p}% was ZAC banned. Improbable: %{improbable.%{_p}%}% Possible: %{possibleimprobable.%{_p}%}% Combined: %{combinedimprobable.%{_p}%}% ReachImprob: %{reachimprobable.%{_p}%}% ReachCombined: %{combinedimprobable.%{_p}%}% ReachPossible: %{possibleimprobable.%{_p}%}% KnockBackA: %{knockback.%{_p}%}% KnockBackB: %{knockbackb.%{_p}%}% FlyA: %{zac.fly.%{_p2}%}%" to "plugins/ZAC/logs/history.txt"
347 clearViolations({_p})
348
349function tempBan(p: player):
350 set {zac.tban.%{_p}%.date} to "%now%"
351 add 1 to {history.%{_p}%}
352 set {zac.tban.%{_p}%} to true
353 kick {_p} due to "[&eZAC&7] %nl% &cTemporarily banned for Unfair Advantage"
354 broadcast("{@prefix} %{_p}% &cwas temporarily banned for Unfair Advantage")
355 set {zac.tbantimer.%{_p}%} to {@tempbantime}
356 saveViolations({_p})
357
358
359function unBan(p: offline player, p2: offline player):
360 if {zac.tban.%{_p2}%} is true:
361 set {zac.tban.%{_p2}%} to false
362 set {zac.tbantimer.%{_p2}%} to 0
363 clear {zac.tban.%{_p2}%.date}
364 staffAlert("{@prefix} &c%{_p2}% was unbanned by %{_p}%")
365 wf "[%now%] %{_p2}% was unbanned by %{_p}%." to "plugins/ZAC/logs/history.txt"
366
367function unBanConsole(p: offline player):
368 if {zac.tban.%{_p}%} is true:
369 set {zac.tban.%{_p}%} to false
370 set {zac.tbantimer.%{_p}%} to 0
371 clear {zac.tban.%{_p}%.date}
372 staffAlert("{@prefix} &c%{_p}% was unbanned by console")
373 wf "[%now%] %{_p2}% was unbanned by console." to "plugins/ZAC/logs/history.txt"
374
375
376function judgementAdd(p: player, t: text):
377 add {_p} to {judgementday.list::*}
378 wf "[%now%] %{_p}% added for %{_t}%" to "plugins/ZAC/judgement.txt"
379 set {judgementday.reason.%{_p}%} to "[%now%] %{_p}% added for %{_t}%"
380
381
382function judgementBan(p: player):
383 set {zac.jban.%{_p}%.date} to "%now%"
384 set {zac.jban.%{_p}%} to true
385 kick {_p} due to "[&eZAC&7] %nl% &cJUDGEMENT DAY"
386 broadcast("{@prefix} %{_p}% &cwas purged from the server")
387
388
389function judgementSelection(n: number) :: number:
390 loop {judgementday.list::*}:
391 set {_rp} to a random element of {judgementday.list::*}
392 if {zac.jban.%{_rp}%} is true:
393 remove {_rp} from {judgementday.list::*}
394 stop
395 judgementBan({_rp})
396
397
398function judgementDay(n: number) :: number:
399 set {_temp} to size of {judgementday.list::*}
400 loop {_temp} times:
401 wait 1 seconds
402 judgementSelection(1)
403 wait 4 seconds
404 add 1 to {_loop}
405 if {_loop} is {_temp}:
406 broadcast("{@prefix} &cJudgement Day over. Thank you everyone for participating.")
407
408
409function randomTP(p: player):
410 set {_randomperson.%{_p}%} to a random player out of all players
411
412 if {_randomperson.%{_p}%} is {_p}:
413
414 delete {_randomperson.%{_p}%}
415
416 set {_randomperson.%{_p}%} to a random player out of all players
417
418 teleport {_p} to {_randomperson.%{_p}%}
419 if {_lastperson.%{_p}%} is not {_randomperson.%{_p}%}:
420
421 teleport {_p} to {_randomperson.%{_p}%}
422
423 set {_lastperson.%{_p}%} to {_randomperson.%{_p}%}
424
425 delete {_randomperson.%{_p}%}
426
427 if {_lastperson.%{_p}%} is {_randomperson.%{_p}%}:
428
429 set {_randomperson.%{_p}%} to a random player out of all players
430
431 teleport {_p} to {_randomperson.%{_p}%}
432
433
434function zacSidespect(p: player, p2: player):
435 wipe {_p2}'s sidebar
436 set name of sidebar of {_p2} to "&a%{_p2}%"
437 loop 26 times:
438 if {_p2}'s gamemode is survival:
439 set score "&a%{_p2}%: &4%health of {_p2}%" in sidebar of {_p2} to 10
440 else:
441 set score "&a%{_p2}%: &4In Creative" in sidebar of {_p2} to 10
442
443 set score "&aPing: %{_p2}'s ping%" in sidebar of {_p2} to 9
444 set score "&aCPS: %{zac.click.%{_p2}%}%" in sidebar of {_p2} to 8
445 wait 1 second
446 wait 15 seconds
447 wipe {_p2}'s sidebar
448 stop
449
450function speedCheckA(p: player):
451 if {_p} is not flying:
452 if {_p}'s gamemode is not creative:
453 if {zac.didenderpearl.%{_p}%} < 1:
454 if {zac.didwalkonjumppad.%{_p}%} < 1:
455 #if {zac.isFighting.%{_p}%} < 1:
456 create a citizen named "%{_p}%1" at {auracage}
457 loop all entities:
458 loop 1 times:
459 "%name of loop-entity%" is "%{_p}%1"
460 hide loop-entity from all players
461 wait 1 second
462 loop all entities:
463 loop 1 times:
464 "%name of loop-entity%" is "%{_p}%1"
465 # hide loop-entity from all players
466 teleport loop-entity to location of {_p}
467 wait 0.5 second
468 set {_dis} to distance between {_p} and loop-entity
469 #execute command "npc remove all"
470
471 if {_p} is sneaking:
472 if {_dis} >= 2:
473 sendAlert("{@prefix} &a%{_p}% is moving fast while sneaking : &e%{_dis}%")
474 add 10 to {zac.isSpeeding.%{_p}%}
475 add 1 to {zac.speedA.%{_p}%}
476 teleport {_p} to loop-entity
477 kill loop-entity
478 stop
479 else:
480 kill loop-entity
481
482 if {_p} has swiftness:
483 if {_dis} >= 4.7:
484 sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_dis}%")
485 add 2 to {zac.speedA.%{_p}%}
486 add 10 to {zac.isSpeeding.%{_p}%}
487 teleport {_p} to loop-entity
488 kill loop-entity
489 stop
490 else:
491 kill loop-entity
492 else:
493 if {_dis} >= 4.3:
494 sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_dis}%")
495 add 5 to {zac.speedA.%{_p}%}
496 add 10 to {zac.isSpeeding.%{_p}%}
497 teleport {_p} to loop-entity
498 kill loop-entity
499 stop
500 else:
501 kill loop-entity
502
503function speedCheck2(p: player):
504 if {zac.speedDetect.%{_p}%} does not exist:
505 set {zac.speedDetect.%{_p}%} to location of {_p}
506 if {_p} is not flying:
507 if {_p}'s gamemode is not creative:
508 if {_p}'s walk speed is greater than 1:
509 stop
510 if {_p}'s walk speed is less than 2:
511 if {zac.didenderpearl.%{_p}%} < 1:
512 if {zac.didwalkonjumppad.%{_p}%} < 1:
513 set {zac.fly.x.%{_p}%} to the x location of {_p}
514 set {zac.fly.z.%{_p}%} to the z location of {_p}
515 set {_loc} to location of {_p}
516 wait 0.5 second
517 set {zac.fly.x2.%{_p}%} to the x location of {_p}
518 set {zac.fly.z2.%{_p}%} to the z location of {_p}
519 wait 1 tick
520 if difference between {zac.fly.x.%{_p}%} and {zac.fly.x2.%{_p}%} is greater than 4:
521 set {_distance} to difference between {zac.fly.x.%{_p}%} and {zac.fly.x2.%{_p}%}
522 if {_distance} > 4.7:
523 if {_distance} < 7.1:
524 sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_distance}%")
525 add 5 to {zac.speedA.%{_p}%}
526 teleport {_p} to {zac.speedDetect.%{_p}%}
527 set {zac.didwalkonjumppad.%{_p}%} to 0
528 stop
529 if {_distance} > 7:
530 sendAlert("{@prefix} &a%{_p}% is moving extremely fast : &e%{_distance}%")
531 add 7 to {zac.speedA.%{_p}%}
532 teleport {_p} to {zac.speedDetect.%{_p}%}
533 set {zac.didwalkonjumppad.%{_p}%} to 0
534 stop
535 if difference between {zac.fly.z.%{_p}%} and {zac.fly.z2.%{_p}%} is greater than 4:
536 set {_distance} to difference between {zac.fly.z.%{_p}%} and {zac.fly.z2.%{_p}%}
537 if {_distance} > 4.7:
538 if {_distance} < 7.1:
539 sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_distance}%")
540 add 5 to {zac.speedA.%{_p}%}
541 teleport {_p} to {zac.speedDetect.%{_p}%}
542 set {zac.didwalkonjumppad.%{_p}%} to 0
543 stop
544 if {_distance} > 7:
545 sendAlert("{@prefix} &a%{_p}% is moving extremely fast : &e%{_distance}%")
546 add 7 to {zac.speedA.%{_p}%}
547 teleport {_p} to {zac.speedDetect.%{_p}%}
548 set {zac.didwalkonjumppad.%{_p}%} to 0
549 stop
550
551function speedCheck(p: player):
552 if {_p} is not flying:
553 if {_p}'s gamemode is not creative:
554 #if {_p}'s walk speed is greater than 1:
555 # stop
556 #if {_p}'s walk speed is less than 2:
557 if {zac.didenderpearl.%{_p}%} < 1:
558 if {zac.didwalkonjumppad.%{_p}%} < 1:
559 if {zac.isFighting.%{_p}%} < 1:
560 set {zac.fly.x.%{_p}%} to the x location of {_p}
561 set {zac.fly.z.%{_p}%} to the z location of {_p}
562 set {_loc} to location of {_p}
563 wait 0.5 second
564 set {zac.fly.x2.%{_p}%} to the x location of {_p}
565 set {zac.fly.z2.%{_p}%} to the z location of {_p}
566 wait 1 tick
567 if difference between {zac.fly.x.%{_p}%} and {zac.fly.x2.%{_p}%} is greater than 4:
568 set {_distance} to difference between {zac.fly.x.%{_p}%} and {zac.fly.x2.%{_p}%}
569 if {_distance} > 4.6:
570 if {_distance} < 7.1:
571 #sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_distance}%")
572 add 10 to {zac.isSpeeding.%{_p}%}
573 #add 1 to {zac.speedA.%{_p}%}
574 #teleport {_p} to {_loc}
575 #set {zac.didwalkonjumppad.%{_p}%} to 0
576 stop
577 if {_distance} > 7:
578 #sendAlert("{@prefix} &a%{_p}% is moving extremely fast : &e%{_distance}%")
579 add 10 to {zac.isSpeeding.%{_p}%}
580 #add 3 to {zac.speedA.%{_p}%}
581 #teleport {_p} to {_loc}
582 #set {zac.didwalkonjumppad.%{_p}%} to 0
583 stop
584 if difference between {zac.fly.z.%{_p}%} and {zac.fly.z2.%{_p}%} is greater than 4:
585 set {_distance} to difference between {zac.fly.z.%{_p}%} and {zac.fly.z2.%{_p}%}
586 if {_distance} > 4.6:
587 if {_distance} < 7.1:
588 #sendAlert("{@prefix} &a%{_p}% is moving fast : &e%{_distance}%")
589 add 10 to {zac.isSpeeding.%{_p}%}
590 #add 1 to {zac.speedA.%{_p}%}
591 #teleport {_p} to {_loc}
592 #set {zac.didwalkonjumppad.%{_p}%} to 0
593 stop
594 if {_distance} > 7:
595 #sendAlert("{@prefix} &a%{_p}% is moving extremely fast : &e%{_distance}%")
596 add 10 to {zac.isSpeeding.%{_p}%}
597 #add 3 to {zac.speedA.%{_p}%}
598 #teleport {_p} to {_loc}
599 #set {zac.didwalkonjumppad.%{_p}%} to 0
600 stop
601
602
603#function zacInspect(p: player, p2: player):
604# open chest with 6 rows named "&aInspect > &e&l%{_p2}%" to {_p}
605# set {_test} to chest
606# open {_test} with 6 rows named "&aInspect > &e&l%{_p}%" to {_p}
607# set {_slot} to 0
608# loop 35 times:
609# set {zac.inspect.%{_p2}%.%{_slot}%} to slot {_slot} of {_p2}'s inventory
610# add 1 to {_slot}
611# set {_slot} to 0
612# set {_slotmenu} to 18
613# wait 1 tick
614# loop 35 times:
615# format slot {_slotmenu} of {_p} with {zac.inspect.%{_p2}%.%{_slot}%} to close
616# add 1 to {_slot}
617# add 1 to {_slotmenu}
618# #wait 1 tick
619# set {_health.%{_p2}%} to {_p2}'s health
620# set {hunger.%{_p2}%} to {_p2}'s hunger
621# set {armorview.helmet.%{_p2}%} to {_p2}'s helmet
622# set {armorview.chestplate.%{_p2}%} to {_p2}'s chestplate
623# set {armorview.leggings.%{_p2}%} to {_p2}'s leggings
624# set {armorview.boots.%{_p2}%} to {_p2}'s boots
625# if {_p2}'s gamemode is survival:
626# format slot 3 of {_test} with {_testvariable} named "&aArmor" with lore "&6%{armorview.helmet.%{_p2}%}%||&6%{armorview.chestplate.%{_p2}%}%||&6%{armorview.leggings.%{_p2}%}%||&6%{armorview.boots.%{_p2}%}%" to close
627# format slot 8 of {_p} with clock named "&aRefresh" to close then run [make {_p} execute command "zac inspect %{_p2}%"]
628# else:
629# format slot 3 of {_p} with iron chestplate named "&aArmor" with lore "&cIn Creative" to close
630# format slot 8 of {_p} with clock named "&aRefresh" to close then run [make {_p} execute command "zac inspect %{_p2}%"]
631# loop 26 times:
632# if {_p2}'s gamemode is survival:
633# format slot 4 of {_p} with {_p2}'s skull named "&aPlayer: %{_p2}%" with lore "&aHealth: &4%{_health.%{_p2}%}% ❤" to close
634# else:
635# format slot 4 of {_p} with {_p2}'s skull named "&a&n%{_p2}%" with lore "&4In Creative ❤" to close
636# if {_p2} is flying:
637# format slot 5 of {_p} with book named "&aInformation" with lore "&7[&e&lZAC&7] &5Ping: %{_p2}'s ping% &5Temp Bans: %{history.%{_p2}%}% Flying: true &7Click to view ZAC violations" to run [make {_p} execute command "zac info %{_p2}%"]
638# if {_p2} is not flying:
639# format slot 5 of {_p} with book named "&aInformation" with lore "&7[&e&lZAC&7] &5Ping: %{_p2}'s ping% &5Temp Bans: %{history.%{_p2}%}% Flying: false &7Click to view ZAC violations" to run [make {_p} execute command "zac info %{_p2}%"]
640# format slot 0 of {_p} with diamond sword named "&aClicks Per Second" with lore "%{zac.click.%{_p2}%}%" to close
641# wait 1 second
642
643
644function antiVPN(p: player):
645 set {_ip} to "%ip of {_p}%"
646 set {_info} to text from "http://legacy.iphub.info/api.php?ip=%{_ip}%&showtype=4"
647 set {_info::*} to {_info} split at ",""asn"":"
648 set {_info} to {_info::2}
649 replace all "}" with "" in {_info}
650 if {_info} contains "ARETI-AS" or "EGIHostings" or "EGIHosting" or "anchorfree" or "Netherlands" or "NFORCE" or "Leaseweb" or "M247" or "PLI-AS" or "HostUS" or "IOMART-AS" or "WideOpenWest" or "Choopa":
651 wf "[%now%] %{_p}% tried to join with IP %ip of {_p}%" to "plugins/ZAC/logs/history.txt"
652 kick {_p} due to "&7[&eZAC&7] &ckicked from the server. Try again without a VPN."
653 staffAlert("{@prefix} &a%{_p}% tried to join on a VPN")
654
655function toggleSpeed(n: number) :: number:
656 if {zac.lookfor.speed} is false:
657 set {zac.lookfor.speed} to true
658 stop
659 if {zac.lookfor.speed} is true:
660 set {zac.lookfor.speed} to false
661 stop
662 if {zac.lookfor.speed} doesn't exist:
663 set {zac.lookfor.speed} to true
664 stop
665
666function toggleFlight(n: number) :: number:
667 if {zac.lookfor.flight} is false:
668 set {zac.lookfor.flight} to true
669 stop
670 if {zac.lookfor.flight} is true:
671 set {zac.lookfor.flight} to false
672 stop
673 if {zac.lookfor.flight} doesn't exist:
674 set {zac.lookfor.flight} to true
675 stop
676
677function toggleReach(n: number) :: number:
678 if {zac.lookfor.reach} is false:
679 set {zac.lookfor.reach} to true
680 stop
681 if {zac.lookfor.reach} is true:
682 set {zac.lookfor.reach} to false
683 stop
684 if {zac.lookfor.reach} doesn't exist:
685 set {zac.lookfor.reach} to true
686 stop
687
688function adminCommand(p: player):
689 open chest with 3 rows named "&2ZAC > &2Admin-Panel" to {_p}
690 if {zac.lookfor.speed} doesn't exist:
691 set {zac.lookfor.speed} to true
692 if {zac.lookfor.flight} doesn't exist:
693 set {zac.lookfor.flight} to true
694 if {zac.lookfor.reach} doesn't exist:
695 set {zac.lookfor.reach} to true
696 if {zac.lookfor.speed} is true:
697 format slot 0 of {_p} with sugar named "&aSpeed Check" with lore "&7Speed Check: &2ON &7(click to turn off) debug: %{zac.lookfor.speed}%" to close then run [make {_p} execute command "zac toggle speed"]
698 if {zac.lookfor.speed} is false:
699 format slot 0 of {_p} with sugar named "&aSpeed Check" with lore "&7Speed Check: &cOFF &7(click to turn on) debug: %{zac.lookfor.speed}%" to close then run [make {_p} execute command "zac toggle speed"]
700 if {zac.lookfor.flight} is true:
701 format slot 2 of {_p} with feather named "&aFlight Check" with lore "&7Flight Check: &2ON &7(click to turn off) debug: %{zac.lookfor.flight}%" to close then run [make {_p} execute command "zac toggle flight"]
702 if {zac.lookfor.flight} is false:
703 format slot 2 of {_p} with feather named "&aFlight Check" with lore "&7Flight Check: &cOFF &7(click to turn on) debug: %{zac.lookfor.flight}%" to close then run [make {_p} execute command "zac toggle flight"]
704 if {zac.lookfor.reach} is true:
705 format slot 4 of {_p} with lead named "&aReach Check" with lore "&7Reach Check: &2ON &7(click to turn off) debug: %{zac.lookfor.reach}%" to close then run [make {_p} execute command "zac toggle reach"]
706 if {zac.lookfor.reach} is false:
707 format slot 4 of {_p} with lead named "&aReach Check" with lore "&7Reach Check: &cOFF &7(click to turn off) debug: %{zac.lookfor.reach}%" to close then run [make {_p} execute command "zac toggle reach"]
708
709function mainCommand(p: player):
710 open chest with 3 rows named "&2ZAC > &2Anti-Cheat" to {_p}
711 format slot 4 of {_p} with sunflower named "&2/zac admin" with lore "&7Opens admin panel" to close then run [make {_p} execute command "zac admincommand"]
712 format slot 9 of {_p} with book named "&2/zac info (player)" with lore "&7View a player's Violations" to close
713 format slot 11 of {_p} with redstone torch named "&2/zac alerts" with lore "&7Toggles on/off Violation alerts" to close
714 format slot 15 of {_p} with iron sword named "&2/zac cps (player)" with lore "&7View a player's live CPS, /zac cps, to toggle off" to close
715 format slot 17 of {_p} with paper named "&2/zac history (player)" with lore "&7View a player's tempban history" to close
716
717#-----Join Handlers-----
718on join:
719# antiVPN(player)
720 loginHandler(player)
721 if {zac.tban.%player%} is true:
722
723 set join message to ""
724
725 isTempBanned(player)
726 if {zac.jban.%player%} is true:
727 set join message to ""
728 kick player due to "&eZAC %nl% &cJudgement Day. %nl% %nl% Date: %{zac.jban.%{_p}%.date}%"
729 staffAlert("{@prefix} &c%player% tried to join but is J-Banned!")
730
731
732on quit:
733 quitHandler(player)
734 if {zac.staffmode.%player%} is true:
735 restoreInventory(player)
736 set {zac.staffmode.%player%} to false
737
738on load:
739 if folder "plugins/ZAC" doesn't exists:
740 createFiles(1)
741on death:
742 set {zac.didwalkonjumppad.%player%} to 7
743
744#-----Staffmode Handler-----
745
746on damage of player:
747 victim's name is "ZAC":
748 sendAlert("{@prefix} %victim% &afailed Kill aura check")
749 victim's name is "ZAC420":
750 sendAlert("{@prefix} %victim% &afailed Kill aura check")
751 victim's name is "ZAC920":
752 sendAlert("{@prefix} %victim% &afailed Kill aura check")
753 victim's name is "ZAC911":
754 sendAlert("{@prefix} %victim% &afailed Kill aura check")
755 victim's name is "ZAC619":
756 sendAlert("{@prefix} %victim% &afailed Kill aura check")
757 victim's name is "ZAC555":
758 sendAlert("{@prefix} %victim% &afailed Kill aura check")
759 victim's name is "ZAC666":
760 sendAlert("{@prefix} %victim% &afailed Kill aura check")
761 victim's name is "ZAC819":
762 sendAlert("{@prefix} %victim% &afailed Kill aura check")
763
764on npc left click:
765 sendAlert("{@prefix} %player% &afailed Kill aura check")
766#on npc damage by an entity:
767# sendAlert("{@prefix} %event-entity% &afailed Kill aura check")
768on pick up:
769
770 if {zac.staffmode.%player%} is true:
771
772 cancel the event
773
774on damage:
775
776 if {zac.staffmode.%victim%} is true:
777
778 cancel the event
779
780 if {zac.staffmode.%attacker%} is true:
781
782 cancel the event
783
784on drop:
785
786 if {zac.staffmode.%player%} is true:
787
788 cancel the event
789
790on inventory click:
791
792 if {zac.staffmode.%player%} is true:
793
794 cancel the event
795
796on respawn:
797 if {zac.staffmode.%player%} is true:
798 restoreInventory(player)
799 set {zac.staffmode.%player%} to false
800
801on rightclick with stick:
802
803 if {zac.staffmode.%player%} is true:
804
805 targeted entity is a player
806
807 set {_target} to targeted entity
808
809 make player ride {_target}
810
811 send "{@prefix} &aYou are now riding &e%{_target}%" to player
812
813on rightclick with potato:
814
815 if {zac.staffmode.%player%} is true:
816
817 targeted entity is a player
818
819
820 set {_target} to targeted entity
821
822 make {_target} ride a saddled pig
823
824 set {_pig} to {_target}'s vehicle
825
826 #send "{@prefix} &aYou are now riding &e%{_target}%" to player
827
828# wait 5 ticks
829# while vehicle of {_target} is {_pig}:
830# change yaw of vehicle of {_target} to yaw of {_target}
831# change pitch of vehicle of {_target} to pitch of {_target}
832# wait 1 tick
833on leftclick with stick:
834
835 if {zac.staffmode.%player%} is true:
836
837 targeted entity is a player
838
839 set {_t.%player%} to targeted entity
840
841 push {_t.%player%} upwards at speed 3
842
843on rightclick with nether star:
844
845 if {zac.staffmode.%player%} is true:
846
847 execute player command "v"
848
849on rightclick with compass:
850
851 if {zac.staffmode.%player%} is true:
852
853 randomTP(player)
854
855on rightclick with book:
856
857 if {zac.staffmode.%player%} is true:
858 targeted entity is a player
859 set {_temp} to targeted entity
860 execute player command "zac info %{_temp}%"
861
862on rightclick with redstone block:
863
864 if {zac.staffmode.%player%} is true:
865 execute player command "zac staffmode off"
866
867#-----AntiCheat-----
868
869
870
871#-----AutoClicker-----
872
873
874on leftclick:
875 if player is holding {@clickdetectitem}:
876 add 1 to {zac.click.%player%}
877on block damage:
878 remove 1 from {zac.click.%player%}
879every 1 second:
880 loop all players:
881 if {zac.click.%loop-player%} >= 15:
882 if {zac.click.%loop-player%} < 20:
883 wf "[%now%] %loop-player% clicked really fast : %{zac.click.%loop-player%}% | ping : %loop-player's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Click.txt"
884 sendAlert("{@prefix} &a%loop-player% clicked really fast : &e%{zac.click.%loop-player%}%")
885 if loop-player's ping < 125:
886 if tps > 17:
887 add 5 to {improbable.%loop-player%}
888 add 2 to {hackdetect.%loop-player%}
889 if tps < 17:
890 add 1 to {possibleimprobable.%loop-player%}
891 if loop-player's ping > 125:
892
893 if tps > 17:
894
895 add 1 to {improbable.%loop-player%}
896
897 add 1 to {hackdetect.%loop-player%}
898
899 if tps < 17:
900
901 add 1 to {possibleimprobable.%loop-player%}
902 if {click.%loop-player%} > 19:
903
904 wf "[%now%] %loop-player% clicked extremely fast : %{zac.click.%loop-player%}% | ping : %loop-player's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Click.txt"
905
906 execute command "ai {@prefix} &a%loop-player% clicked really fast : &e%{zac.click.%loop-player%}%"
907
908 if loop-player's ping < 125:
909
910 if tps > 17:
911
912 add 10 to {improbable.%loop-player%}
913
914 add 3 to {hackdetect.%loop-player%}
915
916 if tps < 17:
917
918 add 3 to {possibleimprobable.%loop-player%}
919
920 add 1 to {hackdetect.%loop-player%}
921
922 if loop-player's ping > 125:
923
924 if tps > 17:
925
926 add 5 to {improbable.%loop-player%}
927
928 add 2 to {hackdetect.%loop-player%}
929
930 if tps < 17:
931
932 add 3 to {possibleimprobable.%loop-player%}
933
934 add 1 to {hackdetect.%loop-player%}
935
936 if {click.%loop-player%} > 23:
937
938 add 1 to {combinedimprobable.%loop-player%}
939
940 add 5 to {hackdetect.%loop-player%}
941 if {hackdetect.%loop-player%} >= 15:
942 judgementAdd(loop-player, "autoclicker")
943 tempBan(loop-player)
944 set {hackdetect.%loop-player%} to 0
945
946 if {combinedimprobable.%loop-player%} >= 10:
947 judgementAdd(loop-player, "autoclicker")
948 tempBan(loop-player)
949 set {combinedimprobable.%loop-player%} to 0
950 loop {zac.cpslist.%loop-player%::*}:
951 set {_randomperson} to a random element of {zac.cpslist.%loop-player%::*}
952 if {zac.click.%{_randomperson}%} > 0:
953 send "&7%{_randomperson}% &8[&a%{zac.click.%{_randomperson}%}%&8]" to loop-player
954 if {zac.isSpeeding.%loop-player%} > 0:
955 remove 1 from {zac.isSpeeding.%loop-player%}
956 speedCheck2(loop-player)
957 if {zac.isSpeeding.%loop-player%} = 0:
958 clear {zac.speedDetect.%loop-player%}
959 delete {zac.speedDetect.%loop-player%}
960 if {zac.speedA.%loop-player%} > 0:
961 remove 1 from {zac.speedA.%loop-player%}
962 if {zac.isFighting.%loop-player%} > 0:
963 remove 1 from {zac.isFighting.%loop-player%}
964 if {zac.speedA.%loop-player%} >= 25:
965 tempBan(loop-player)
966 set {zac.speedA.%loop-player%} to 0
967#-Some timers
968 if {zac.didwalkonjumppad.%loop-player%} >= 1:
969 remove 1 from {zac.didwalkonjumppad.%loop-player%}
970 if {zac.didenderpearl.%loop-player%} >= 1:
971 remove 1 from {zac.didenderpearl.%loop-player%}
972 if {zac.fly.%loop-player%} > 0:
973 remove 1 from {zac.fly.%loop-player%}
974 if {zac.tbantimer.%loop-player%} > 0:
975 remove 1 from {zac.tbantimer.%loop-player%}
976 if {zac.tbantimer.%loop-player%} = 0:
977 set {zac.tban.%loop-player%} to false
978 set {zac.click.%loop-player%} to 0
979#-More timers
980every 10 seconds:
981 loop all players:
982 if {hackdetect.%loop-player%} > 0:
983 reduce {hackdetect.%loop-player%} by 1
984 if {reachdetect.%loop-player%} > 0:
985 reduce {reachdetect.%loop-player%} by 1
986 if {reachcombined.%loop-player%} > 0:
987 reduce {reachcombined.%loop-player%} by 1
988 if loop-player is alive:
989 set {isalive.%loop-player%} to true
990 if loop-player is not alive:
991 set {isalive.%loop-player%} to false
992 if {kbtimer.%loop-player%} > 0:
993 reduce {kbtimer.%loop-player%} by 10
994 if {zac.fly.%loop-player%} > 20:
995 tempBan(loop-player)
996 judgementAdd(loop-player, "flight")
997 set {zac.fly.%loop-player%} to 0
998
999#-----AntiKockBackA-----
1000
1001
1002on damage of a player:
1003
1004 if victim's gamemode is survival or adventure:
1005
1006 if damage was caused by fall:
1007
1008 stop
1009
1010 if damage was caused by potion:
1011
1012 stop
1013
1014 if block behind victim is not air:
1015
1016 stop
1017
1018 if attacker is a player:
1019
1020 set {_loc1} to location of victim
1021
1022 wait 10 ticks
1023
1024 set {_loc2} to location of victim
1025
1026 block at victim is not cobweb:
1027
1028 victim is not riding:
1029
1030 distance between {_loc1} and {_loc2} = 0:
1031
1032 if victim's ping < 125:
1033
1034 add 3 to {knockback.%victim%}
1035
1036 if {kbtimer.%victim%} is less than 1:
1037
1038 sendAlert("{@prefix} &a%victim% might be using Anti-knockback")
1039
1040 wf "[%now%] %victim% did not move in combat | ping : %victim's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Knockback.txt"
1041
1042 add 10 to {kbtimer.%victim%}
1043
1044 if victim's ping > 125:
1045
1046 add 1 to {knockback.%victim%}
1047
1048 if {kbtimer.%victim%} is less than 1:
1049
1050 sendAlert("{@prefix} &a%victim% might be lagging or using anti-knockback")
1051
1052 wf "[%now%] %victim% did not move in combat | ping : %victim's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Knockback.txt"
1053
1054 add 10 to {kbtimer.%victim%}
1055
1056
1057#-----AntiKnockbackB-----
1058
1059
1060#every 60 seconds:
1061# loop all players:
1062# {logintimer.%loop-player-1%} is less than 1
1063# {isalive.%loop-player%} is true
1064# set {_og%loop-player-1%} to location of loop-player-1
1065# {inspawn.%loop-player-1%} is not {_og%loop-player-1%}
1066# loop-player-1 is alive
1067# set {_1%loop-player-1%} to location of loop-player-1
1068# wait 7 tick
1069# set {_2%loop-player%} to location of loop-player-1
1070# {_1%loop-player-1%} is {_2%loop-player-1%}
1071# block north of loop-player-1 is air or long grass or double long grass or sign
1072# set {_a%loop-player-1%} to loop-player-1's location
1073# push loop-player-1 north at speed .1
1074# wait 3 tick
1075# set {_b%loop-player-1%} to loop-player-1's location
1076# wait 1 tick
1077# teleport loop-player-1 to {_a%loop-player%}
1078# if {_a%loop-player-1%} is {_b%loop-player%}:
1079# add .3 to z-coord of {_a%loop-player%}
1080# block at {_a%loop-player%} is not lava or cactus or fire
1081# teleport loop-player-1 to {_a%loop-player%}
1082# loop-player-1 is alive
1083# set {_1%loop-player-1%} to location of loop-player-1
1084# wait 7 tick
1085# set {_2%loop-player%} to location of loop-player-1
1086# {_1%loop-player-1%} is {_2%loop-player-1%}
1087# block north of loop-player-1 is air or long grass or double long grass or sign
1088# set {_a%loop-player-1%} to loop-player-1's location
1089# push loop-player-1 north at speed .1
1090# wait 3 tick
1091# set {_b%loop-player-1%} to loop-player-1's location
1092# wait 1 tick
1093# teleport loop-player-1 to {_a%loop-player%}
1094# if {_a%loop-player-1%} is {_b%loop-player%}:
1095# if loop-player-1's ping is less than 200:
1096# add loop-player-1 to {_hackerlist::*}
1097# add 3 to {knockbackb.%loop-player-1%}
1098# sendAlert("{@prefix} &a%loop-player-1% is lagging or using Anti-knockback")
1099# wf "[%now%] %loop-player-1% did not move during automated check | ping : %loop-player-1's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Knockback.txt"
1100# teleport loop-player-1 to {_og%loop-player-1%}
1101#
1102
1103#-----Reach-----
1104
1105on damage:
1106 if attacker is a player:
1107 if victim is a player:
1108 if attacker's gamemode is survival or adventure:
1109 damage wasn't caused by thorns or projectile:
1110 if {zac.staffmode.%victim%} is true:
1111 stop
1112 set {_dist.%attacker%} to distance between attacker and victim
1113 set {_ping} to attacker's ping
1114 if {_dist.%attacker%} is greater than 5.67:
1115 if {_ping} is greater than 350:
1116 add 1 to {reachpossible.%attacker%}
1117 sendAlert("{@prefix} &a%attacker% reached far or is lagging. Distance: &e%{_dist.%attacker%}%")
1118 wf "[%now%] %attacker% reached far or is lagging : %{_dist.%attacker%}% | ping : %attacker's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Reach.txt"
1119 if {_ping} is less than 350:
1120 add 3 to {reachimprobable.%attacker%}
1121 add 1 to {reachdetect.%attacker%}
1122 sendAlert("{@prefix} &a%attacker% reached far. Distance: &e%{_dist.%attacker%}%")
1123 wf "[%now%] %attacker% reached far : %{_dist.%attacker%}% | ping : %attacker's ping% | tps : %tps%" to "plugins/ZAC/logs/alerts/Reach.txt"
1124 if {_dist.%attacker%} is greater than 5.85:
1125 if {_ping} is greater than 350:
1126 add 3 to {reachpossible.%attacker%}
1127 if {_ping} is less than 350:
1128 add 1 to {reachcombined.%attacker%}
1129 add 2 to {reachdetect.%attacker%}
1130 if {reachcombined.%attacker%} > 10:
1131 tempBan(attacker)
1132 judgementAdd(attacker, "reach")
1133 set {reachcombined.%attacker%} to 0
1134 if {reachdetect.%attacker%} >= 15:
1135 tempBan(attacker)
1136 judgementAdd(attacker, "reach")
1137 set {reachdetect.%attacker%} to 0
1138
1139#-----Flight-----
1140
1141
1142on any movement:
1143 block under player is not air:
1144 set {zac.originalposition.%player%} to player's position
1145 block under player is barrier or red carpet:
1146 if {zac.didwalkonjumppad.%player%} > 14:
1147 set {zac.didwalkonjumppad.%player%} to 2
1148 else:
1149 add 7 to {zac.didwalkonjumppad.%player%}
1150# block under player is slime block or stone pressure plate:
1151# if {zac.didwalkonjumppad.%player%} > 14:
1152# set {zac.didwalkonjumppad.%player%} to 2
1153# else:
1154# add 7 to {zac.didwalkonjumppad.%player%}
1155# block at player is slime block or stone pressure plate:
1156# if {zac.didwalkonjumppad.%player%} > 14:
1157# set {zac.didwalkonjumppad.%player%} to 2
1158# else:
1159# add 7 to {zac.didwalkonjumppad.%player%}
1160# block at player is stone slab or stair:
1161# if {zac.didwalkonjumppad.%player%} > 14:
1162# set {zac.didwalkonjumppad.%player%} to 2
1163# else:
1164# add 7 to {zac.didwalkonjumppad.%player%}
1165 block under player is stone brick stairs:
1166 if {zac.didwalkonjumppad.%player%} > 14:
1167 set {zac.didwalkonjumppad.%player%} to 2
1168 else:
1169 add 7 to {zac.didwalkonjumppad.%player%}
1170 block under player is stone slab:
1171 if {zac.didwalkonjumppad.%player%} > 14:
1172 set {zac.didwalkonjumppad.%player%} to 2
1173 else:
1174 add 7 to {zac.didwalkonjumppad.%player%}
1175 block under player is slab:
1176 if {zac.didwalkonjumppad.%player%} > 14:
1177 set {zac.didwalkonjumppad.%player%} to 2
1178 else:
1179 add 7 to {zac.didwalkonjumppad.%player%}
1180
1181# block under player is barrier or red carpet or slime block or stone pressure plate or slab or stair or stone slab or cobblestone wall or fence or stone brick stairs or stone stairs:
1182# if {zac.didwalkonjumppad.%player%} > 14:
1183# set {zac.didwalkonjumppad.%player%} to 2
1184# else:
1185# add 7 to {zac.didwalkonjumppad.%player%}
1186# block at player is slime block or stone pressure plate or slab or stair or cobblestone wall or fence or red carpetor stone brick stairs or stone stairs:
1187# if {zac.didwalkonjumppad.%player%} > 14:
1188# set {zac.didwalkonjumppad.%player%} to 2
1189# else:
1190# add 7 to {zac.didwalkonjumppad.%player%}
1191
1192 player's gamemode is not creative:
1193 if player's fly mode is not true:
1194 player does not have permission "zac.player":
1195 add 1 to {zac.player.flydetect}
1196 else:
1197 set {zac.ypos.%player%} to player's altitude
1198 set {_temporaryblockpos} to block at player
1199 set {_temporaryblockpos2} to block under {_temporaryblockpos}
1200 if {_temporaryblockpos2} is not air:
1201 set {zac.isflying.%player%} to false
1202 stop
1203 else:
1204 wait 2 ticks
1205 set {_temporaryblockpos} to block at player
1206 set {_temporaryblockpos2} to block under {_temporaryblockpos}
1207
1208 set {_northtempblock} to block north of {_temporaryblockpos2}
1209 set {_westtempblock} to block west of {_temporaryblockpos2}
1210 set {_southtempblock} to block south of {_temporaryblockpos2}
1211 set {_easttempblock} to block east of {_temporaryblockpos2}
1212 set {_northeastblock} to block east of {_northtempblock}
1213 set {_southeastblock} to block east of {_southtempblock}
1214 set {_northwestblock} to block west of {_northtempblock}
1215 set {_southwestblock} to block west of {_southtempblock}
1216 if {zac.didwalkonjumppad.%player%} < 1:
1217 if {_temporaryblockpos2} is air or sugar cane:
1218 if {_northtempblock} is not air:
1219 stop
1220 if {_easttempblock} is not air:
1221 stop
1222 if {_southtempblock} is not air:
1223 stop
1224 if {_westtempblock} is not air:
1225 stop
1226 if {_northeastblock} is not air:
1227 stop
1228 if {_northwestblock} is not air:
1229 stop
1230 if {_southeastblock} is not air:
1231 stop
1232 if {_southwestblock} is not air:
1233 stop
1234 if {zac.didwalkonjumppad.%player%} < 1:
1235 if {zac.isFighting.%player%} < 1:
1236 if {zac.didenderpearl.%player%} < 1:
1237 if {zac.ypos.%player%} is less than or equal to player's altitude:
1238 wait 3 ticks
1239 if {zac.ypos.%player%} is less than or equal to player's altitude:
1240 set {_temporaryblockpos} to block at player
1241 set {_temporaryblockpos2} to block under {_temporaryblockpos}
1242 if {_temporaryblockpos2} is air or sugar cane:
1243 wait 3 ticks
1244 if {zac.ypos.%player%} is less than or equal to player's altitude:
1245 wait 3 ticks
1246 if {zac.ypos.%player%} is less than or equal to player's altitude:
1247 set {_temporaryblockpos} to block at player
1248 set {_temporaryblockpos2} to block under {_temporaryblockpos}
1249 set {_distance} to difference between {zac.ypos.%player%} and player's altitude
1250 if {_temporaryblockpos2} is air or sugar cane:
1251 set {zac.isflying.%player%} to true
1252 sendAlert("{@prefix} &a%player% flew or jumped very high : &e %{_distance}%")
1253 wf "[%now%] %player% flew or jumped very high : %{_distance}%" to "plugins/ZAC/logs/alerts/Flight.txt"
1254 add 5 to {zac.fly.%player%}
1255 delete {zac.player.flydetect}
1256 else:
1257 set {zac.isflying.%player%} to false
1258
1259 if {zac.isflying.%player%} is true:
1260 if {zac.originalposition.%player%} is set:
1261 teleport player to {zac.originalposition.%player%}
1262 else:
1263 loop blocks under player:
1264 player is not flying:
1265 loop-block is not air:
1266 block above loop-block is air:
1267 teleport player to loop-block
1268
1269
1270#-----Speed-----
1271on rightclick:
1272 player's tool is a enderpearl:
1273 if {zac.didenderpearl.%player%} > 7:
1274 set {zac.didenderpearl.%player%} to 2
1275 else:
1276 add 3 to {zac.didenderpearl.%player%}
1277on teleport:
1278 if {zac.didwalkonjumppad.%player%} > 14:
1279 set {zac.didwalkonjumppad.%player%} to 2
1280 else:
1281 add 7 to {zac.didwalkonjumppad.%player%}
1282every 7 seconds:
1283 loop all players:
1284 speedCheck(loop-player)
1285#every 30 seconds:
1286 #execute command "npc remove all"
1287on damage:
1288 if attacker is a player:
1289 if victim is a player:
1290 if attacker's gamemode is survival or adventure:
1291 damage wasn't caused by thorns or projectile:
1292 if tool of the attacker is enchanted with knockback 2:
1293 if {zac.isFighting.%victim%} = 0:
1294 add 3 to {zac.isFighting.%victim%}
1295 if tool of the attacker is enchanted with knockback 1:
1296 if {zac.isFighting.%victim%} = 0:
1297 add 3 to {zac.isFighting.%victim%}
1298 else:
1299 if {zac.isFighting.%victim%} = 0:
1300 add 2 to {zac.isFighting.%victim%}
1301
1302#-----FastBow-----
1303
1304
1305on shoot:
1306# if tool of the shooter is a bow:
1307 if projectile is an arrow:
1308 set {_diff} to difference between {zac.fastbow.%shooter%} and now
1309 if {_diff} is less than 0.1:
1310 cancel event
1311 send "test" to shooter
1312 set {zac.fastbow.%shooter%} to now
1313
1314#-----CommandHandler-----
1315
1316
1317command /zac [<text>] [<offline player>]:
1318 permission: zac.mod
1319 trigger:
1320 if arg 1 is "info":
1321 viewViolations(player, arg 2)
1322 if arg 1 is "clear":
1323 clearViolations(arg 2)
1324 send "{@prefix} Violations cleared for %arg 2%" to player
1325 if arg 1 is "tempban":
1326 tempBan(arg 2)
1327 if arg 1 is "history":
1328 send "{@prefix} &a%arg 2% has %{history.%arg 2%}% tempbans."
1329 if arg 1 is "unban":
1330 unBan(player, arg 2)
1331 if arg 1 is "consoleunban":
1332 unBanConsole(arg 2)
1333 if arg 1 is "staffmode":
1334 if arg 2 is "on":
1335 if {zac.staffmode.%player%} doesn't exist:
1336 set {zac.staffmode.%player%} to true
1337 stop
1338 if {zac.staffmode.%player%} is true:
1339 send "{@prefix} &cStaff mode already on!" to player
1340 stop
1341 if {zac.staffmode.%player%} is false:
1342 set {zac.staffmode.%player%} to true
1343 saveInventory(player)
1344 wait 5 ticks
1345 clear player's inventory
1346 equip player with golden helmet
1347 equip player with chain chestplate
1348 equip player with golden leggings
1349 equip player with chain boots with lore "&2VIP"
1350 give stick named "&e&lTroll Stick" to slot 0 of player
1351 give potato named "&eTroll Potato" to slot 1 of player
1352 give nether star named "&e&lVanish" to slot 4 of player
1353 give book named "&e&lInspector" to slot 5 of player
1354 give compass named "&e&lRandom Player TP" to slot 7 of player
1355 give block of redstone named "&e&lToggle Staff Mode Off" to slot 8 of player
1356 stop
1357 if arg 2 is "off":
1358 if {zac.staffmode.%player%} doesn't exist:
1359 set {zac.staffmode.%player%} to false
1360 stop
1361 if {zac.staffmode.%player%} is true:
1362 restoreInventory(player)
1363 set {zac.staffmode.%player%} to false
1364 send "{@prefix} Staff mode turned off"
1365 stop
1366 else:
1367 send "{@prefix} &cStaff mode not on!"
1368 stop
1369 if arg 1 is "cps":
1370 if arg 2 is a player:
1371 delete {zac.cpslist.%player%::*}
1372 viewCPS(player, arg 2)
1373 stop
1374 delete {zac.cpslist.%player%::*}
1375 send "{@prefix} &7CPS disabled."
1376 if arg 1 is "reload":
1377 execute player command "sk reload ZAC"
1378 send "{@prefix} &aRELOADED" to player
1379 if arg 1 is "alerts":
1380 if {zac.%player%.alerts} is not set:
1381 set {zac.%player%.alerts} to false
1382 send "{@prefix} &7You will see alerts now."
1383 else:
1384 delete {zac.%player%.alerts}
1385 send "{@prefix} &7Alerts disabled."
1386 #if arg 1 is "inspect":
1387 # if arg 2 is a player:
1388 # zacInspect(player, arg 2)
1389 if arg 1 is "inspect2":
1390 if arg 2 is a player:
1391 zacSidespect(player, arg 2)
1392 if arg 1 is "ac":
1393 if arg 2 is a player:
1394 auraCheck(arg 2)
1395 if arg 1 is "acage":
1396 set {auracage} to location of player
1397 if arg 1 is "debug":
1398 send "%{zac.isSpeeding.%arg 2%}% %{zac.didwalkonjumppad.%arg 2%}% %{zac.didenderpearl.%arg 2%}%" to player
1399 if arg 1 is "debugtest":
1400 set {_loc} to player's location
1401 set {_x1} to player's x coordinate
1402 set {_z1} to player's z coordinate
1403 set {_xx1} to rounded {_x1}
1404 set {_zz1} to rounded {_z1}
1405 wait 2 second
1406 set {_loc2} to player's location
1407 set {_x2} to player's x coordinate
1408 set {_z2} to player's z coordinate
1409 set {_xx2} to rounded {_x2}
1410 set {_zz2} to rounded {_z2}
1411 wait 1 tick
1412 set {_difference} to difference between {_loc} and {_loc2}
1413 send "First pos:%{_loc}%"
1414 send "Second pos:%{_loc2}%"
1415 wait 1 second
1416 subtract {_xx1} from {_xx2}
1417 subtract {_yy1} from {_yy2}
1418 set {_te} to {_xx2}
1419 set {_de} to {_yy2}
1420 loop {_te} times:
1421 add {_te} to {_testvar}
1422 loop {_de} times:
1423 add {_de} to {_testvar2}
1424 add {_testvar} to {_testvar2}
1425 set {_dis} to sqrt of {_testvar2}
1426 send "Difference:%{_dis}%"
1427 if arg 1 is "distance":
1428 speedCheckA(arg 2)
1429 if arg 1 is "acn":
1430 if arg 2 is a player:
1431 auraCheckNorth(player)
1432 if arg 1 is "judgementday":
1433 if arg 2 is "start":
1434 judgementDay(1)
1435 if arg 1 is not set:
1436 mainCommand(player)
1437 if arg 1 is "toggle":
1438 if arg 2 is "speed":
1439 toggleSpeed(1)
1440 if arg 2 is "flight":
1441 toggleFlight(1)
1442 if arg 2 is "reach":
1443 toggleReach(1)
1444 if arg 1 is "admin":
1445 adminCommand(player)
1446 if arg 1 is "zetest":
1447 if arg 2 is a player:
1448 make arg 2 ride a saddled pig
1449#on vehicle steer:
1450# if event-button is space:
1451# push vehicle of player upwards at speed 0.4
1452# if event-button is w:
1453# push vehicle of player in the direction of player at speed 1
1454# if event-button is a:
1455# push vehicle of player to the left at speed 0.7
1456# if event-button is d:
1457# push vehicle of player to the right at speed 0.7
1458# if event-button is s:
1459# push vehicle of player backwards at speed 1