Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Decompiled using luadec 2.0.1 by sztupy (http://winmo.sztupy.hu)
- -- Command line was: metaguard.luac
- MetaGuard = {}
- package.loadlib("sys/lua/metaguard.dll", "metaguard")()
- print("\169255220000Loading MetaGuard.")
- print("\169255220000Version: " .. metaguardlib.version())
- metaguardlib.init()
- if string.split == nil then
- string.split = function(l_1_0, l_1_1)
- local sep, fields = l_1_0 or " ", {}
- local pattern = string.format("([^%s]+)", sep)
- string.gsub(l_1_1, pattern, function(l_1_0)
- fields[#fields + 1] = l_1_0
- end)
- return fields
- end
- end
- local metaguard_detected = function(l_2_0, l_2_1, l_2_2)
- if l_2_1 ~= 0 and metaguardlib.is_enabled(l_2_1) == false then
- return
- end
- local cheat_names = {}
- cheat_names[1] = "Scopehack"
- cheat_names[2] = "Wallhack"
- cheat_names[3] = "Silentwalk"
- cheat_names[4] = "Speedhack"
- local action_names = {}
- action_names[0] = "Kicked"
- action_names[1] = "Banned"
- if not l_2_2 then
- local actionid = metaguardlib.get_action()
- end
- if l_2_1 ~= 5 then
- if actionid ~= 2 then
- msg("\169255000000\171 MetaGuard \187 " .. player(l_2_0, "name") .. " seems to be a cheater! " .. action_names[actionid] .. "!")
- end
- local usgnid = player(l_2_0, "usgn")
- local ipaddress = player(l_2_0, "ip")
- local reason = ""
- local stime_a = 0
- local stime_b = 1440
- if actionid == 2 then
- reason = "The server detected a cheat!|Please contact MetaGuard|in order to get more info about this.|\187www.MetaTracker.tk/listcheater\171"
- elseif l_2_1 == 3 or l_2_1 == 4 then
- local decided = ""
- if actionid == 1 then
- decided = "kickban"
- else
- decided = "kick"
- end
- stime_a = 60
- stime_b = 60
- reason = cheat_names[l_2_1] .. " suspicion!|You were suspiciously fast! The " .. string.lower(cheat_names[l_2_1]) .. " detection therefore decided to " .. decided .. " you. Detection failures are possible. They can be caused by network turbulences, lags and high pings."
- if actionid == 1 then
- reason = reason .. " You will be able to re-join in 1 hour."
- else
- reason = reason .. " We are sorry if you did not " .. string.lower(cheat_names[l_2_1]) .. "."
- end
- else
- local decided = ""
- if actionid == 1 then
- decided = "kickban"
- else
- decided = "kick"
- end
- reason = cheat_names[l_2_1] .. " detected!|The " .. string.lower(cheat_names[l_2_1]) .. " detection therefore decided to " .. decided .. " you."
- if actionid == 1 and usgnid == 0 then
- reason = reason .. " You will be able to re-join in 1 day."
- end
- end
- parse("kick " .. l_2_0 .. " \"" .. reason .. "\"")
- if actionid == 1 then
- if usgnid ~= 0 then
- parse("banusgn " .. usgnid .. " " .. stime_a)
- end
- parse("banip " .. ipaddress .. " " .. stime_b)
- end
- end
- end
- MetaGuard.OnParse = function(l_3_0)
- local cmd = string.split(" ", l_3_0)[1]
- local args_str = string.sub(l_3_0, string.len(cmd) + 2)
- local tmp = {}
- local tmp_str = args_str
- for str in string.gmatch(args_str, "\"([^\"]*)\"") do
- table.insert(tmp, str)
- tmp_str = string.gsub(tmp_str, "\"" .. str .. "\"", "mg_tmp_" .. #tmp)
- end
- local args = string.split(" ", tmp_str)
- if #tmp > 0 then
- for i,arg in pairs(args) do
- for k,str in pairs(tmp) do
- args[i] = string.gsub(args[i], "mg_tmp_" .. k, str)
- end
- end
- end
- args[0] = args_str
- if cmd == "mg_action" then
- metaguardlib.set_action(tonumber(args[1]))
- return 1
- elseif cmd == "mg_antiscopehack" then
- metaguardlib.set_enabled(1, tonumber(args[1]))
- return 1
- elseif cmd == "mg_antiwallhack" then
- metaguardlib.set_enabled(2, tonumber(args[1]))
- return 1
- elseif cmd == "mg_antisilentwalk" then
- metaguardlib.set_enabled(3, tonumber(args[1]))
- return 1
- elseif cmd == "mg_antispeeder" then
- metaguardlib.set_enabled(4, tonumber(args[1]))
- return 1
- elseif cmd == "setpos" then
- metaguardlib.setpos(tonumber(args[1]))
- return 0
- end
- end
- addhook("parse", "MetaGuard.OnParse")
- MetaGuard.OnAdvancedFire = function(l_4_0, l_4_1)
- if metaguardlib.attack2(l_4_0, l_4_1) == 1 then
- metaguard_detected(l_4_0, 1)
- end
- end
- addhook("attack2", "MetaGuard.OnAdvancedFire")
- MetaGuard.OnJoin = function(l_5_0)
- if player(l_5_0, "bot") == false then
- local ischeater = metaguardlib.join(l_5_0, player(l_5_0, "name"), player(l_5_0, "ip"), player(l_5_0, "usgn"))
- if ischeater == 1 then
- metaguard_detected(l_5_0, 0, 2)
- end
- end
- end
- addhook("join", "MetaGuard.OnJoin")
- MetaGuard.OnLeave = function(l_6_0, l_6_1)
- if player(l_6_0, "bot") == false then
- metaguardlib.leave(l_6_0, l_6_1)
- end
- end
- addhook("leave", "MetaGuard.OnLeave")
- MetaGuard.OnMove = function(l_7_0, l_7_1, l_7_2, l_7_3)
- local detecte = metaguardlib.move(l_7_0, l_7_1, l_7_2, l_7_3, player(l_7_0, "speedmod"), player(l_7_0, "ping"))
- if detecte == 1 then
- metaguard_detected(l_7_0, 4)
- elseif detecte == 2 then
- metaguard_detected(l_7_0, 3)
- end
- end
- addhook("move", "MetaGuard.OnMove")
- MetaGuard.OnMoveTile = function(l_8_0, l_8_1, l_8_2)
- if entity(l_8_1, l_8_2, "type") == 70 then
- metaguardlib.setpos(l_8_0)
- end
- for _,i in pairs(object(0, "table")) do
- if object(i, "tilex") == l_8_1 and object(i, "tiley") == l_8_2 and (object(i, "type") == 13 or object(i, "type") == 22 or object(i, "type") == 23) then
- metaguardlib.setpos(l_8_0)
- end
- end
- end
- addhook("movetile", "MetaGuard.OnMoveTile")
- MetaGuard.OnSay = function(l_9_0, l_9_1)
- if l_9_1 == "metaguard" then
- msg2(l_9_0, "\169255000000\171 MetaGuard \187 Hello world!")
- return 1
- end
- end
- addhook("say", "MetaGuard.OnSay")
- MetaGuard.OnSayTeam = function(l_10_0, l_10_1)
- if l_10_1 == "metaguard" then
- msg2(l_10_0, "\169255000000\171 MetaGuard \187 Hello world!")
- return 1
- end
- end
- addhook("sayteam", "MetaGuard.OnSayTeam")
- MetaGuard.OnChangeWeapon = function(l_11_0, l_11_1, l_11_2)
- if metaguardlib.select(l_11_0, l_11_2) == 1 then
- metaguard_detected(l_11_0, 1)
- end
- end
- addhook("select", "MetaGuard.OnChangeWeapon")
- MetaGuard.OnSpawn = function(l_12_0)
- metaguardlib.setpos(l_12_0)
- end
- addhook("spawn", "MetaGuard.OnSpawn")
- MetaGuard.OnUseButton = function(l_13_0, l_13_1, l_13_2)
- if metaguardlib.usebutton(l_13_0, l_13_1, l_13_2, player(l_13_0, "tilex"), player(l_13_0, "tiley")) == 0 then
- metaguard_detected(l_13_0, 2)
- parse("trigger " .. entity(l_13_1, l_13_2, "trigger"))
- end
- end
- addhook("usebutton", "MetaGuard.OnUseButton")
- parse("exec sys/metainnovative.cfg")
- print("\169255220000MetaGuard loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement