Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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"}
- 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"}
- local decimal = {"1","2","3","4","5","6","7","8","9","0"}
- local tID = 185
- --file generator
- local function fNameGen() --generate filename
- local tempFile = {}
- for i = 1,8 do
- local tabNum = math.random(1,3)
- if tabNum == 1 then
- local k = math.random(1,#alpha)
- tempFile[i] = alpha[k]
- elseif tabNum == 2 then
- local k = math.random(1,#alphaCap)
- tempFile[i] = alphaCap[k]
- elseif tabNum ==3 then
- local k = math.random(1,#decimal)
- tempFile[i] = decimal[k]
- end
- end
- local filename = table.concat(tempFile)
- return filename
- end
- local function existing( code )
- local response = http.get("http://pastebin.com/raw.php?i="..code)
- if response then
- return true
- end
- return false
- end
- rednet.open("front")
- local tAttempts = {}
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Codes found: ")
- for i=1,#tAttempts do
- print("http://pastebin.com/" ..tAttempts[i])
- end
- local code1 = fNameGen()
- if existing(code1) then
- rednet.send(tID, code1)
- tAttempts[#tAttempts+1] = code1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment