Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. local chars = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}
  2. local maxlength = 8
  3.  
  4.  
  5. local length = 1
  6. local uni = Instance.new("UnionOperation")
  7.  
  8.  
  9. function increment(t, ind)
  10. t[ind] = t[ind]+1
  11. if t[ind] > #chars then
  12. t[ind] = 1
  13. increment(t, ind-1)
  14. end
  15. end
  16.  
  17. function check(t)
  18. local attempt = ""
  19. for i=1, #t do
  20. attempt = attempt .. chars[t[i]]
  21. end
  22.  
  23. local __, status = pcall(function() local a = uni[attempt] end)
  24. if not status or not string.find(status, "is not a valid member") then
  25. print(attempt)
  26. wait(1)
  27. end
  28. end
  29.  
  30. function checkOfLength(clength)
  31. local current = {}
  32. for i=1, clength do
  33. current[i] = 1
  34. end
  35. local maxattempts = math.pow(#chars, clength)
  36. local attempts = 1
  37. while attempts ~= maxattempts do
  38. increment(current, clength)
  39. check(current)
  40. attempts = attempts+1
  41. end
  42. print("FINISHED CHECKING OF LENGTH " .. clength)
  43. wait(1)
  44. end
  45.  
  46. for k=1, maxlength do
  47. checkOfLength(k)
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement