MilkTeaPopcorn

Untitled

Jan 21st, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.28 KB | None | 0 0
  1. options:
  2. #---------------------------------------------------------------------
  3. #Internal configurations:
  4. command: /vandal
  5. aliases: /van, /vandalcheat
  6. #The location were Vandal saves data.
  7. FileLoc: plugins/Vandal/
  8. ConsolePrefix: &7[&eVandal&7] &r
  9.  
  10. #---------------------------------------------------------------------
  11. #!Don't touch the options below unless you know what you're doing.
  12.  
  13. #VarPrefix is the prefix placed before the variable. {HERE::*}
  14. #SKRIPT DEVELOPERS:
  15. #Recommened that you delete the list variable of the existing variable
  16. #before changing this variable name, Example:
  17. #!delete {Vandal::*})
  18. VarPrefix: Vandal
  19. version: 1.0.1
  20. function VandalYMLSave(file: text = "none", empty: integer = 0):
  21. if {_file} is "config" or "menu":
  22. set {_nodes::*} to yaml nodes with keys "%{_file}%" from file "{@FileLoc}%{_file}%.yml"
  23. loop {_nodes::*}:
  24. set {{@VarPrefix}::%{_file}%::%loop-value%} to yaml value "%{_file}%.%loop-value%" from file "{@FileLoc}%{_file}%.yml"
  25. else:
  26. add "config" and "menu" to {_files::*}
  27. loop {_files::*}:
  28. set {_nodes::*} to yaml nodes with keys "%loop-value%" from file "{@FileLoc}%loop-value%.yml"
  29. loop {_nodes::*}:
  30. set {{@VarPrefix}::%loop-value-1%::%loop-value-2%} to yaml value "%loop-value-1%.%loop-value-2%" from file "{@FileLoc}%loop-value-1%.yml"
  31. function VandalYML(file: text, data: text, node: text = "empty", object: text = "empty") :: text:
  32. if {_file} is "config" or "menu":
  33. if {_data} is "write" or "set":
  34. set yaml value "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml" to "%{_object}%"
  35. VandalYMLSave("%{_file}%")
  36. exit
  37. if {_data} is "listadd":
  38. add "%{_object}%" to yaml list "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml"
  39. VandalYMLSave("%{_file}%")
  40. exit
  41. if {_data} is "listremove":
  42. remove "%{_object}%" from yaml list "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml"
  43. VandalYMLSave("%{_file}%")
  44. exit
  45. else if {_data} is "read" or "get":
  46. VandalYMLSave("%{_file}%")
  47. return "%{{@VarPrefix}::%{_file}%::%{_node}%}%"
  48. function VandalYMLKeys(file: text, data: text, node: text = "empty", object: text = "empty") :: objects:
  49. if {_file} is "config" or "menu":
  50. if {_data} is "keys":
  51. return yaml nodes with keys "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml"
  52. else if {_data} is "keynumbers":
  53. loop yaml nodes with keys "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml":
  54. set {_object} to the first 2 characters of "%loop-value%"
  55. if {_object} doesn't contain ".":
  56. if {_numbers::*} is not set:
  57. add "%{_object}%" parsed as integer to {_numbers::*}
  58. else if {_numbers::*} doesn't contain {_object}:
  59. add "%{_object}%" parsed as integer to {_numbers::*}
  60. return {_numbers::*}
  61. else if {_data} is "readlist":
  62. return yaml list "%{_file}%.%{_node}%" from file "{@FileLoc}%{_file}%.yml"
  63. function VandalOpenMenu(menu: text, p: player):
  64. if VandalYML("menu", "read", "Menus") doesn't contain "%{_menu}%":
  65. message "{@ConsolePrefix}&cMenu %{_menu}% doesn't exist. If you have a configuration setup for it, add it to the menus list in the menu.yml" to console
  66. stop
  67. set {_num} to "%{{@VarPrefix}::menu::%{_menu}%.size}%" parsed as integer
  68. if {_num} > 6:
  69. set {_num} to 6
  70. if {_num} <= 0:
  71. set {_num} to 1
  72. loop VandalYMLKeys("menu", "keynumbers", "%{_menu}%.items"):
  73. set {_slot} to {{@VarPrefix}::menu::%{_menu}%.items.%loop-value%.slot} parsed as integer
  74. set {_data::%{_slot}%} to {{@VarPrefix}::menu::%{_menu}%.items.%loop-value%.item} parsed as itemtype
  75. set {_name::%{_slot}%} to {{@VarPrefix}::menu::%{_menu}%.items.%loop-value%.name}
  76. set {_lore::%{_slot}%} to {{@VarPrefix}::menu::%{_menu}%.items.%loop-value%.lore}
  77. open "%{{@VarPrefix}::menu::%{_menu}%.type}%" with {_num} rows named "%{{@VarPrefix}::menu::%{_menu}%.name}%" to {_p}
  78. loop {_data::*}:
  79. set {_item} to "%loop-value%" parsed as itemtype
  80. set {_slot} to "%loop-index%" parsed as integer
  81. if {_lore::%{_slot}%} is not "<none>":
  82. set slot {_slot} of {_p}'s current inventory to {_item} named {_name::%{_slot}%} with lore {_lore::%{_slot}%}
  83. else:
  84. set slot {_slot} of {_p}'s current inventory to {_item} named {_name::%{_slot}%}
  85. function VandalPremadeMenu(menu: text, p: player):
  86. if {_menu} is not "Toggles":
  87. message "{@ConsolePrefix}&cPremade Menu %{_menu}% doesn't exist." to console
  88. stop
  89. if {_menu} is "Toggles":
  90. open "CHEST" with 1 row named "%{{@VarPrefix}::menu::PremadeMenus.%{_menu}%.name}%" to {_p}
  91. set {_slot} to 0
  92. loop {{@VarPrefix}::temp::hacks::*}:
  93. if {{@VarPrefix}::config::Hacks.%loop-value%.Enabled} is "true":
  94. set {_item} to "%{{@VarPrefix}::menu::PremadeMenus.%{_menu}%.enabledItem.item}%" parsed as item
  95. set {_name} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.enabledItem.name}
  96. set {_lore} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.enabledItem.lore}
  97. else:
  98. set {_item} to "%{{@VarPrefix}::menu::PremadeMenus.%{_menu}%.disabledItem.item}%" parsed as item
  99. set {_name} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.disabledItem.name}
  100. set {_lore} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.disabledItem.lore}
  101. set {_name} to join VandalPlaceholder({_name}, {_p}, loop-value) with "Functions are stupid sometimes"
  102. set {_lore} to join VandalPlaceholder({_lore}, {_p}, loop-value) with "Functions are stupid sometimes"
  103. if {_lore} is not "<none>":
  104. set slot {_slot} of {_p}'s current inventory to {_item} named {_name} with lore {_lore}
  105. else:
  106. set slot {_slot} of {_p}'s current inventory to {_item} named {_name}
  107. set {_item} to "%{{@VarPrefix}::menu::PremadeMenus.%{_menu}%.back.item}%" parsed as item
  108. set {_name} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.back.name}
  109. set {_lore} to {{@VarPrefix}::menu::PremadeMenus.%{_menu}%.back.lore}
  110. set {_name} to join VandalPlaceholder({_name}, {_p}) with "Functions are stupid sometimes"
  111. set {_lore} to join VandalPlaceholder({_lore}, {_p}) with "Functions are stupid sometimes"
  112. if {_lore} is not "<none>":
  113. set slot 8 of {_p}'s current inventory to {_item} named {_name} with lore {_lore}
  114. else:
  115. set slot 8 of {_p}'s current inventory to {_item} named {_name}
  116. function VandalPlaceholder(msg: text, p: player, hack: text = "none") :: string:
  117. replace all "{PLAYER}" with "%{_p}%" in {_msg}
  118. replace all "{PING}" with "%ping of {_p}%" in {_msg}
  119. if {{@VarPrefix}::temp::player::%{_p}%::hacks::killaura} is set:
  120. replace all "{KILLAURA_CPS}" with "%{{@VarPrefix}::temp::player::%{_p}%::hacks::killaura}%" in {_msg}
  121. if {{@VarPrefix}::temp::player::%{_p}%::cheat::packets} is set:
  122. replace all "{PACKETS}" with "%{{@VarPrefix}::temp::player::%{_p}%::cheat::packets}%" in {_msg}
  123. if {{@VarPrefix}::temp::player::%{_p}%::cheat::highestPacket::*} is set:
  124. loop {{@VarPrefix}::temp::player::%{_p}%::cheat::highestPacket::*}:
  125. set {_packet} to loop-index
  126. set {_value} to loop-value
  127. exit loop
  128. replace all "{HIGHEST_PACKET}" with "%{_packet}%" in {_msg}
  129. replace all "{HIGHEST_VALUE}" with "%{_value}%" in {_msg}
  130. if {_hack} is not "none":
  131. replace all "{HACK}" with "%{_hack}%" in {_msg}
  132. replace all "{HACKSTATE}" with "%{{@VarPrefix}::config::Hacks.%{_hack}%.Enabled}%" in {_msg}
  133. if {{@VarPrefix}::config::Hacks.%{_hack}%.Enabled} is "true":
  134. replace all "{ANTIHACKSTATE}" with "false" in {_msg}
  135. replace all "{ANTIHACKSTATECOLOUR}" and "{ANTIHACKSTATECOLOR}" with "&c" in {_msg}
  136. replace all "{HACKSTATECOLOUR}" and "{HACKSTATECOLOR}" with "&a" in {_msg}
  137. else:
  138. replace all "{ANTIHACKSTATE}" with "true" in {_msg}
  139. replace all "{ANTIHACKSTATECOLOUR}" and "{ANTIHACKSTATECOLOR}" with "&a" in {_msg}
  140. replace all "{HACKSTATECOLOUR}" and "{HACKSTATECOLOR}" with "&c" in {_msg}
  141. return "%{_msg}%"
  142. function VandalKillauraTest(empty: text = "none"):
  143. loop all players:
  144. if {{@VarPrefix}::temp::player::%loop-player%::testing::killaura} is not set:
  145. clear {_npc}
  146. clear {_entity}
  147. set {{@VarPrefix}::temp::player::%loop-player%::testing::killaura} to true
  148. VandalKillauraTest()
  149. set {_npc} to a npc with name "%random player out of all players%" and entity type "PLAYER"
  150. spawn npc {_npc} at location of loop-player
  151. set the protected state of npc {_npc} to false
  152. set {_entity} to entity from npc {_npc}
  153. set {_armour::*} to all diamond armour, all gold armour, all iron armour and all leather armour
  154. loop random integer between 1 and 6 times:
  155. equip {_entity} with random item out of {_armour::*}
  156. give {_entity} a sword
  157. set {_time} to 0 ticks
  158. while {_time} <= "%{{@VarPrefix}::config::Hacks.Killaura.TestTimeLength}%" parsed as timespan:
  159. add 1 tick to {_time}
  160. set {_loc} to location 2 blocks behind loop-player
  161. add 1.5 to y-coordinate of {_loc}
  162. if {_loc} is not location of npc {_npc}:
  163. teleport npc {_npc} to {_loc}
  164. make npc {_npc} look at loop-player
  165. wait a tick
  166. if {{@VarPrefix}::temp::player::%loop-player%::hacks::killaura} >= "%{{@VarPrefix}::config::Hacks.Killaura.MaxNpcHits}%" parsed as number:
  167. if {_time} <= "%{{@VarPrefix}::config::Hacks.Killaura.MaxNpcHitsTime}%" parsed as timespan:
  168. if {{@VarPrefix}::config::Hacks.Killaura.Action} is "Kick":
  169. kick loop-player due to VandalPlaceholder({{@VarPrefix}::config::Hacks.Killaura.KickMsg}, loop-player, "Killaura")
  170. else if {{@VarPrefix}::config::Hacks.Killaura.Action} is "Ban":
  171. ban loop-player due to VandalPlaceholder({{@VarPrefix}::config::Hacks.Killaura.BanMsg}, loop-player, "Killaura")
  172. else if {{@VarPrefix}::config::Hacks.Killaura.Action} is "Evaluate":
  173. evaluate VandalPlaceholder({{@VarPrefix}::config::Hacks.Killaura.Evaluate}, loop-player, "Killaura")
  174. add 1000 seconds to {_time}
  175. hackMessage("Killaura", loop-player)
  176. else:
  177. set {_time} to 0 ticks
  178. unregister npc {_npc}
  179. delete {{@VarPrefix}::temp::player::%loop-player%::hacks::killaura}
  180. delete {{@VarPrefix}::temp::player::%loop-player%::testing::killaura}
  181. on npc damage by entity:
  182. cancel event
  183. add 1 to {{@VarPrefix}::temp::player::%player%::hacks::killaura}
  184. on quit:
  185. delete {{@VarPrefix}::temp::player::%player%::*}
  186. on script load:
  187. delete {{@VarPrefix}::temp::*}
  188. set {{@VarPrefix}::temp::hacks::*} to "Killaura"
  189. if file exists at "{@FileLoc}config.yml" is false:
  190. message "{@ConsolePrefix}&cGenerating config.yml" to console
  191. if {{@VarPrefix}::config::saveFiles} is "true":
  192. loop {{@VarPrefix}::config::*}:
  193. set yaml value "%loop-index%" from file "{@FileLoc}config.yml" to "%loop-value%"
  194. else:
  195. delete {{@VarPrefix}::config::*}
  196. VandalYML("config", "write", "version", "{@version}")
  197. VandalYML("config", "write", "saveFiles", "false")
  198. VandalYML("config", "write", "accessMode", "permissions")
  199. VandalYML("config", "write", "prefix", "&8[&6&lVandal&8] &r")
  200. VandalYML("config", "write", "prefix", "&8[&6&lVandal&8] &r")
  201. VandalYML("config", "write", "permissions.gui", "vandal.gui")
  202. VandalYML("config", "write", "permissions.staff", "vandal.staff")
  203. VandalYML("config", "listadd", "vandalManagers", "LimeGlass")
  204. VandalYML("config", "write", "MaxTimeout", "1000 seconds")
  205. VandalYML("config", "write", "Hacks.Killaura.Enabled", "true")
  206. VandalYML("config", "write", "Hacks.Killaura.TestEvery", "3 minutes")
  207. VandalYML("config", "write", "Hacks.Killaura.TestTimeLength", "15 seconds")
  208. VandalYML("config", "write", "Hacks.Killaura.MaxNpcHits", "25")
  209. VandalYML("config", "write", "Hacks.Killaura.MaxNpcHitsTime", "1.5 seconds")
  210. VandalYML("config", "write", "Hacks.Killaura.Action", "Kick")
  211. VandalYML("config", "write", "Hacks.Killaura.KickMsg", "&cKillaura is not allowed on this server {PLAYER}")
  212. VandalYML("config", "write", "Hacks.Killaura.BanMsg", "&cKillaura is not allowed on this server {PLAYER}")
  213. VandalYML("config", "write", "Hacks.Killaura.Evaluate", "staffWarn(""Killaura"", {PLAYER})")
  214. VandalYML("config", "write", "Hacks.Killaura.MessageStaff", "true")
  215. VandalYML("config", "write", "Hacks.Killaura.Message", "&c{PLAYER} &7suspected of Killaura! (CPS: {KILLAURA_CPS})")
  216. VandalYML("config", "write", "Hacks.TooManyPackets.Enabled", "true")
  217. VandalYML("config", "write", "Hacks.TooManyPackets.MaxPackets", "2500")
  218. VandalYML("config", "write", "Hacks.TooManyPackets.Action", "Kick")
  219. VandalYML("config", "write", "Hacks.TooManyPackets.KickMsg", "&cYou are sending too many packets!")
  220. VandalYML("config", "write", "Hacks.TooManyPackets.BanMsg", "&cYou have been banned for sending too many packets!")
  221. VandalYML("config", "write", "Hacks.TooManyPackets.Evaluate", "staffWarn(""TooManyPackets"", {PLAYER})")
  222. VandalYML("config", "write", "Hacks.TooManyPackets.MessageStaff", "true")
  223. VandalYML("config", "write", "Hacks.TooManyPackets.Message", "&c{PLAYER} &7suspected of TooManyPackets! Most sent packet: {HIGHEST_PACKET} ({HIGHEST_VALUE})")
  224. if file exists at "{@FileLoc}menu.yml" is false:
  225. message "{@ConsolePrefix}&cGenerating menu.yml" to console
  226. if {{@VarPrefix}::config::saveFiles} is "true":
  227. loop {{@VarPrefix}::menu::*}:
  228. set yaml value "%loop-index%" from file "{@FileLoc}menu.yml" to "%loop-value%"
  229. else:
  230. delete {{@VarPrefix}::menu::*}
  231. VandalYML("menu", "listadd", "Menus", "mainmenu")
  232. VandalYML("menu", "write", "mainmenu.type", "HOPPER")
  233. VandalYML("menu", "write", "mainmenu.size", "3")
  234. VandalYML("menu", "write", "mainmenu.name", " &4&l&nVandal Menu")
  235. VandalYML("menu", "write", "mainmenu.items.1.slot", "0")
  236. VandalYML("menu", "write", "mainmenu.items.1.item", "beacon")
  237. VandalYML("menu", "write", "mainmenu.items.1.name", "&6&lHack toggles")
  238. VandalYML("menu", "write", "mainmenu.items.1.lore", "&7You can toggle any||&7tracked hacked here.")
  239. VandalYML("menu", "write", "mainmenu.items.1.evaluate", "{PREMADEGUI} toggles")
  240. VandalYML("menu", "write", "mainmenu.items.2.slot", "2")
  241. VandalYML("menu", "write", "mainmenu.items.2.item", "command block")
  242. VandalYML("menu", "write", "mainmenu.items.2.name", "&6&lSystem settings")
  243. VandalYML("menu", "write", "mainmenu.items.2.lore", "&7You can toggle any||&7system settings here.||&4&lComing soon!")
  244. VandalYML("menu", "write", "mainmenu.items.3.slot", "4")
  245. VandalYML("menu", "write", "mainmenu.items.3.item", "chest minecart")
  246. VandalYML("menu", "write", "mainmenu.items.3.name", "&6&lVersion and developer")
  247. VandalYML("menu", "write", "mainmenu.items.3.evaluate", "message ""&a&l-------------------------------------"" to player;message centered "" "", ""&6&l&nVandal Anti-Cheat&r"", "" "", ""&fDeveloped by: &a&lLimeGlass"" and ""&fVersion: &6&l{@version}"" to player;message ""&a&l-------------------------------------"" to player")
  248. VandalYML("menu", "write", "PremadeMenus.Toggles.name", " &4&l&nVandal Toggles")
  249. VandalYML("menu", "write", "PremadeMenus.Toggles.enabledItem.item", "light green stained clay")
  250. VandalYML("menu", "write", "PremadeMenus.Toggles.enabledItem.name", "&a&l{HACK}")
  251. VandalYML("menu", "write", "PremadeMenus.Toggles.enabledItem.lore", "&7{HACK} is currently {HACKSTATECOLOUR}{HACKSTATE}||&7Click to {ANTIHACKSTATECOLOUR}{ANTIHACKSTATE} &r&7{HACK} checking.")
  252. VandalYML("menu", "write", "PremadeMenus.Toggles.disabledItem.item", "red stained clay")
  253. VandalYML("menu", "write", "PremadeMenus.Toggles.disabledItem.name", "&c&l{HACK}")
  254. VandalYML("menu", "write", "PremadeMenus.Toggles.disabledItem.lore", "&7{HACK} is currently {HACKSTATECOLOUR}{HACKSTATE}||&7Click to {ANTIHACKSTATECOLOUR}{ANTIHACKSTATE} &r&7{HACK} checking.")
  255. VandalYML("menu", "write", "PremadeMenus.Toggles.back.item", "nether star")
  256. VandalYML("menu", "write", "PremadeMenus.Toggles.back.name", "&6&lBack")
  257. VandalYML("menu", "write", "PremadeMenus.Toggles.back.lore", "&7Go back to mainmenu.")
  258. VandalYMLSave()
  259. wait 2 seconds
  260. set {{@VarPrefix}::temp::running} to true
  261. while {{@VarPrefix}::temp::running} is set:
  262. add 1 tick to {{@VarPrefix}::temp::time}
  263. wait a tick
  264. if {{@VarPrefix}::config::Hacks.Killaura.Enabled} is "true":
  265. if {{@VarPrefix}::temp::time} >= "%{{@VarPrefix}::config::Hacks.Killaura.TestEvery}%" parsed as timespan:
  266. VandalKillauraTest()
  267. clear {{@VarPrefix}::temp::time}
  268. if {{@VarPrefix}::temp::time} >= "%{{@VarPrefix}::config::MaxTimeout}%" parsed as timespan:
  269. clear {{@VarPrefix}::temp::time}
  270. on script unload:
  271. delete {{@VarPrefix}::temp::*}
  272. command {@command}:
  273. trigger:
  274. if {{@VarPrefix}::config::accessMode} is "permissions" or "permission":
  275. if player doesn't have permission "%{{@VarPrefix}::config::permissions.gui}%":
  276. stop
  277. else if {{@VarPrefix}::config::accessMode} is "yaml" or "yml":
  278. if VandalYML("config", "read", "vandalManagers") doesn't contain "%player%":
  279. stop
  280. VandalOpenMenu("mainmenu", player)
  281. on inventory click:
  282. loop VandalYMLKeys("menu", "readlist", "Menus"):
  283. if inventory name of player's current inventory is "%{{@VarPrefix}::menu::%loop-value%.name}%":
  284. if "%inventory type of clicked inventory%" is "%{{@VarPrefix}::menu::%loop-value%.type}%":
  285. cancel event
  286. loop VandalYMLKeys("menu", "keynumbers", "%loop-value%.items"):
  287. if clicked item is VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.item") parsed as itemtype:
  288. if VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate") is not "<none>":
  289. if VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate") contains "{OPENGUI}" or "{GUI}":
  290. set {_menu} to VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate")
  291. replace all "{OPENGUI} ", "{OPENGUI}", "{GUI} " and "{GUI}" with "" in {_menu}
  292. VandalOpenMenu({_menu}, player)
  293. else if VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate") contains "{PREMADEGUI}" or "{OPENPREMADEGUI}":
  294. set {_menu} to VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate")
  295. replace all "{PREMADEGUI} ", "{PREMADEGUI}", "{OPENPREMADEGUI} " and "{OPENPREMADEGUI}" with "" in {_menu}
  296. VandalPremadeMenu({_menu}, player)
  297. loop VandalYML("menu", "read", "%loop-value-1%.items.%loop-value-2%.evaluate") split at ";":
  298. evaluate loop-value-3
  299. #loop premade menus once there are more:
  300. if inventory name of player's current inventory is "%{{@VarPrefix}::menu::PremadeMenus.Toggles.name}%":
  301. if "%inventory type of clicked inventory%" is "CHEST":
  302. cancel event
  303. if clicked slot is 0:
  304. if {{@VarPrefix}::config::Hacks.Killaura.Enabled} is "true":
  305. set {{@VarPrefix}::config::Hacks.Killaura.Enabled} to "false"
  306. else:
  307. set {{@VarPrefix}::config::Hacks.Killaura.Enabled} to "true"
  308. VandalPremadeMenu("Toggles", player)
  309. VandalYML("config", "write", "Hacks.Killaura.Enabled", "%{{@VarPrefix}::config::Hacks.Killaura.Enabled}%")
  310. else if clicked slot is 8:
  311. VandalOpenMenu("mainmenu", player)
  312. function hackMessage(hack: text, user: player):
  313. {{@VarPrefix}::config::Hacks.%{_hack}%.MessageStaff} is "true"
  314. loop all players:
  315. clear {_true}
  316. if {{@VarPrefix}::config::accessMode} is "permissions" or "permission":
  317. if loop-player has permission "%{{@VarPrefix}::config::permissions.staff}%":
  318. set {_true} to true
  319. else if {{@VarPrefix}::config::accessMode} is "yaml" or "yml":
  320. if VandalYML("config", "read", "vandalManagers") doesn't contain "%loop-player%":
  321. set {_true} to true
  322. if {_true} is true:
  323. set {_msg} to VandalPlaceholder({{@VarPrefix}::config::Hacks.%{_hack}%.Message}, {_user}, {_hack})
  324. message "%{{@VarPrefix}::config::prefix}%%{_msg}%" to loop-player
  325. on join:
  326. delete {{@VarPrefix}::temp::player::%player%::cheat::*}
  327. on script load:
  328. wait 2 seconds
  329. set {{@VarPrefix}::temp::running} to true
  330. if {{@VarPrefix}::config::Hacks.TooManyPackets.MaxPackets} is not set:
  331. set {{@VarPrefix}::config::Hacks.TooManyPackets.MaxPackets} to 2500
  332. while {{@VarPrefix}::temp::running} is set:
  333. loop all players:
  334. if {{@VarPrefix}::temp::player::%loop-player%::cheat::packets} > "%{{@VarPrefix}::config::Hacks.TooManyPackets.MaxPackets}%" parsed as number:
  335. loop {{@VarPrefix}::temp::player::%loop-player%::cheat::packets::*}:
  336. if {_value} is not set:
  337. set {_value} to loop-value-2
  338. set {_packet} to loop-index
  339. else if loop-value-2 > {_value}:
  340. set {_value} to loop-value-2
  341. set {_packet} to loop-index
  342. clear {{@VarPrefix}::temp::player::%loop-player%::cheat::highestPacket::*}
  343. set {{@VarPrefix}::temp::player::%loop-player%::cheat::highestPacket::%{_packet}%} to {_value}
  344. hackMessage("TooManyPackets", loop-player)
  345. if {{@VarPrefix}::config::Hacks.TooManyPackets.Action} is "Kick":
  346. kick loop-player due to VandalPlaceholder({{@VarPrefix}::config::Hacks.TooManyPackets.KickMsg}, loop-player, "TooManyPackets")
  347. else if {{@VarPrefix}::config::Hacks.TooManyPackets.Action} is "Ban":
  348. ban loop-player due to VandalPlaceholder({{@VarPrefix}::config::Hacks.TooManyPackets.BanMsg}, loop-player, "TooManyPackets")
  349. else if {{@VarPrefix}::config::Hacks.TooManyPackets.Action} is "Evaluate":
  350. evaluate VandalPlaceholder({{@VarPrefix}::config::Hacks.TooManyPackets.Evaluate}, loop-player, "TooManyPackets")
  351. clear {{@VarPrefix}::temp::player::%loop-player%::cheat::packets::*}
  352. clear {{@VarPrefix}::temp::player::%loop-player%::cheat::packets}
  353. wait a second
  354. on packet:
  355. wait a tick
  356. add 1 to {{@VarPrefix}::temp::player::%player%::cheat::packets}
  357. add 1 to {{@VarPrefix}::temp::player::%player%::cheat::packets::%event-string%}
Add Comment
Please, Sign In to add comment