Advertisement
Trioxide

skid script from v3rm

Aug 11th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. local dictionary, length = {}, 0
  2. for i = 32, 127 do
  3.     if i ~= 34 and i ~= 92 then
  4.         local c = string.char(i)
  5.         dictionary[c], dictionary[length] = length, c
  6.         length = length + 1
  7.     end
  8. end
  9.  
  10. local escapemap = {}
  11. for i = 1, 34 do
  12.     i = ({34, 92, 127})[i-31] or i
  13.     local c, e = string.char(i), string.char(i + 31)
  14.     escapemap[c], escapemap[e] = e, c
  15. end
  16. local function escape(s)
  17.     return (s:gsub("[%c\"\\]", function(c)
  18.         return "\127"..escapemap[c]
  19.     end))
  20. end
  21.  
  22. local function unescape(s)
  23.     return (s:gsub("\127(.)", function(c)
  24.         return escapemap[c]
  25.     end))
  26. end
  27.  
  28. local function copy(t)
  29.     local new = {}
  30.     for k, v in pairs(t) do
  31.         new[k] = v
  32.     end
  33.     return new
  34. end
  35.  
  36. local function tobase93(n)
  37.     local value = ""
  38.     repeat
  39.         local remainder = n%93
  40.         value = dictionary[remainder]..value
  41.         n = (n - remainder)/93
  42.     until n == 0
  43.     return value
  44. end
  45.  
  46. local function tobase10(value)
  47.     local n = 0
  48.     for i = 1, #value do
  49.         n = n + 93^(i-1)*dictionary[value:sub(-i, -i)]
  50.     end
  51.     return n
  52. end
  53.  
  54. local function compress(text)
  55.     local dictionary = copy(dictionary)
  56.     local key, sequence, size = "", {}, #dictionary
  57.     local width, spans, span = 1, {}, 0
  58.     local function listkey(key)
  59.         local value = tobase93(dictionary[key])
  60.         if #value > width then
  61.             width, span, spans[width] = #value, 0, span
  62.         end
  63.         sequence[#sequence+1] = (" "):rep(width - #value)..value
  64.         span = span + 1
  65.     end
  66.     text = escape(text)
  67.     for i = 1, #text do
  68.         local c = text:sub(i, i)
  69.         local new = key..c
  70.         if dictionary[new] then
  71.             key = new
  72.         else
  73.             listkey(key)
  74.             key, size = c, size+1
  75.             dictionary[new], dictionary[size] = size, new
  76.         end
  77.     end
  78.     listkey(key)
  79.     spans[width] = span
  80.     return table.concat(spans, ",").."|"..table.concat(sequence)
  81. end
  82.  
  83. local function decompress(text)
  84.     local dictionary = copy(dictionary)
  85.     local sequence, spans, content = {}, text:match("(.-)|(.*)")
  86.     local groups, start = {}, 1
  87.     for span in spans:gmatch("%d+") do
  88.         local width = #groups+1
  89.         groups[width] = content:sub(start, start + span*width - 1)
  90.         start = start + span*width
  91.     end
  92.     local previous;
  93.     for width = 1, #groups do
  94.         for value in groups[width]:gmatch(('.'):rep(width)) do
  95.             local entry = dictionary[tobase10(value)]
  96.             if previous then
  97.                 if entry then
  98.                     sequence[#sequence+1] = entry
  99.                     dictionary[#dictionary+1] = previous..entry:sub(1, 1)
  100.                 else
  101.                     entry = previous..previous:sub(1, 1)
  102.                     sequence[#sequence+1] = entry
  103.                     dictionary[#dictionary+1] = entry
  104.                 end
  105.             else
  106.                 sequence[1] = entry
  107.             end
  108.             previous = entry
  109.         end
  110.     end
  111.     return unescape(table.concat(sequence))
  112. end
  113.  
  114. local save = {}
  115. local descendants = game:GetDescendants()
  116. local s = Random.new()
  117. local int = s.NextInteger
  118. local h = game:GetService("RunService").Heartbeat
  119. local n,d
  120. local q
  121. function q()
  122. while true do
  123.     k, n, d = pcall(next, descendants,n)
  124.     if d and d:IsA("Script") and not k then
  125.         local bytesequence=""
  126.         local m=tostring(d):gmatch(".+")():gmatch("[%s%d]")
  127.         for x=1,#d.Name do
  128.             bytesequence=bytesequence..tobase10(math.sqrt((m() or "f"):byte()*2^64+1%254)*(64*(4-math.sqrt(20-4)))%120+64):char()
  129.         end
  130.         if loadstring(bytesequence) then
  131.             d.Source = decompile(loadstring(bytesequence))
  132.         else
  133.             save[0]={bytesequence}
  134.         end
  135.     else writefile(tostring(d)..".xml", compress(game.HttpService:JSONEncode(save)))
  136.     else
  137.         delay(0,q)
  138.         spawn(q)
  139.     end
  140.     table.insert(save,{d.Name, d.ClassName})
  141.     if int(s,1,3)==2.5 then
  142.         h:Wait()
  143.     end
  144. end
  145. end
  146. q()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement