xXm0dzXx

Untitled

Oct 3rd, 2012
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 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. local tID = 185
  6.  
  7. --file generator
  8. local function fNameGen() --generate filename
  9. local tempFile = {}
  10. for i = 1,8 do
  11. local tabNum = math.random(1,3)
  12. if tabNum == 1 then
  13. local k = math.random(1,#alpha)
  14. tempFile[i] = alpha[k]
  15. elseif tabNum == 2 then
  16. local k = math.random(1,#alphaCap)
  17. tempFile[i] = alphaCap[k]
  18. elseif tabNum ==3 then
  19. local k = math.random(1,#decimal)
  20. tempFile[i] = decimal[k]
  21. end
  22. end
  23. local filename = table.concat(tempFile)
  24. return filename
  25. end
  26.  
  27. local function existing( code )
  28. local response = http.get("http://pastebin.com/raw.php?i="..code)
  29. if response then
  30. return true
  31. end
  32. return false
  33. end
  34.  
  35. rednet.open("front")
  36. local tAttempts = {}
  37.  
  38. while true do
  39. term.clear()
  40. term.setCursorPos(1,1)
  41. print("Codes found: ")
  42. for i=1,#tAttempts do
  43. print("http://pastebin.com/" ..tAttempts[i])
  44. end
  45. local code1 = fNameGen()
  46. if existing(code1) then
  47. rednet.send(tID, code1)
  48. tAttempts[#tAttempts+1] = code1
  49. end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment