Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.94 KB | None | 0 0
  1.  
  2.  
  3. local function quarry(discordia, client, message, args, getLib)
  4.     print("Quarrying...")
  5.     local guild = client:getGuild("582232156013854740")
  6.     local giveawayChannel = guild:getChannel("653408642304835584")
  7.     local executesnChannel = guild:getChannel("582232156013854742")
  8.     local executeoChannel = guild:GetChannel("")
  9.  
  10.     local entries = {}
  11.     local giveawayTotal = 0
  12.     local executesTotal = 0
  13.  
  14.     for i,msg in next, giveawayChannel:getMessages(100):toArray() do
  15.         giveawayTotal = giveawayTotal + 1
  16.         local content = msg.content
  17.         lastId = msg.id
  18.         local set = false
  19.  
  20.         for match in content:gmatch("%b()") do
  21.             if not ran then
  22.                 ALIAS = match
  23.                 ran = true
  24.             else
  25.                 IP = match
  26.                 ran = nil
  27.             end
  28.         end
  29.        
  30.         for i,candidate in next, entries do
  31.             if candidate[2] == IP then
  32.                 set = true
  33.             end
  34.         end
  35.         if not set then
  36.             entry = {ALIAS,IP}
  37.             table.insert(entries, entry)
  38.         end
  39.     end
  40.  
  41.     repeat
  42.         omsg = nmsg
  43.         for i,msg in next, giveawayChannel:getMessagesBefore(lastId,100):toArray() do
  44.             giveawayTotal = giveawayTotal + 1
  45.             local content = msg.content
  46.             lastId = msg.id
  47.             local set = false
  48.             nmsg = msg
  49.             for match in content:gmatch("%b()") do
  50.                 if not ran then
  51.                     ALIAS = match
  52.                     ran = true
  53.                 else
  54.                     IP = match
  55.                     ran = nil
  56.                 end
  57.             end
  58.            
  59.             for i,candidate in next, entries do
  60.                 if candidate[2] == IP then
  61.                     set = true
  62.                 end
  63.             end
  64.             if not set then
  65.                 entry = {ALIAS,IP,false,0,""}
  66.                 table.insert(entries, entry)
  67.             end
  68.         end
  69.     until omsg == nmsg
  70.  
  71.     for i,msg in next, executesnChannel:getMessages(100):toArray() do
  72.         executesTotal = executesTotal + 1
  73.         content = msg.content
  74.         lastId = msg.id
  75.  
  76.         i = 1
  77.         for match in content:gmatch("%b()") do
  78.             if i == 3 then
  79.                 IP = match
  80.                 break
  81.             end
  82.             i = i + 1
  83.         end
  84.  
  85.         for i,entry in next, entries do
  86.             if entry[2] == IP then
  87.                 print("Match Found: "..entry[1])
  88.                 entry[3] = true
  89.                 entry[4] = msg.createdAt
  90.             end
  91.         end
  92.     end
  93.     repeat
  94.         omsg = nmsg
  95.         for i,msg in next, executesnChannel:getMessagesBefore(lastId,100):toArray() do
  96.             executesTotal = executesTotal + 1
  97.             content = msg.content
  98.             lastId = msg.id
  99.             nmsg = msg
  100.  
  101.             i = 1
  102.             for match in content:gmatch("%b()") do
  103.                 if i == 3 then
  104.                     IP = match
  105.                     break
  106.                 end
  107.                 i = i + 1
  108.             end
  109.  
  110.             for i,entry in next, entries do
  111.                 if entry[2] == IP then
  112.                     print("Match Found: "..entry[1])
  113.                     entry[3] = true
  114.                     entry[4] = msg.createdAt
  115.                 end
  116.             end
  117.         end
  118.         print("Quarrying messages 1 ("..nmsg.timestamp.." / "..executesTotal..")")
  119.     until omsg == nmsg
  120.  
  121.     for i,msg in next, executesoChannel:getMessages(100):toArray() do
  122.         executesTotal = executesTotal + 1
  123.         content = msg.content
  124.         lastId = msg.id
  125.  
  126.         i = 1
  127.         for match in content:gmatch("%b()") do
  128.             if i == 3 then
  129.                 IP = match
  130.                 break
  131.             end
  132.             i = i + 1
  133.         end
  134.  
  135.         for i,entry in next, entries do
  136.             if entry[2] == IP then
  137.                 print("Match Found: "..entry[1])
  138.                 entry[3] = true
  139.                 entry[4] = msg.createdAt
  140.             end
  141.         end
  142.     end
  143.     repeat
  144.         omsg = nmsg
  145.         for i,msg in next, executesoChannel:getMessagesBefore(lastId,100):toArray() do
  146.             executesTotal = executesTotal + 1
  147.             content = msg.content
  148.             lastId = msg.id
  149.             nmsg = msg
  150.  
  151.             i = 1
  152.             for match in content:gmatch("%b()") do
  153.                 if i == 3 then
  154.                     IP = match
  155.                     break
  156.                 end
  157.                 i = i + 1
  158.             end
  159.  
  160.             for i,entry in next, entries do
  161.                 if entry[2] == IP then
  162.                     print("Match Found: "..entry[1])
  163.                     entry[3] = true
  164.                     entry[4] = msg.createdAt
  165.                 end
  166.             end
  167.         end
  168.         print("Quarrying messages 2 ("..nmsg.timestamp.." / "..executesTotal..")")
  169.     until omsg == nmsg
  170.  
  171.  
  172.     -- End of quarry conclusion
  173.     print("END OF QUARRY RESULT")
  174.     for _,v in next, entries do
  175.         if v[3] then
  176.             print(v[2].." Alias: "..v[1].." "..v[4])
  177.         end
  178.     end
  179.     print("NUMBER OF GIVEAWAY ENTRIES ("..giveawayTotal.."/"..#entries..")")
  180. end
  181.  
  182. return quarry
  183.  
  184. --[[ Table References
  185.  
  186. -- giveawayTotal
  187. {users,ip}
  188.  
  189. ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement