xXm0dzXx

Untitled

Oct 3rd, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. local alpha = {"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 alphaCap = {"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"}
  3. local decimal = {"1","2","3","4","5","6","7","8","9","0"}
  4.  
  5. --file generator
  6. local function fNameGen() --generate filename
  7. local tempFile = {}
  8. for i = 1,8 do
  9. local tabNum = math.random(1,3)
  10. if tabNum == 1 then
  11. local k = math.random(1,#alpha)
  12. tempFile[i] = alpha[k]
  13. elseif tabNum == 2 then
  14. local k = math.random(1,#alphaCap)
  15. tempFile[i] = alphaCap[k]
  16. elseif tabNum ==3 then
  17. local k = math.random(1,#decimal)
  18. tempFile[i] = decimal[k]
  19. end
  20. end
  21. local filename = table.concat(tempFile)
  22. return filename
  23. end
  24.  
  25. local function existing( code )
  26. local response = http.get("http://pastebin.com/raw.php?i="..code)
  27. if response then
  28. local site = response.readAll()
  29. response.close()
  30. local file = fs.open(".spam/"..code,"w")
  31. file.write(site)
  32. file.close()
  33. return "COMPLETE"
  34. else return "FAILURE!"
  35. end
  36. end
  37.  
  38. print("---------+----------+----------+----------+")
  39.  
  40. while true do
  41. local code1 = fNameGen()
  42. local code2 = fNameGen()
  43. local code3 = fNameGen()
  44. local code4 = fNameGen()
  45. print(code1.. " | " ..code2.. " | " ..code3.. " | " ..code4.. " |")
  46. print(existing(code1).. " | " ..existing(code2).. " | " ..existing(code3).. " | " ..existing(code4).. " |")
  47. print("---------+----------+----------+----------+")
  48. end
Advertisement
Add Comment
Please, Sign In to add comment