Advertisement
Guest User

GoldenEyes AntiCheat

a guest
Mar 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.91 KB | None | 0 0
  1. # Created by MisterBasic
  2. #
  3. # API for addons:
  4. # alert(<message>, <player>)
  5. # gekick(<reason>, <player>)
  6. # gecmd(<cmd>, <player>)
  7. #
  8. #
  9. options:
  10. prefix: &8[&6GoldenEyes&8]&e
  11. version: 0.1
  12.  
  13. #Checks
  14. autoclicker: 15
  15. autoclicker-kick: 30
  16. reach: 4
  17. fastplace: 20
  18.  
  19. on join:
  20. if player has permission "goldeneyes.joinmessage":
  21. gecmd("version", player)
  22.  
  23. # Fast Clicks
  24. on left click:
  25. target entity is set
  26. distance between target block and player > 3
  27. player's held item is not a pickaxe, axe, shovel, or hoe
  28. add 1 to {goldeneyes.cps::%player%}
  29. player does not have permission "goldeneyes.autoclicker.bypass"
  30. if {goldeneyes.cps::%player%} >= {@autoclicker}:
  31. add 1 to {goldeneyes.autoclicker.%player%.vl}
  32. alert("%player% failed AutoClicker [VL %{goldeneyes.autoclicker.%player%.vl}%]", player)
  33. if {goldeneyes.cps::%player%} >= {@autoclicker-kick}:
  34. gekick("AutoClicker", player)
  35. every second:
  36. clear {goldeneyes.cps::*}
  37. clear {goldeneyes.fastplace::*}
  38. clear {goldeneyes.lastplace::*}
  39.  
  40. # FastBow
  41. on shoot:
  42. shooter does not have permission "goldeneyes.fastbow.bypass"
  43. if {goldeneyes.lastshot.%shooter%} is not set:
  44. set {goldeneyes.lastshot.%shooter%} to now
  45. stop
  46. if difference between {goldeneyes.lastshot.%shooter%} and now < 2 ticks:
  47. set {goldeneyes.lastshot.%shooter%} to now
  48. alert("%shooter% failed FastBow", shooter)
  49. add 1 to {goldeneyes.fastbow.%shooter%.vl}
  50. stop
  51.  
  52. # Reach
  53. on damage:
  54. attacker does not have permission "goldeneyes.reach.bypass"
  55. attacker is a player
  56. attacker's gamemode is not creative or spectator
  57. victim is player
  58. damage cause is not a projectile
  59. if distance between attacker and victim is greater than {@reach}+attacker's ping/200:
  60. add 1 to {goldeneyes.reach.%attacker%.vl}
  61. alert("%attacker% failed Reach [VL %{goldeneyes.reach.%attacker%.vl}%] (Distance: %distance between attacker and victim% blocks)", attacker)
  62.  
  63. # Scaffold / Fastplace
  64. on place:
  65. player does not have permission "goldeneyes.fastplace.bypass"
  66. add 1 to {goldeneyes.fastplace::%player%}
  67. if {goldeneyes.lastplace::%player%} is not set:
  68. set {goldeneyes.lastplace::%player%} to now
  69. stop
  70. if difference between {goldeneyes.lastplace::%player%} and now < 0.9 ticks:
  71. cancel event
  72. add 1 to {goldeneyes.fastplace.%player%.vl}
  73. alert("%player% failed FastPlace [VL %{goldeneyes.fastplace.%player%.vl}%]", player)
  74. reset {goldeneyes.lastplace::%player%}
  75. stop
  76. if {goldeneyes.fastplace::%player%} >= {@fastplace}:
  77. cancel event
  78. add 1 to {goldeneyes.fastplace.%player%.vl}
  79. alert("%player% failed FastPlace [VL %{goldeneyes.fastplace.%player%.vl}%]", player)
  80. stop
  81.  
  82. # AutoSneak
  83. on chat:
  84. player does not have permission "goldeneyes.autosneak.bypass"
  85. if player is sneaking:
  86. add 1 to {goldeneyes.autosneak.%player%.vl}
  87. alert("%player% failed AutoSneak [VL %{goldeneyes.autosneak.%player%.vl}%]", player)
  88. on inventory close:
  89. player does not have permission "goldeneyes.autosneak.bypass"
  90. if player is sneaking:
  91. add 1 to {goldeneyes.autosneak.%player%.vl}
  92. alert("%player% failed AutoSneak [VL %{goldeneyes.autosneak.%player%.vl}%]", player)
  93. # Little extra
  94. clear {menu.%player%}
  95. on inventory click:
  96. player does not have permission "goldeneyes.autosneak.bypass"
  97. if player is sneaking:
  98. add 1 to {goldeneyes.autosneak.%player%.vl}
  99. alert("%player% failed AutoSneak [VL %{goldeneyes.autosneak.%player%.vl}%]", player)
  100. # WaterWalk
  101. on walk on water:
  102. player does not have permission "goldeneyes.waterwalk.bypass"
  103. set {_lilypad} to 0
  104. player is not flying
  105. loop all blocks in radius 2 around player:
  106. if loop-block is a lily pad:
  107. add 1 to {_lilypad}
  108. {_lilypad} < 1
  109. if block below the player is water:
  110. if block left of block below the player is water:
  111. if block right of block below the player is water:
  112. if block behind the block below the player is water:
  113. if block infront of block below the player is water:
  114. if block at player is not water:
  115. if block above player is not water:
  116.  
  117. player is on ground
  118. add 1 to {goldeneyes.waterwalk.%player%.vl}
  119. alert("%player% failed WaterWalk [VL %{goldeneyes.waterwalk.%player%.vl}%]", player)
  120. if {_lilypad} > 1:
  121. stop
  122.  
  123. # Liquid Interact
  124. on right click on water or lava:
  125. player does not have permission "goldeneyes.liquidinteract.bypass"
  126. cancel event
  127. add 1 to {goldeneyes.liquidinteract.%player%.vl}
  128. alert("%player% failed LiquidInteract [VL %{goldeneyes.liquidinteract.%player%.vl}%]", player)
  129. on block break:
  130. player does not have permission "goldeneyes.liquidinteract.bypass"
  131. if event-block is water or lava:
  132. gekick("LiquidInteract", player)
  133. on block damage:
  134. player does not have permission "goldeneyes.liquidinteract.bypass"
  135. if event-block is water or lava:
  136. gekick("LiquidInteract", player)
  137. # Flight
  138. on any movement:
  139. block below the player is air
  140. block at the player is air
  141. player is not riding
  142. # This part here is really the check, if the player is on the ground and is in the air, it is impossible.
  143. player is on ground
  144. set {_blocks} to 0
  145. player's gamemode is not Creative or Spectator:
  146. # Possible problems if this wasn't here
  147. loop all blocks in radius 3 around player:
  148. if loop-block is stairs or slab:
  149. stop
  150. # Checks if the player is in the air
  151. loop all blocks in radius 2 around player:
  152. if loop-block is not air:
  153. add 1 to {_blocks}
  154. if {_blocks} is greater than 0:
  155. stop
  156. if {_blocks} is less than 1:
  157. # Alerts
  158. add 1 to {goldeneyes.move.%player%.vl}
  159. add 1 to {goldeneyes.move.%player%}
  160. alert("%player% failed Movement [VL %{goldeneyes.move.%player%.vl}%]", player)
  161. cancel event
  162. if {goldeneyes.move.%player%} is greater than 5:
  163. clear {goldeneyes.move.%player%}
  164. gekick("Flight", player)
  165. every minute:
  166. loop all players:
  167. clear {goldeneyes.move.%loop-player%}
  168. # CommandManager
  169. command /goldeneyes [<text>] [<text>] [<text>]:
  170. description: Main GoldenEyes Command.
  171. permission: goldeneyes.maincommand
  172. permission message: Unknown Command. Type /help for help.
  173. executable by: players and console
  174. trigger:
  175. if arg 1 is not set:
  176. gecmd("version", player)
  177. else if arg 1 is "checks":
  178. gecmd("checks", player)
  179. else if arg 1 is "reload":
  180. gecmd("reload", player)
  181. else if arg 1 is "version":
  182. gecmd("version", player)
  183. else if arg 1 is "help":
  184. gecmd("help", player)
  185. else if arg 1 is "notify":
  186. if arg 2 is "true":
  187. gecmd("notify-true", player)
  188. else if arg 2 is "false":
  189. gecmd("notify-false", player)
  190. else:
  191. send "{@prefix} &cPlease specify a boolean: /goldeneyes notify &4<true|false>&c!"
  192. else if arg 1 is "reset":
  193. if arg 3 contains "autoclicker":
  194. clear {goldeneyes.autoclicker.%arg 2%.vl}
  195. send "{@prefix} Reset all of %arg 2%'s violations for AutoClicker!" to player
  196. if arg 3 contains "fastplace":
  197. clear {goldeneyes.fastplace.%arg 2%.vl}
  198. send "{@prefix} Reset all of %arg 2%'s violations for Fastplace!" to player
  199. if arg 3 contains "fastbreak":
  200. clear {goldeneyes.nuker.%arg 2%.vl}
  201. send "{@prefix} Reset all of %arg 2%'s violations for FastBreak!" to player
  202. if arg 3 contains "liquidinteract":
  203. clear {goldeneyes.liquidinteract.%arg 2%.vl}
  204. send "{@prefix} Reset all of %arg 2%'s violations for LiquidInteract!" to player
  205. if arg 3 contains "waterwalk":
  206. clear {goldeneyes.waterwalk.%arg 2%.vl}
  207. send "{@prefix} Reset all of %arg 2%'s violations for WaterWalk!" to player
  208. if arg 3 contains "autosneak":
  209. clear {goldeneyes.autosneak.%arg 2%.vl}
  210. send "{@prefix} Reset all of %arg 2%'s violations for AutoSneak!" to player
  211. if arg 3 contains "reach":
  212. clear {goldeneyes.reach.%arg 2%.vl}
  213. send "{@prefix} Reset all of %arg 2%'s violations for Reach!" to player
  214. if arg 3 contains "movement":
  215. clear {goldeneyes.move.%arg 2%.vl}
  216. send "{@prefix} Reset all of %arg 2%'s violations for Movement!" to player
  217. if arg 3 contains "*" or "all":
  218. send "{@prefix} Reset all of %arg 2%'s violations!" to player
  219. clear {goldeneyes.reach.%arg 2%.vl}
  220. clear {goldeneyes.autosneak.%arg 2%.vl}
  221. clear {goldeneyes.waterwalk.%arg 2%.vl}
  222. clear {goldeneyes.liquidinteract.%arg 2%.vl}
  223. clear {goldeneyes.fastplace.%arg 2%.vl}
  224. clear {goldeneyes.autoclicker.%arg 2%.vl}
  225. else if arg 1 is "info":
  226. if arg 2 is set:
  227. open chest with 4 rows named "&6&n&lGoldenEyes Player Info" to player
  228. format slot 4 of player with player head named "&6%arg 2%" with lore "&7Name: %display name of arg 2 parsed as player%||&7UUID: %uuid of arg 2 parsed as player%" to be unstealable
  229. format slot 13 of player with black stained glass named "&8Work in progress" to be unstealable
  230. set {menu.%player%} to true
  231. else:
  232. gecmd("unknowncmd", player)
  233. # Functions Manager
  234. function gecmd(t: text, p: player):
  235. if {_t} is "version":
  236. send "{@prefix} Running Version {@version}" to {_p}
  237. if {_t} is "checks":
  238. send "{@prefix} Avaliable Checks:%nl%AutoClicker, Reach/Killaura, FastBow, FastPlace/Scaffold, WaterWalk, LiquidInteract, AutoSneak, Flight" to {_p}
  239. if {_t} is "reload":
  240. make console execute "/sk reload %script name%.sk"
  241. send "{@prefix} Fully reloaded GoldenEyes v{@version}!" to {_p}
  242. if {_t} is "unknowncmd":
  243. send "{@prefix} Invaild Argument. Usage: /goldeneyes (reload|checks|version|notify) [value]" to {_p}
  244. if {_t} is "notify-true":
  245. set {goldeneyes.notify::%{_p}%} to true
  246. send "{@prefix} Set notifications to True!" to {_p}
  247. if {_t} is "notify-false":
  248. set {goldeneyes.notify::%{_p}%} to false
  249. send "{@prefix} Set notifications to False!" to {_p}
  250. if {_t} is "help":
  251. send "&8[&a-=-&8]&7&m-----&8[&6GoldenEyes&8]&7&m-----&8[&a-=-&8]&r" to {_p}
  252. send "&8[&a!&8]&6 /goldeneyes reload&e: Reload" to {_p}
  253. send "&8[&a!&8]&6 /goldeneyes version&e: Get the version" to {_p}
  254. send "&8[&a!&8]&6 /goldeneyes notify <true|false>&e: Toggle notifications" to {_p}
  255. send "&8[&a!&8]&6 /goldeneyes checks&e: See the Cheat Checks" to {_p}
  256. send "&8[&a!&8]&6 /goldeneyes help&e: Get Help" to {_p}
  257. send "&8[&a!&8]&6 /goldeneyes info <player>&e: Get Info" to {_p}
  258. send "&8[&a!&8]&6 /goldeneyes reset <player> <violations>&e: Reset Violations" to {_p}
  259. send "&8[&a-=-&8]&7&m-----&8[&6GoldenEyes&8]&7&m-----&8[&a-=-&8]&r" to {_p}
  260. function alert(m: text, p: player):
  261. loop all players:
  262. loop-player has permission "goldeneyes.notify":
  263. if {goldeneyes.notify::%loop-player%} is true:
  264. send "{@prefix} %{_m}% (Ping: %{_p}'s ping%)" to loop-player
  265. send "[GoldenEyesAntiCheat] %{_m}% (Ping: %{_p}'s ping%)" to console
  266. function gekick(m: text, p: player):
  267. kick {_p} due to "{@prefix} You were disconnected from the server.%nl%%nl%&4Reason: %{_m}%%nl%%nl%&7Please do not do this again!"
  268. send "[GoldenEyesAntiCheat] %{_p}% was kicked from the server. Reason: %{_m}%" to console
  269. loop all players:
  270. if loop-player has permission "goldeneyes.notify" or "goldeneyes.notify.kick":
  271. send "{@prefix} %{_p}% was kicked from the server. Reason: %{_m}%" to loop-player
  272. # End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement