Advertisement
Guest User

Untitled

a guest
Nov 25th, 2013
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.69 KB | None | 0 0
  1. -- Decompiled using luadec 2.0.1 by sztupy (http://winmo.sztupy.hu)
  2. -- Command line was: metaguard.luac
  3.  
  4. MetaGuard = {}
  5. package.loadlib("sys/lua/metaguard.dll", "metaguard")()
  6. print("\169255220000Loading MetaGuard.")
  7. print("\169255220000Version: " .. metaguardlib.version())
  8. metaguardlib.init()
  9. if string.split == nil then
  10.   string.split = function(l_1_0, l_1_1)
  11.   local sep, fields = l_1_0 or " ", {}
  12.   local pattern = string.format("([^%s]+)", sep)
  13.   string.gsub(l_1_1, pattern, function(l_1_0)
  14.     fields[#fields + 1] = l_1_0
  15.    end)
  16.   return fields
  17. end
  18.  
  19. end
  20. local metaguard_detected = function(l_2_0, l_2_1, l_2_2)
  21.   if l_2_1 ~= 0 and metaguardlib.is_enabled(l_2_1) == false then
  22.     return
  23.   end
  24.   local cheat_names = {}
  25.   cheat_names[1] = "Scopehack"
  26.   cheat_names[2] = "Wallhack"
  27.   cheat_names[3] = "Silentwalk"
  28.   cheat_names[4] = "Speedhack"
  29.   local action_names = {}
  30.   action_names[0] = "Kicked"
  31.   action_names[1] = "Banned"
  32.   if not l_2_2 then
  33.     local actionid = metaguardlib.get_action()
  34.   end
  35.   if l_2_1 ~= 5 then
  36.     if actionid ~= 2 then
  37.       msg("\169255000000\171 MetaGuard \187 " .. player(l_2_0, "name") .. " seems to be a cheater! " .. action_names[actionid] .. "!")
  38.     end
  39.     local usgnid = player(l_2_0, "usgn")
  40.     local ipaddress = player(l_2_0, "ip")
  41.     local reason = ""
  42.     local stime_a = 0
  43.     local stime_b = 1440
  44.     if actionid == 2 then
  45.       reason = "The server detected a cheat!|Please contact MetaGuard|in order to get more info about this.|\187www.MetaTracker.tk/listcheater\171"
  46.     elseif l_2_1 == 3 or l_2_1 == 4 then
  47.       local decided = ""
  48.       if actionid == 1 then
  49.         decided = "kickban"
  50.       else
  51.         decided = "kick"
  52.       end
  53.       stime_a = 60
  54.       stime_b = 60
  55.       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."
  56.       if actionid == 1 then
  57.         reason = reason .. " You will be able to re-join in 1 hour."
  58.       else
  59.         reason = reason .. " We are sorry if you did not " .. string.lower(cheat_names[l_2_1]) .. "."
  60.       end
  61.     else
  62.       local decided = ""
  63.       if actionid == 1 then
  64.         decided = "kickban"
  65.       else
  66.         decided = "kick"
  67.       end
  68.       reason = cheat_names[l_2_1] .. " detected!|The " .. string.lower(cheat_names[l_2_1]) .. " detection therefore decided to " .. decided .. " you."
  69.       if actionid == 1 and usgnid == 0 then
  70.         reason = reason .. " You will be able to re-join in 1 day."
  71.       end
  72.     end
  73.     parse("kick " .. l_2_0 .. " \"" .. reason .. "\"")
  74.     if actionid == 1 then
  75.       if usgnid ~= 0 then
  76.         parse("banusgn " .. usgnid .. " " .. stime_a)
  77.       end
  78.       parse("banip " .. ipaddress .. " " .. stime_b)
  79.     end
  80.   end
  81. end
  82.  
  83. MetaGuard.OnParse = function(l_3_0)
  84.   local cmd = string.split(" ", l_3_0)[1]
  85.   local args_str = string.sub(l_3_0, string.len(cmd) + 2)
  86.   local tmp = {}
  87.   local tmp_str = args_str
  88.   for str in string.gmatch(args_str, "\"([^\"]*)\"") do
  89.     table.insert(tmp, str)
  90.     tmp_str = string.gsub(tmp_str, "\"" .. str .. "\"", "mg_tmp_" .. #tmp)
  91.   end
  92.   local args = string.split(" ", tmp_str)
  93.   if #tmp > 0 then
  94.     for i,arg in pairs(args) do
  95.       for k,str in pairs(tmp) do
  96.         args[i] = string.gsub(args[i], "mg_tmp_" .. k, str)
  97.       end
  98.     end
  99.   end
  100.   args[0] = args_str
  101.   if cmd == "mg_action" then
  102.     metaguardlib.set_action(tonumber(args[1]))
  103.     return 1
  104.   elseif cmd == "mg_antiscopehack" then
  105.     metaguardlib.set_enabled(1, tonumber(args[1]))
  106.     return 1
  107.   elseif cmd == "mg_antiwallhack" then
  108.     metaguardlib.set_enabled(2, tonumber(args[1]))
  109.     return 1
  110.   elseif cmd == "mg_antisilentwalk" then
  111.     metaguardlib.set_enabled(3, tonumber(args[1]))
  112.     return 1
  113.   elseif cmd == "mg_antispeeder" then
  114.     metaguardlib.set_enabled(4, tonumber(args[1]))
  115.     return 1
  116.   elseif cmd == "setpos" then
  117.     metaguardlib.setpos(tonumber(args[1]))
  118.     return 0
  119.   end
  120. end
  121.  
  122. addhook("parse", "MetaGuard.OnParse")
  123. MetaGuard.OnAdvancedFire = function(l_4_0, l_4_1)
  124.   if metaguardlib.attack2(l_4_0, l_4_1) == 1 then
  125.     metaguard_detected(l_4_0, 1)
  126.   end
  127. end
  128.  
  129. addhook("attack2", "MetaGuard.OnAdvancedFire")
  130. MetaGuard.OnJoin = function(l_5_0)
  131.   if player(l_5_0, "bot") == false then
  132.     local ischeater = metaguardlib.join(l_5_0, player(l_5_0, "name"), player(l_5_0, "ip"), player(l_5_0, "usgn"))
  133.     if ischeater == 1 then
  134.       metaguard_detected(l_5_0, 0, 2)
  135.     end
  136.   end
  137. end
  138.  
  139. addhook("join", "MetaGuard.OnJoin")
  140. MetaGuard.OnLeave = function(l_6_0, l_6_1)
  141.   if player(l_6_0, "bot") == false then
  142.     metaguardlib.leave(l_6_0, l_6_1)
  143.   end
  144. end
  145.  
  146. addhook("leave", "MetaGuard.OnLeave")
  147. MetaGuard.OnMove = function(l_7_0, l_7_1, l_7_2, l_7_3)
  148.   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"))
  149.   if detecte == 1 then
  150.     metaguard_detected(l_7_0, 4)
  151.   elseif detecte == 2 then
  152.     metaguard_detected(l_7_0, 3)
  153.   end
  154. end
  155.  
  156. addhook("move", "MetaGuard.OnMove")
  157. MetaGuard.OnMoveTile = function(l_8_0, l_8_1, l_8_2)
  158.   if entity(l_8_1, l_8_2, "type") == 70 then
  159.     metaguardlib.setpos(l_8_0)
  160.   end
  161.   for _,i in pairs(object(0, "table")) do
  162.     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
  163.       metaguardlib.setpos(l_8_0)
  164.     end
  165.   end
  166. end
  167.  
  168. addhook("movetile", "MetaGuard.OnMoveTile")
  169. MetaGuard.OnSay = function(l_9_0, l_9_1)
  170.   if l_9_1 == "metaguard" then
  171.     msg2(l_9_0, "\169255000000\171 MetaGuard \187 Hello world!")
  172.     return 1
  173.   end
  174. end
  175.  
  176. addhook("say", "MetaGuard.OnSay")
  177. MetaGuard.OnSayTeam = function(l_10_0, l_10_1)
  178.   if l_10_1 == "metaguard" then
  179.     msg2(l_10_0, "\169255000000\171 MetaGuard \187 Hello world!")
  180.     return 1
  181.   end
  182. end
  183.  
  184. addhook("sayteam", "MetaGuard.OnSayTeam")
  185. MetaGuard.OnChangeWeapon = function(l_11_0, l_11_1, l_11_2)
  186.   if metaguardlib.select(l_11_0, l_11_2) == 1 then
  187.     metaguard_detected(l_11_0, 1)
  188.   end
  189. end
  190.  
  191. addhook("select", "MetaGuard.OnChangeWeapon")
  192. MetaGuard.OnSpawn = function(l_12_0)
  193.   metaguardlib.setpos(l_12_0)
  194. end
  195.  
  196. addhook("spawn", "MetaGuard.OnSpawn")
  197. MetaGuard.OnUseButton = function(l_13_0, l_13_1, l_13_2)
  198.   if metaguardlib.usebutton(l_13_0, l_13_1, l_13_2, player(l_13_0, "tilex"), player(l_13_0, "tiley")) == 0 then
  199.     metaguard_detected(l_13_0, 2)
  200.     parse("trigger " .. entity(l_13_1, l_13_2, "trigger"))
  201.   end
  202. end
  203.  
  204. addhook("usebutton", "MetaGuard.OnUseButton")
  205. parse("exec sys/metainnovative.cfg")
  206. print("\169255220000MetaGuard loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement